VIPRA Documentation
|
visualize.py
is used to view the output from a simulation run.
pip
Modules:json
sys
os
numpy
matplotlib
python3 visualize.py *flags*
-peds *sim output path*
: sets the path to the simulation output (no default)-obs *obstacle map path*
: sets the path to the obstacle map (no default)-outpath *output gif path*
: sets the path for the output gif (default ./output.gif)-idx
: prints the pedestrians index next to their position (default OFF)-idxClr
: colors pedestrian indexes to their color (default OFF)-shldr *len*
: draws shoulders (axis aligned) on pedestrians, len being half the total shoulder width (default OFF)-xDim *minX, maxX*
: sets the min and max X for the plot (default: -1, 25)-yDim *minY, maxY*
: sets the min and max Y for the plot (default: -1, 4)-fps *fps*
: sets the fps of the output Gif (default 10)-pedClr
: sets each pedestrian a different color (default OFF)-obsClr *color*
: sets the color of obstacles (default k)-bckClr *color*
: sets the color of the background (default w)-dif *sim output filepath*
: shows differences between sim runs-difalpha *0.0-1.0*
: sets the alpha for dif (default 0.25)-diflines
: draws lines between pedestrians that have a dif (default OFF)-dlmax *float*
: scales dif line alpha by max distance (default OFF)-overrides *filename*
: overrides helper functions with the module providedcolor options: https://matplotlib.org/stable/tutorials/colors/colors.html
For plotting extra information added to the output use the overrides
flag.
Create a python file that includes the method:
ax
is the matplotlib plot to draw totimestep
is the current timestepoutput
is the entire JSON output from the simulationReturns:
Pedestrian colors can be updated throughout the GIF by overriding the method:
output
is the entire JSON output from the simulationReturns: