Usage:
LIDAR(x, N, ang_Res, dist, obs, error)
xis the current robot's x,y positionNis the number of active robotsang_Resis how many 360/N rays to be generateddistis the maximum distance range of a rayobsare predefined obstacles given by its verticeserroris defined as either 'None' or 'Gaussian'
returns
output: a matrix of all calculated intersection points [x,y]
Refer to the go_to_pose.m file for an example of the function call, obstacle initialization, and plotting routine
Plotting:
- Initialize Plot of LIDAR points before experiment loop:
RGB = [255 0 0]/256;
scan = [0,0];
h = scatter(scan(:,1), scan(:,2), 72, RGB, 'filled');
- In loop plotting update:
[numP,numCols] = size(scan);
for g = 1:numP
set(h,'XData',scan(:,1),'YData',scan(:,2));
end
Warning:
- The real-time run speed of this function is variable with the amount of intersections that are computed and plotted, thus simpler (less robots, less obstacles) experiments are more likely to run
- As
Nnumber of robots increase,ang_resanddistneed to be lowered to ensure real-time operation on Robotarium - See the following table for sample runs and respective real-time run speed
| N | ang_Res | dist | Time w/ Plotting (s) | Time w/o Plotting (s) |
|---|---|---|---|---|
| 1 | 1 | 0.5 | 0.0295 | 0.0331 |
| 2 | 1 | 0.5 | 0.0414 | 0.0347 |
| 3 | 1 | 0.5 | 0.1094 | 0.0829 |
| 1 | 5 | 0.5 | 0.0138 | 0.0326 |
| 2 | 5 | 0.5 | 0.0291 | 0.0278 |
| 3 | 5 | 0.5 | 0.0350 | 0.0233 |
| 5 | 5 | 0.5 | 0.0428 | 0.0450 |
| 6 | 18 | 0.5 | 0.0332 | 0.0331 |
| 8 | 18 | 0.5 | 0.0513 | 0.0452 |
| 10 | 36 | 0.5 | 0.0402 | 0.0353 |
