This project aims to get all functionality of the TurboPi robot running on ROS 2 Jazzy, along with an RPLidar for SLAM. The project is a work in progress, used to learn ROS 2, as well as for upcoming research work into SLAM, navigation without GPS or Compass, dynamic path planning with encountering unknown newly discovered obstacles, and other research topics.
Work is underway to customize the default TurboPi, replacing the 2DOF camera with a Orbbec Astra S 3D Depth Camera. This will be done in a manner that supports both, and work has already be done for simulation of both. A 2D 360° RP LiDAR A1 has been added to both.
![]() |
![]() |
Mesh files have been generously provided by Hiwonder and are their property. Mesh files are copyright Hiwonder. All Rights Reserved.
The following assumes you have installed all the necessary ROS 2 Jazzy packages,
and have sourced the installation before running any ros2
commands.
source /opt/ros/jazzy/setup.bash
You may want to have your development user environment do this on login via
~/.bashrc
file; add that command to the end of that file.
Its recommended to have a ros2 workspace in a user directory for development
purposes, to build this project, etc; ex ~/ros2_ws/
. The following will refer
to that directory, and directories created within.
Download and unpack or clone this repositories contents into your ros2
workspace; ex ~/ros2_ws/src/turbopi_ros
.
Building is done using colcon which will invoke cmake and run the necessary
commands. Run the following command in your ros2 workspace; ex ~/ros2_ws/
.
colcon build --symlink-install --packages-select turbopi_ros
Make sure to run the following command after install and login. Run the
following command in your ros2 workspace; ex ~/ros2_ws/
.
source install/setup.bash
You may want to have your development user environment do this on login via
~/.bashrc
file; add the following to the end of that file.
source ~/ros2_ws/install/setup.bash
There are several launchers that are used to run parts of the project, some are
used together, some stand-alone, some for simulation and the robot. They are all
run from your ros2 workspace; ex ~/ros2_ws/
.
ros2 launch turbopi_ros turbopi_ros.launch.py
- gamepad.launch.py - Start the gamepad node for remote operation, teleop; run in container, local, or remote.
- ign_gazebo.launch.py - Start a simulated TurboPi in Gazebo; run in container or desktop/laptop.
- nav2.launch.py - Start the Nav 2 stack, used with both hardware and simulation.
- turbopi_ros.launch.py - Start ROS 2 with hardware support for TurboPi on robot hardware.
Three docker containers have been made to aid primarily in development, but the first can be used on actual hardware.
- docker-ros2-jazzy - Base headless container used in CI/CD and can be used on hardware with slight overhead.
- docker-ros2-jazzy-gz-rviz2 - Base X11 graphical container used for simulation has Gazebo and RViz2, intended for desktop/laptop; contains prior.
- docker-ros2-jazzy-gz-rviz2 - Main development container used for development, simulation, etc. intended for desktop/laptop; contains prior two.
The first container is primarily used for CI/CD. The second one is not directly used. For most purposes, the last container is the primary one to use, outside of running on the actual robot. Which is advised to do outside of a docker container to avoid the minimal overhead.
The primary way to control the robot is using telop_turbopi which is intended to be used with a DUALSHOCK™4 wireless controller.
Run the following command to invoke the controller for the DUALSHOCK™4 wireless controller. This can be done within the robot, or on a remote system running a docker container or locally installed.
ros2 launch turbopi_ros gamepad.launch.py
The primary buttons are the left joystick for driving/movement and the right joystick for the attached camera. All other buttons are not mapped or in use at this time.
Button | Action |
---|---|
A | Unused |
B | Unused |
C | Unused |
D | Unused |
E | Unused |
F | Unused |
G | Unused |
H | Camera - tilt up/down, pan left/right |
I | Unused |
J | Unused |
K | Driving - forward/backward, turn left/right |
There are presently alternative two ways to control the robot using
teleop twist joy and
keyboard. However, they only
support robot movement and do not control camera or other peripherals, they just
use /cmd_vel
topic.
Run the following command to invoke the controller for the gamepad. Sample
command is using a Logitech F310, which works with the xbox
configuration.
ros2 launch teleop_twist_joy teleop-launch.py joy_config:='xbox'
Run the following command to invoke the controller for the keyboard, which will present a interface for controlling the robot in the same terminal the command is run within.
ros2 run teleop_twist_keyboard teleop_twist_keyboard
Credits and thanks for resources used in this repository, some code and/or project structure, go to the following:
- Articulated Robotics - Making a Mobile Robot with ROS
- Linux I2C - Implementing I2C device drivers in userspace
- ROS 2 Control Demos - example 2
- Slate Robotics - How to implement ros_control on a custom robot