Repo for Bosch Future Mobility Challenge 2024, Dei-Unipd Team
Initial steps/requirements:
- Operating system: Ubuntu 20.04
- Python >= 3.8 (install in virtual environment recommended)
- ROS Noetic, with the following commands:
sudo apt update
sudo apt install ros-noetic-desktop-full
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrcInstall python packages, open a terminal in this directory (with the virtual environment activated) and run:
pip install -r REQUIREMENTS.txtTo compile the simulator, in a terminal:
cd Simulator
bash recompile.shAt the end of the compilation, you should see the following message:
To automatically source the sim, add the following lines to your ~/.bashrc file
source /your/repo/dir/bfmc_2024/Simulator/devel/setup.bash
with /your/repo/dir/ being the path to the directory where you cloned the repo.
If it is not already there, the script will also ask you to add the line to your ~/.bashrc file, if you want to do it type y.
To run the simulator, open a terminal, source the workspace and run:
roslaunch sim_pkg car_with_map.launch This is the simplest launch file, it will start the simulator with the car and the map, without any
visualization. You can try car_with_map_vis.launch to see the car and the map and
map_with_all_objects.launch to see the map with all the objects (Note1: this will open gazebo,
which is disabled by default in the other 2 launch files to reduce the computational burden. Note2:all the objects are in
the wrong positions, since they are referred to the old map).
To visualize the car and the map, open a terminal, source the workspace and run:
rosrun example visualizer.pyPress R on the image to reset the visualization, and ESC to close it.
To manually control the car, you can use the keyboard. To do so, open a terminal, source the workspace and run:
rosrun example control.pyTo run the competition example, close all terminals, open a new one, source the workspace and run:
python main_brain.pyThis will start the simulator in a different terminal, and will run the main brain. You should see the car going around the map, performing various tasks.