A differential drive mouse droid, from the Star Wars universe, that was design for entertaining people at a house party. The droid is equiped with a revolving disco ball and can make actual mouse droid sounds heard from the movies. It is manually operated using an Xbox 360 wired controller. Overall, the operations of droid involves a raspberry pi 3B+, utilizing Ubuntu Server 22.04, and the running software application is built on the middleware ROS2 Humble. Majority of the parts are 3D printed and the droid consists of many other basic electronic components. Using a PID controller the droid is able to do a 180 degree or complete rotation.
droid_server_commands
: Contains action server nodes for handling controller inputdroid_controller
: Contains action client node that casts the inputs for the Xbox 360 controllerdroid_interfaces
: Contains the ROS2 actions and messages used in this project representing the data for Xbox 360 controller
Electronic Components | |
---|---|
1 | Raspberry Pi 3B+ |
2 | Lexar 128 GB SD Card |
3 | Sound Board DY-HV20T |
4 | 4 Ohm 5W Audio Speaker |
5 | Motor Controller L298N |
6 | 4 x DC-12V-200RPM Motors |
7 | DC 5V Stepper Motor 28BYJ-48 |
8 | ULN2003 Step Driver Board |
9 | 12mm (Outside Diameter) Slip Ring |
10 | Mini USB Disco Ball with 62mm Diameter |
11 | 12V, 3800mAh LIPO Battery |
12 | 5V, 26000mAh Battery Bank |
The parts for the droids body were taken from a maker on Thingiverse, Null_Hypothesis. Here's the link to his project https://www.thingiverse.com/thing:4229599. From his project only the following parts are needed, given that the design needed to be hacked to work for a diff drive droid:
- 2 x Chassis_Rear_V4.stl
- Top_FrontV4.stl
- Top_RearV4.stl
- Top_rightV4.stl
- Top_RoofV4.stl
- TopLeftV4.stl
- 2 x Mouse_Droid_Side_Circuit_Board_Rescaled.stl
- 2 x MSE_base 6to10.stl
- 2 x MSE_Lower_Portion6to10.stl
- 2 x MSE_Upper_Portion 6to10.stl
- 4 x Front_Tire.stl
The parts mentioned above and custom parts made for this project are in the 3D_print_files directory.
Portions of the chassis where the wheels go were cut out for placing the custom motor mounts, and a 64mm hole was cut out from the droid's roof for dico ball placement. Moreover, the custom disco platforms, made to hold electronic and mechanical components for operating it, are suspended bellow the droid's roof using hex brass standoffs. Images
were taken to show assembeled components.
The remote computer for controlling the droid does not need to install ROS2 Humble since in this setup a Docker container is utilized (for easy setup), but on the Raspberry PI this needs to be installed.
Copy the directory remote_setup
onto the remote machine, and droid_setup
onto the Raspberry PI.
For network communication, this project utilizes Eclipse Cyclone DDS, so before building and running the Docker container, add both the PI's and remote computer's IP addresses to the cyclon file
. Moreover, this document provides comments for where to place these addresses.
After modifying the cyclon file, build & run the container:
Scripts/build.bash
Next, run the container but make sure the Xbox 360 controller is connected.
Scripts/run.bash
Finally, before running the controller node, the ROS2 packages for this setup need to be compiled and installed.
cd ws/
colcon build
source install/setup.bash
ros2 run droid_controller controller
Expect similar output, after running the controller node: [INFO] [1720638165.505265926] [controller]: Xbox controller node initialized.
Make sure the library pigpio is installed on the Raspberry PI. Given permission issues encountered when trying to run the droid server node on the PI, the work around solution is running this node while logged in as the root user.
Before compiling and installing the ROS2 packages for this setup, run the following commands:
source /opt/ros/humble/setup.bash
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export ROS_DOMAIN_ID=0
export CYCLONEDDS_URI= ./droid_setup/cyclonedds.xml #Enter the full location of the cyclon DDS file
Then, as done in the remote setup, add the PI's and remote computer's IP addresses to the cyclon file. Next, while in the the directory ./droid_setup/ros2_ws, compile the droids ROS2 packages:
colcon build
source install/setup.bash
Finally, run the droid server node which takes commands from the controller node:
ros2 run droid_server_commands droid_server
Expect similar output, after running this node:
[INFO] [1720639837.026257729] [Droid_Server]: IMU Module Ready
[INFO] [1720639837.164474318] [Droid_Server]: Sound Module Ready
[INFO] [1720639837.164727443] [Droid_Server]: Droid servers started
- Left Joy-stick ---> operates left side motors
- Right Joy-stick ---> operates right side motors
- Back button ---> Droid performs an automatic 180 deg rotation
- Mode button (between back & start buttons) ---> Droid performs an automatic 360 deg rotation
- X, Y, B, A buttons ---> Perform droid sounds
- Start button ---> toggles disco ball on and off
The droid sounds are in resources
and can be installed to an SD for the sound board.