A repository for prediction integration in EDGAR project. containing the tum_prediction package and the runtime evaluation results.
Recommand environment: Ubuntu 22.04 + ROS2 Humble
├── ...
├── runtime evaluation results
├── ...
├── src/tum_prediction # tum_prediction package
├── config
├── map_and_node_params.yaml # Yaml file for ROS2 node
├── launch # Contains two launch files for prediction nodes
├── parallel_map_based_prediction.launch.xml
├── routing_based_prediction.launch.xml
├── encoder_model_weights # Contains weights for encoder model
├── ...
├── prediction_model_weights # Contains weights for prediction model
├── ...
├── norms # Contains weights for normalization
├── ...
├── sample_map # Contains two version of test maps
├── DEU_GarchingCampus-1
├── old_DEU_GarchingCampus-1
├── test # Contains pytest files
├── ...
├── tum_prediction # Contains all nodes and utilities
├── __init__.py
├── image_path_generator_pil.py
├── image_path_generator.py
├── map_loader.py
├── nn_model.py
├── node_map_based_prediction.py # Key node for integration testing
├── node_methods_test.py
├── node_path_evaluation.py
├── node_routing_based_prediction.py # Key node for NN-based prediction
├── node_visualization.py
├── original_path_generator.py
├── utils_interpolation.py
├── utils_nn_model.py
└── utils_tier4.py
├── package.xml # ROS package and dependencies definition.
└── setup.py # setup.py for ROS package
├── build.sh # sh file for building the package
├── requirements.txt # Pip requirements
└── Readme.md
Following will be an instruction about how to set up local environment.
- If you want to further develop the package, you could start from Setup locally and you may not need Run with docker and microservices.
- But if you only want to test or see the result of the neural network-based trajectory prediction, you can jump to Run with docker and microservices.
If the environment of Planning simulation is already there, then pass this step.
https://autowarefoundation.github.io/autoware-documentation/main/installation/
https://gitlab.lrz.de/prediction/autoware-integration
Open a terminal, and run the following command. It's recommanded to build like this, or you can also use pip install all requirements and then use colcon build.
cd ~/autoware-integration
chmod +x build.sh
./build.shIn one terminal: run the planning simulation.
ros2 launch autoware_launch planning_simulator.launch.xml map_path:=$HOME/autoware-integration/src/tum_prediction/sample_map/DEU_GarchingCampus-1 vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kitIn another terminal: run the routing_based_prediction_node.
ros2 launch tum_prediction routing_based_prediction.launch.xml map_path:=$HOME/autoware-integration/src/tum_prediction/sample_map/DEU_GarchingCampus-1You can change the map_path here to your map to test another map.
When you only want to see the capability of the neural network-based prediction and don't want to develop it, a good choice is to launch them with docker. But to do so, you need to make sure your computer has at least 80GB free space!
https://gitlab.lrz.de/av2.0/tum_launch
And choose branch prediction_integration.
After this, you need to clone the repository autoware-integration repository. And change the map_path parameter in /tum_launch/compose_launch/.env to the map in this repositories, which is:
map_path=/home/#{user}/autoware-integration/src/tum_prediction/sample_map/DEU_GarchingCampus-1If the environment of Docker is already there, then pass this step.
https://docs.docker.com/engine/install/ubuntu/
Run in a terminal:
sudo docker login gitlab.lrz.de:5005
Username: ge89yes
Password: [Use your Username and Password here!]
cd ~/tum_launch/compose_launch
sudo docker compose -f rviz.yml upAfter this, open another terminal and run
cd ~/tum_launch/compose_launch
sudo docker compose --env-file .env -f tum_prediction_sim.yml upIf nothing show up after you running sudo docker compose -f rviz.yml up ,you can:
Execute xhost +"local:docker@" on your host machine.
Or startx before run sudo docker compose -f rviz.yml up
Docker files should be run automatically after step 2.3.
After the step 1 or step 2, click on the RVIZ software opened by Planning Simulation.
Then find the Add button of the Displays part at the top left corner,
-> ckick it and slect By topic
-> scroll down that small page to the bottom
-> click MarkerArray in /nn\_pred\_path\_marker topic
-> click OK button
There should be a new display in "Displays" area.
Then click the 2D Pose Estimate to add a car on the map, and click 2D Dummy Car to add an object to be followed. Instructions about how to do this step: https://autowarefoundation.github.io/autoware-documentation/main/tutorials/ad-hoc-simulation/planning-simulation/
First, please make sure your map directory looks similar to this:
├── NAME_OF_MAP
├── lanelet2_map.osm # OSM map that can be loaded by UTM projector
├── map_config.yaml # Contains map_origin parameters
├── map_projector_info.yaml # Might not be needed for old Autoware version
├── ...
- Change the
map_pathparameter for two launch files at Run the simulation. - Run two launch files again.
- Change the
map_pathparameter in /tum_launch/compose_launch/.env to your map path. - Run dockers again.
Since the map loader in Autoware is changed in the latest version(23.11.2023), one file is added to the map directory: map_projector_info.yaml. To use the old version map, we should modify this file ourselves, more information on website: https://autowarefoundation.github.io/autoware.universe/main/map/map_projection_loader/.