-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgenLiDARPointsGivenObjectList.m
30 lines (28 loc) · 1.49 KB
/
genLiDARPointsGivenObjectList.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function [object_list, LiDAR_opts, boundary] = genLiDARPointsGivenObjectList(opts, object_list, LiDAR_opts, boundary)
% Genereate uncalibrated LiDAR points
if ~isfield(LiDAR_opts, 'properties') || ~isfield(LiDAR_opts, 'pose') || ~isfield(LiDAR_opts, 'mechanism')
% LiDAR properties
LiDAR_opts.properties.range = 150;
LiDAR_opts.properties.return_once = 0;
LiDAR_opts.pose.centriod = [0 0 0];
LiDAR_opts.pose.rpy = [0 0 0]; % deg (roll pitch yaw)
LiDAR_opts.pose.H = constructHByRPYXYZ(LiDAR_opts.pose.rpy, LiDAR_opts.pose.centriod);
LiDAR_opts.properties.mechanics_noise_model = 3;
LiDAR_opts.properties.sensor_noise_enable = 0;
LiDAR_opts.properties.rpm = 1200; % 300, 600, 900, 1200
LiDAR_opts.properties = getLiDARPreperties("UltraPuckV2", LiDAR_opts.properties);
[LiDAR_opts.properties.ring_elevation, ...
LiDAR_opts.properties.ordered_ring_elevation] = parseLiDARStruct(LiDAR_opts.properties, 'ring_', LiDAR_opts.properties.beam);
LiDAR_opts.mechanism.types = ["rotating-head", "solid-state"];
LiDAR_opts.mechanism.type = 1;
end
if isempty(boundary)
% Workspace boundary
boundary.x = [160, -160];
boundary.y = [160, -160];
boundary.z = [160, -160];
boundary.vertices = createBoxVertices(boundary);
boundary.faces = createBoxFaces(boundary.vertices);
end
[object_list, ~, ~]= simulateLiDAR(object_list, boundary, LiDAR_opts);
end