Repository navigation
Figures
Pass labels to OMAS_initialise through the figures argument. Matching is case-insensitive. The switch lives in core/OMAS_figureGenerator.m.
[DATA, META] = OMAS_initialise( ...
'objects', objectIndex, ...
'figures', {'events', 'plan', 'gif'});'all' expands to the full set below and then closes the figure windows after they have been written. 'none' suppresses output. Any other string is skipped with a warning. The generator does not recognise 'fig'; that token appears in older scripts and in the default stored inside OMAS_initialise, and it is ignored.
Figures are written into the session folder (META.outputPath). Axis limits, fonts, and animation rate come from core/OMAS_figureProperties.m so a batch of runs looks the same.
| Label | Output | When it is useful |
|---|---|---|
events |
Timeline of detections, warnings, collisions, waypoints, and the matching clear events. | First look at whether agents saw each other and whether anyone hit. |
collisions |
Snapshots of the instants a collision was raised. | Inspect geometry at impact. Empty when the hit boxes never overlapped. |
trajectories |
Time series of each object's global state: position, velocity, quaternion. | Check that published velocity is what you think main commanded. |
separations |
Inter-object separation from each object's point of view. | See who passed close to whom, per agent. |
closest |
The minimum separation over the run. | The usual headline metric in the avoidance papers. |
avoidance |
Avoidance-rate summaries derived from the event log. | Compare algorithms after a batch of runs. |
inputs |
Control inputs stored on agent.DATA. |
Needs the agent to record inputs. See below. |
plan |
Top-down (East-North) plot of the trajectories. | The default picture for planar scenarios. |
isometric |
3D trajectories. | Vehicles, spheres, and the Earth-orbit scene. |
gif |
Animated isometric GIF. | Short demos. Frame rate is capped at 50 fps by OMAS_figureProperties. |
avi |
The same animation as an AVI. | When you need a video file rather than a GIF. |
times |
Per-step computation times stored on agent.DATA. |
Needs writeAgentData. See below. |
'all' requests, in order: events, collisions, trajectories, separations, closest, avoidance, inputs, plan, isometric, gif, avi, times.
Those two figures do not invent data. They read agent.DATA on the final object handles.
writeAgentData(TIME, loopIndicator, loopDuration) is the helper that fills:
| Field | Used by |
|---|---|
DATA.indicator |
inputs |
DATA.dt |
times |
DATA.steps |
both |
DATA.time |
both |
Call it at the end of main if you want those figures. Avoidance agents that already store a loop indicator will populate inputs without extra work. A new agent that never touches DATA produces an empty inputs or times figure.
OMAS_figureProperties fixes the look of every figure:
- Helvetica, LaTeX interpreter, title 28 pt, axes 18 pt.
- Line width 2, marker size 10, white figure and axes.
- Trail length
tailLengthof 4 seconds (raised todtif the step is longer). - Patch face alpha 0.7, Gouraud lighting.
- Window sized to about 60% by 80% of the screen.
For GIF and AVI the frame rate is at most 50 fps. If the simulation has fewer samples than that, the frame rate drops to the sample rate and stepsPerFrame stays 1. Otherwise frames subsample the trajectory. A temporary reduced trajectory file is built before the animation figures run.
publishMode true (the publishMode argument of OMAS_initialise) asks the same generator to also write PDFs. The root setup_example.m exposes this as sim_publishFigures.
OMAS_monteCarlo does not draw the per-cycle scene figures unless you pass a figures list. The default is {'none'}, which is what you want for a long batch.
After every session has been summarised it writes three comparison figures into the Monte Carlo directory, using the same style struct:
| Method | Figure |
|---|---|
GetMeanComputationTimeSeries |
Mean per-step compute time across cycles, over the time vector. |
GetMeanComputationTimesVsPopulation |
Mean compute time against agent count, one series per algorithm. |
GetMeanCollisionsVsPopulation |
Mean collision count against agent count, one series per algorithm. |
Session numbers that feed those plots are also written to summaryData.csv inside each session folder. Columns are collisions, waypoints, mean_dt, min_dt, max_dt, minSeparation, maxSeparation.
| Goal | Labels |
|---|---|
| First look | {'events', 'plan', 'gif'} |
| Avoidance paper figure | {'plan', 'closest', 'separations'} |
| Vehicle debug | {'isometric', 'trajectories', 'inputs', 'gif'} |
| Timing study |
{'none'} on each cycle, then the Monte Carlo summary figures |
| Everything | {'all'} |
gif and avi are the slow labels. Leave them out of Monte Carlo cycles.