Notifications
Clear all

[Solved] Roboclaw + ROS2 Setup

2 Posts
2 Users
0 Reactions
82 Views
eunsun
Posts: 8
Moderator
Topic starter
(@eunsun)
Member
Joined: 5 months ago

Roboclaw ROS2 Setup (Norlab Driver – Verified Working on /ws_big_robot/ws_big_robot)

We use Université Laval’s Northern Robotics Lab (Norlab) Roboclaw ROS2 driver.
The ROS package uses the Python driver by Team Chat Robotique (tcr-roboclaw).

This guide reflects what we confirmed working today in /ws_big_robot/ws_big_robot.


1) Install Python dependency into the same Python ROS uses

ROS2 console scripts run with the Python that launches the node (often system Python in containers). Install tcr-roboclaw in that same environment.

python3 -m pip install -U tcr-roboclaw transforms3d --break-system-packages --index-url  https://pypi.org/simple 

Verify:

python3 -c "import tcr_roboclaw; print(tcr_roboclaw.__file__)"

2) Clone repositories into /ws_big_robot/ws_big_robot/src

cd /ws_big_robot/ws_big_robot
mkdir -p src
cd src
git clone  https://github.com/norlab-ulaval/roboclaw_ros.git 
git clone  https://github.com/norlab-ulaval/norlab_custom_interfaces.git 

3) Install required ROS system dependencies

 
sudo apt update
sudo apt install -y \ ros-jazzy-diagnostic-updater \ ros-jazzy-tf-transformations \ ros-jazzy-grid-map-msgs

grid_map_msgs fixes the falcon_msgs build failure.


4) Fix message definitions in Norlab Custom Interfaces

The message definitions must match what roboclaw_ros publishes.

EncoderState.msg

nano /ws_big_robot/ws_big_robot/src/norlab_custom_interfaces/roboclaw_msgs/msg/EncoderState.msg

Replace the file contents with:

std_msgs/Header header
uint32 position # ticks
float32 velocity # ticks/sec
float32 ticks_per_rotation
float32 ticks_per_meter

MotorState.msg

nano /ws_big_robot/ws_big_robot/src/norlab_custom_interfaces/roboclaw_msgs/msg/MotorState.msg

Replace the file contents with:

std_msgs/Header header
float32 current # A
float32 voltage # V
float32 duty # %
float32 temperature # C

5) Configure the Roboclaw serial port

First, find the real device name:

ls -l /dev/ttyACM* /dev/ttyUSB* 2>/dev/null

Then edit the config:

 
nano /ws_big_robot/ws_big_robot/src/roboclaw_ros/roboclaw_ros/config/roboclaw.yaml

Set:

 
dev: '/dev/ttyACM0' # must be exact (no wildcards)
baud: 38400

⚠️ Do not use /dev/ACM* — Python won’t expand wildcards.


6) Build only what you need (Roboclaw packages)

From the workspace root (NOT inside src/):

 
cd /ws_big_robot/ws_big_robot
source /opt/ros/jazzy/setup.bash
rm -rf build install log
colcon build --symlink-install --packages-select roboclaw_msgs roboclaw_ros

Source the workspace:

 
source /ws_big_robot/ws_big_robot/install/local_setup.bash

7) Serial permissions (recommended instead of chmod 777)

 
sudo usermod -a -G dialout $USER

Then log out/in (or reboot).
(If you are always running as root in the container, this may not matter.)


8) Launch the node

 
source /opt/ros/jazzy/setup.bash
source /ws_big_robot/ws_big_robot/install/local_setup.bash
ros2 launch roboclaw_ros roboclaw_node.launch.py

9) Verify topics (optional)

In another terminal:

source /ws_big_robot/ws_big_robot/install/local_setup.bash
ros2 topic list | grep -i roboclaw


1 Reply
Posts: 3
Moderator
(@qiancai)
Member
Joined: 5 months ago

To use teleop keyboard (only key I and O works right now):

In terminal:

ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args --remap cmd_vel:=/twist_mux/cmd_vel

Reference: see google doc for robotic mouse project: Teleop_keyboard_operation


Reply
Share:
Scroll to Top