This project aims to get all functionality of the TurboPi robot running on ROS 2 Jazzy, along with an RPLidar for SLAM.
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
To run on the actual hardware run the following command in your ros2 workspace; ex ~/ros2_ws/
.
ros2 launch turbopi_ros turbopi_ros.launch.py
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.
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