ROS 2 bridge for LeRobot โ enabling seamless control of LeRobotโs mobile base, arm, and sensors within the ROS 2 ecosystem.
lerobot-ros connects LeRobot hardware to ROS 2.
It provides a standard ROS 2 interface for teleoperation, odometry, and (soon) arm control.
The package supports both Raspberry Pi 5 (on-board control) and desktop PCs (remote or simulation setups).
- โ
Teleoperate LeRobot mobile base using
/cmd_vel - โ Stream and visualize LIDAR data
- โ Integrate rf2o_laser_odometry for SLAM or navigation
- ๐ง Arm teleoperation (in development)
- โ๏ธ ROS 2 Humble (22.04) and Jazzy (24.04) supported
+-----------------------------+
| ROS 2 System |
|-----------------------------|
| /cmd_vel โ Base Driver |
| /odom โ Odometry |
| /scan โ LIDAR Driver |
| /tf โ Transform Tree |
| /arm/* โ Arm (WIP) |
+-----------------------------+
โ
โ
LeRobot Hardware
(Mobile Base + Arm + Sensors)
1. Install Ubuntu Server 24.04.2 LTS (64-bit), setup wireless LAN and enable SSH in the rpi-imager, do not select Raspberry Pi OS as this requires running ROS 2 in docker.
2. Install ROS 2 Jazzy.
3. Install SLAMTEC LIDAR ROS 2 or other LIDAR ROS 2 package depending on the LIDAR connected to the Raspberry Pi 5.
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/Slamtec/sllidar_ros2.git
cd ~/ros2_ws/
source /opt/ros/jazzy/setup.bash
colcon build --symlink-install4. Modify the USB port (/dev/ttyUSBX) connected to the LIDAR in the sllidar_ros2 launch files (sllidar_a1_launch.py, view_sllidar_a1_launch.py).
5. From the PC, run xhost +, ssh -X to the Raspberry Pi 5 and run the sllidar node to view the laser scan in rviz2.
source /opt/ros/jazzy/setup.bash
source ~/ros2_ws/install/setup.bash
ros2 launch sllidar_ros2 view_sllidar_a1_launch.py7. Fetch the ROS 2 changes.
cd ~/lerobot
git checkout ros2-latest1. Install ROS 2 Humble on Ubuntu 22.04.5 LTS on PC (other ROS 2 and Ubuntu do not work with LeRobot due to RCL Python dependency).
2. Install rf2o_laser_odometry.
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/MAPIRlab/rf2o_laser_odometry.git
cd ~/ros2_ws/
source /opt/ros/humble/setup.bash
colcon build --symlink-install3. Modify the odom_topic in the rf2o_laser_odometry launch file (rf2o_laser_odometry.launch.py) from odom_rf2o to odom.
5. Fetch the ROS 2 changes.
cd ~/lerobot
git checkout ros2-latestcd ~/lerobot
python3 -m src.lerobot.robots.lekiwi.lekiwi_hostexport LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
cd ~/lerobot
python3 ~/lerobot/examples/lekiwi/ros2operate.pysource /opt/ros/humble/setup.bash
ros2 run teleop_twist_keyboard teleop_twist_keyboardsource /opt/ros/humble/setup.bash
ros2 run joy joy_node &
ros2 launch teleop_twist_joy teleop-launch.py joy_config:='xbox'cd ~/lerobot
python3 -m src.lerobot.robots.lekiwi.lekiwi_hostexport LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
cd ~/lerobot
python3 ~/lerobot/examples/lekiwi/ros2operate.pysource /opt/ros/jazzy/setup.bash
source ~/ros2_ws/install/setup.bash
ros2 launch sllidar_ros2 sllidar_a1_launch.pyros2 topic echo /scan --no-arrsource /opt/ros/humble/setup.bash
source ~/ros2_ws/install/setup.bash
ros2 launch rf2o_laser_odometry rf2o_laser_odometry.launch.pyros2 topic echo /odom --no-arrsource /opt/ros/humble/setup.bash
ros2 run tf2_ros static_transform_publisher -0.1 0 0.3 0 0 0 base_link laser8. On the PC, run the ROS 2 SLAM using slam.yaml to publish the map
source /opt/ros/humble/setup.bash
ros2 launch slam_toolbox online_async_launch.py use_sim_time:=false slam_params_file:=slam.yamlros2 topic echo /map --no-arr10. On the PC, run the ROS 2 NAV2 using nav2.yaml
source /opt/ros/humble/setup.bash
ros2 launch nav2_bringup navigation_launch.py use_sim_time:=false params_file:=nav2.yaml11. On the PC, run rviz2 to view the map and set the goal post, refer to various ROS 2 NAV2 tutorial.
rviz2