A ROS 2 Sample Workspace with the UPenn GoKart Simulator.
Requirements:
- Ubuntu 20.04
- a working installation of ROS 2 Foxy (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 the ROS 2 Foxy (source /opt/ros/foxy.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/foxy/setup.bash
vcs import < gokart.foxy.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/foxy/setup.bash
vcs import < gokart.foxy.repos
vcs pull < gokart.foxy.repos
rosdep install -i --from-paths src -y
Use a building terminal window/tab:
source /opt/ros/foxy/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.