Skip to content

Commit

Permalink
Add html. finish sensor fusion tech talks.
Browse files Browse the repository at this point in the history
  • Loading branch information
liver121888 committed Dec 31, 2022
1 parent 8aa629d commit bec6580
Show file tree
Hide file tree
Showing 20 changed files with 1,956 additions and 0 deletions.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
function [f,plotters] = createT2TDisplay(scenario, sensors, attachedVehicle)
% Create bird's eye plot
f = figure('Visible','off'); pause(0.1)
set(f,'Position',[433 425 1362 607]);
p1 = uipanel(f,'Title', 'Vehicle 1', 'Position', [0.01 0.01 0.48 0.98]);
p2 = uipanel(f,'Title', 'Vehicle 2', 'Position', [0.51 0.01 0.48 0.98]);
a = axes(p1);
xlims = [50 220];
bep{1} = birdsEyePlot('Parent', a, 'XLim', xlims, 'YLim', [-50 50]);
a = axes(p2);
bep{2} = birdsEyePlot('Parent', a, 'XLim', xlims, 'YLim', [-50 50]);
set(p1.Children(1),'Position',[0.35 0.95 0.3 0.0345],'Orientation','horizontal','NumColumnsMode','manual','NumColumns',5);
set(p2.Children(1),'Position',[0.35 0.95 0.3 0.0345],'Orientation','horizontal','NumColumnsMode','manual','NumColumns',5);
for i = 1:numel(sensors)
shift = scenario.Actors(attachedVehicle(i)).Position(1:2);
name = "";%Vehicle " + string(attachedVehicle(i));
if isa(sensors{i},'radarDetectionGenerator')
plotters.SensorPlotter(i) = coverageAreaPlotter(bep{attachedVehicle(i)}, 'DisplayName',...
name + " radar", 'FaceColor', 'r');
plotCoverageArea(plotters.SensorPlotter(i), sensors{i}.SensorLocation + shift,...
sensors{i}.MaxRange, sensors{i}.Yaw,...
sensors{i}.FieldOfView(1));
else
plotters.SensorPlotter(i) = coverageAreaPlotter(bep{attachedVehicle(i)}, 'DisplayName',...
name + " vision", 'FaceColor', 'b');
plotCoverageArea(plotters.SensorPlotter(i), sensors{i}.SensorLocation + shift,...
sensors{i}.MaxRange, sensors{i}.Yaw,...
sensors{i}.FieldOfView(1));
end
end
plotters.veh1DetPlotter = detectionPlotter(bep{1}, 'DisplayName', 'Detections',...
'MarkerEdgeColor', 'black', 'MarkerFaceColor', 'black');
plotters.veh2DetPlotter = detectionPlotter(bep{2}, 'DisplayName', 'Detections',...
'MarkerEdgeColor', 'black', 'MarkerFaceColor', 'black');
plotters.veh1TrkPlotter = trackPlotter(bep{1}, 'DisplayName', 'Local Tracks',...
'MarkerEdgeColor', 'black');
plotters.veh2TrkPlotter = trackPlotter(bep{2}, 'DisplayName', 'Local Tracks',...
'MarkerEdgeColor', 'black');
plotters.veh1FusePlotter = trackPlotter(bep{1}, 'DisplayName', 'Fuser Tracks',...
'MarkerEdgeColor', 'black', 'Marker', 'd');
plotters.veh2FusePlotter = trackPlotter(bep{2}, 'DisplayName', 'Fuser Tracks',...
'MarkerEdgeColor', 'black', 'Marker', 'd');
plotters.ol1Plotter = outlinePlotter(bep{1});
plotters.lb1Plotter = laneBoundaryPlotter(bep{1});

plotters.ol2Plotter = outlinePlotter(bep{2});
plotters.lb2Plotter = laneBoundaryPlotter(bep{2});

rb = roadBoundaries(scenario);
[position, yaw, length, width, originOffset, color] = targetOutlines(scenario.Actors(1));
position = position + scenario.Actors(1).Position(1:2);

% update the bird's-eye plotters with the road and actors
plotLaneBoundary(plotters.lb1Plotter, rb);
plotOutline(plotters.ol1Plotter, position, yaw, length, width, ...
'OriginOffset', originOffset, 'Color', color);
plotLaneBoundary(plotters.lb2Plotter, rb);
plotOutline(plotters.ol2Plotter, position, yaw, length, width, ...
'OriginOffset', originOffset, 'Color', color);
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function showsnap(snaps, id)
h = figure("Name","Snap #" + id,"IntegerHandle","off","Units","normalized","Position",[0.01 0.01 0.98 0.98]);
a = axes(h);
imshow(snaps{id}.cdata,"Parent",a)
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
function updateT2TDisplay(plotters, scenario, sensors, attachedVehicle)
% Updates the display of the road and actors on the road

% get the road boundaries and rectangular outlines
rb = roadBoundaries(scenario);
[position, yaw, length, width, originOffset, color] = targetOutlines(scenario.Actors(1));
position = position + scenario.Actors(1).Position(1:2);

% update the bird's-eye plotters with the road and actors
plotLaneBoundary(plotters.lb1Plotter, rb);
plotOutline(plotters.ol1Plotter, position, yaw, length, width, ...
'OriginOffset', originOffset, 'Color', color);
plotLaneBoundary(plotters.lb2Plotter, rb);
plotOutline(plotters.ol2Plotter, position, yaw, length, width, ...
'OriginOffset', originOffset, 'Color', color);

for i = 1:numel(sensors)
shift = scenario.Actors(attachedVehicle(i)).Position(1:2);
if isa(sensors{i},'radarDetectionGenerator')
plotCoverageArea(plotters.SensorPlotter(i), sensors{i}.SensorLocation + shift,...
sensors{i}.MaxRange, sensors{i}.Yaw,...
sensors{i}.FieldOfView(1));
else
plotCoverageArea(plotters.SensorPlotter(i), sensors{i}.SensorLocation + shift,...
sensors{i}.MaxRange, sensors{i}.Yaw,...
sensors{i}.FieldOfView(1));
end
end
end
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit bec6580

Please sign in to comment.