ROS 2
F1/10 Wheeltec Gazebo simulation workshop¶
The workshop is ROS 2 compatible
Video¶
Requirements (high-level)¶
- ROS 2 Humble: 🟠see previous workshops or docs.ros.org/en/humble/Installation.html
- Gazebo Fortress: ✅ current workshop gazebosim.org/docs/fortress/install_ubuntu
ROS gz bridge
: ✅ current workshop, ROS integration. Install with a single command:sudo apt install ros-humble-ros-gz-bridge
, gazebosim.org/docs/fortress/ros2_integration- Build and run custom worlds and models ✅ current workshop (e.g.
F1/10
/Wheeltec, Roboworks
)
Binary Installation on Ubuntu¶
Fortress binaries are provided for Ubuntu Bionic, Focal and Jammy. All of the Fortress
binaries are hosted in the osrfoundation repository. To install all of them,
the metapackage ignition-fortress
can be installed. The following is based on gazebosim.org/docs/fortress/install_ubuntu.
First install some necessary tools:
sudo apt-get update
sudo apt-get install lsb-release wget gnupg
Then install Ignition Fortress:
sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
sudo apt-get update
sudo apt-get install ignition-fortress
All libraries should be ready to use and the ign gazebo
app ready to be executed.
Gazebo Fortress ROS 2 integration¶
Issue the following command:
sudo apt install ros-humble-ros-gz-bridge
sudo apt install ros-$ROS_DISTRO-ros-gz-bridge
Additional settings to WSL2¶
Warning - WSL2
There is an issue, which can be set even in ~/.bashrc
:
export LIBGL_ALWAYS_SOFTWARE=1
Set it in ~/.bashrc
:
echo "export LIBGL_ALWAYS_SOFTWARE=1" >> ~/.bashrc
Don't forget to source bashrc.
source ~/.bashrc
After new terminal or source
:
echo $LIBGL_ALWAYS_SOFTWARE
should print 1
. Alternatively
cat ~/.bashrc | grep LIBGL
Check the installation¶
Success
Now the ign gazebo
should work and the ros2
commands should be available.
Try at least one of the following commands:
ign gazebo
ign gazebo -v 4 -r ackermann_steering.sdf
ign gazebo shapes.sdf
ign param --versions
Packages and build¶
Detailed description of the packages and build process.
It is assumed that the workspace is ~/ros2_ws/
.
cd ~/ros2_ws/src
git clone https://github.com/rudolfkrecht/robotverseny
Build¶
cd ~/ros2_ws
colcon build --symlink-install --packages-select robotverseny_application robotverseny_description robotverseny_bringup robotverseny_gazebo
Run¶
Don't forget to source before ROS commands.
source ~/ros2_ws/install/setup.bash
ros2 launch robotverseny_bringup roboworks.launch.py
Useful commands¶
Publish command topic:
ros2 topic pub --once /roboworks/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 2.5, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: -0.01}}"
Teleop twist keyboard:
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/roboworks/cmd_vel
Ignition info topic:
ign topic -i --topic /model/roboworks/cmd_vel
ign topic -et /model/roboworks/cmd_vel
Topics:
ros2 topic list
Here are the topics.
/clicked_point
/clock
/goal_pose
/initialpose
/joint_states
/parameter_events
/robot_description
/roboworks/cmd_vel
/roboworks/odometry
/roboworks/scan
/rosout
/tf
/tf_static