This repository contains the code for the Intent-Inferencing Grand Challenge for 16.412 Spring 2020.
git clone [email protected]:cog-rob-spring-2020/intent-inferencing-gc.git
cd intent-inferencing-gc
# Optional: Create virtual environment
python -m venv venv
source venv/bin/activate
# Required packages
pip install numpy torch matplotlib PyQt5
pip install gif imageio
pip install pyparsing tqdm
Simulation data for this project was generated by src/16412_pub.py
. This
script requires CARLA 0.9.6 and has only been tested on Windows 10.
To run the script:
-
Run CARLA by double-clicking the executable or entering
CarlaUE4.exe
in the command window. To start the simulation in sped-up mode, use the commandCarlaUE4.exe -benchmark -fps=30
. -
Once CARLA is running, run
16412_pb.py
in a Terminal or Command window:
python 16412_pub --safe -n N
where N
is the number of vehicles you would like to spawn. The --safe
flag
guarantees that vehicles will spawn in safe locations.
The following variables in the Python script are relevant:
display_spectator_position
: Prints the position and angle orientation of the spectator in the command windowdisplay_elapsed_time
: Does the same for the simulation elapsed time.selected_map
: Town map loaded when the script is run. Check the CARLA website for all available options (e.g. Town01, Town02, Town03, etc.).geofence
: the x-y limits of the geofenced area where data recording is applied. The default values are only valid if you are loading the default Town02 map.
For more information, contact Sandro Salgueiro ([email protected]).
From intent-inferencing-gc/src
run
python parse_data.py --data path_to_data --outpath path_to_outdir
To run the example dataset:
python parse_data.py --data data/carla_short_raw --outpath datasets/CARLA_short/
This data parsing step has already been performed for the example datasets.
All CVM code can be found in the constant_velocity_pedestrian_motion
folder.
To get the ADE and FDE for all of the CARLA datasets:
python evaluate.py
To run with the angular velocity option
python evaluate.py --use_angvel
This script can only generate images for one dataset at a time. Edit dataset_paths
in the RunConfig
class at the top of evaluate.py
to be a length 1 list.
Below are the different image generation options.
For one frame:
python evaluate.py --make_plot timestamp
For a gif:
python evaluate.py --save_gif path_to_gif
For a series of stills for each frame in the dataset:
python evaluate.py --save_imgs path_to_imgdir
Since this code needs to be placed within the Trajectron++ file structure to function properly, this code is included in a separate repo. The repo can be found here.