ROS2D2: ROS 2 on a full-size R2-D2 replica (Raspberry Pi + lidar, no wheel encoders)
This post introduces ROS2D2, an open-source project that adds ROS 2 to a full-size R2-D2 replica. The system uses a Raspberry Pi with cameras, LiDAR, and distance sensors for perception and navigation decisions, while an Arduino Mega continues to control motors, sounds, and lights via the existing Shadow MD firmware. Manual control always takes precedence. Current capabilities include face-following, automatic modes (point-to-point, forward, patrol, color-follow), a web-based visualization console, and a simulator. Odometry is achieved without wheel encoders using IMU heading and laser odometry. The project is in progress, running in simulation and on a bench, with field testing underway.
Hi all,
I’d like to share ROS2D2, an open-source (MIT) project that adds ROS 2 to a full-size R2-D2 replica. First some context, as this world may be new to many of you.
The community. For more than twenty years, hobbyists around the world have been building full-size replicas of R2-D2 and other astromech droids, mostly from scratch: aluminium, wood, resin or 3D prints. They share plans, parts and electronics on forums like astromech.net and meet in local clubs; mine is Astromech Spain. The droids visit events, hospitals and charity days, and what matters most there is that the droid feels alive.
The control system. Most of them are driven by Shadow MD: open-source firmware for an Arduino Mega that reads PlayStation controllers over Bluetooth (through a USB Host board), drives the foot and dome motors through Sabertooth and Syren motor controllers, and sends commands to other boards for sounds, lights and panels. (Shadow was started by KnightShade on top of DanF’s Padawan; Shadow MD is by Vint43.) It works very well, but the droid is a puppet: there is a person hidden somewhere with the controller, and without them R2 does nothing.
What I want to do. My R2 took me 15 months, built largely with my kids. At its first event people kept asking “how do you drive it? what does it do on its own?”, and kids lit up whenever R2 answered their wave. ROS2D2 does not replace Shadow MD, it complements it: a Raspberry Pi with ROS 2 gives the droid senses (camera, lidar, distance sensors, IMU) and decides where to go, while the Mega keeps driving the motors, sounds and lights as before. The controller always wins: touch the stick and the operator is back in control at once. The goal is that any builder running Shadow MD can add it with one USB cable and one setting in their firmware.
What it does today:
- The dome follows your face: a camera, the OpenCV YuNet face detector and a node that sets the dome’s speed.
- Four automatic modes, each started from the controller: go to a point, go forward, patrol and follow a colour.
- Sensors: an RPLIDAR C1, VL53L0X and HC-SR04 distance sensors read by a Raspberry Pi Pico, and an MPU6050 IMU.
- A web console served by the Pi: the floor around R2 with the lidar’s points, R2 in 3D, cameras, sensor setup and Pico firmware updates.
- A simulator with rooms and a Docker test bench, to try everything without a droid.
A few design choices that may be of interest:
- One USB cable to the Mega. A single node (
mega_bridge) talks to it over serial. The Mega has its own watchdog: if the Pi stops sending commands for 300 ms, it stops the feet and the dome, with no ROS involved. - Our own navigator, not Nav2 (for now). A small reactive navigator that stops dead for anything the lidar or the distance sensors see, stops when a sensor goes silent (“sensor lost”) and does not move without odometry. We are going through a safety checklist with it (real braking distance, “zero is not stopped”, a single node commanding the feet).
- Odometry without encoders. The wheels have no encoders, so odometry comes from what was really sent to the Mega, the IMU’s heading and laser odometry from rf2o_laser_odometry. In the simulator, after a 4.77 m / 88° run, the estimate said 4.81 m / 89°. It still has to be measured on the droid.
- A 4 GB Pi 4. It runs on Jazzy (Ubuntu 24.04), and we have also built it on a Pi 4 with Ubuntu 26.04 and Lyrical (rf2o needed a couple of patches).
Status: work in progress. It runs in the simulator and on the bench; testing on the droid is under way.
- Repository: GitHub - BeskarCode/ROS2D2: A ROS 2 brain for an R2-D2 running ShadowMD: a Raspberry Pi adds the senses (cameras, voice, lidar) and the Mega keeps the motors, sounds and lights. The controller always wins. · GitHub
- Video: https://youtu.be/Smfn6zQICm0
Two questions for those with experience:
- Without wheel encoders, has rf2o + IMU worked best for you, or something like KISS-ICP or
robot_localizationfusing the IMU? Home floors (rugs, tiles) make the wheels slip a lot. - For a robot that mostly drives indoors with a forward-only lidar, is it worth moving to Nav2, or is a simpler reactive navigator of our own the better fit?
Thanks for reading; ideas and criticism are very welcome.