A ROS 2 Workspace with the UPenn GoKart Simulator.
Requirements:
- Ubuntu 22.04
- A working installation of ROS 2 Humble (newer versions might work as well), see Installing ROS 2 via Debian Packages
- vcstool
- Test if you have it using:
vcs --version
(should printvcs 0.3.0
) - You can install using
sudo apt install python3-vcstool
orpython3 -m pip install -U vcstool
- Test if you have it using:
Note! Always use a separate terminal windows/tabs for building and running.
In a terminal window/tab where you are building the workspace, you must source only ROS 2 Humble (source /opt/ros/humble/setup.bash
).
Then, in other terminal windows/tabs you can source the built workspace (source install/setup.bash
) and run the programs.
If you source workspace in the building terminal window/tab, then you will pollute the environment and the resulting built workspace might not work correctly.
In the repo/workspace root, run:
source /opt/ros/humble/setup.bash
vcs import < gokart.humble.repos
./src/gokart/rosdep/install.sh
rosdep install -i --from-paths src -y
./src/gokart/rosdep/install.sh
installs custom rosdep lists file. This needs to be done only once.
See gokart-rosdep.
Re-run vcs
and rosdep
when you pull the latest changes:
source /opt/ros/humble/setup.bash
vcs import < gokart.humble.repos
vcs pull < gokart.humble.repos
rosdep install -i --from-paths src -y
Use a building terminal window/tab:
source /opt/ros/humble/setup.bash
colcon build --packages-up-to simulator
Use a running terminal window/tab:
source install/setup.bash
ros2 launch simulator simulation.launch.py teleop:=key
See gokart-simulation/simulator for more all options.