Hexumi is a low-cost, 3D-printed hexapod robot. It has six legs and 18 servo motors (three for each leg). A Raspberry Pi with ROS 2 Jazzy controls the robot. A Pimoroni Servo2040 board with micro-ROS firmware operates the servos.
- Description
- Repository branches
- Hardware
- Software components
- Installation on the Raspberry Pi
- Build the servo driver firmware
- Install the firmware on the Servo2040
- Operation
- Controller functions
- Simulation on a development computer
- Troubleshooting
- Limitations
- Design goals
- References and acknowledgements
- Licenses
Hexumi was the subject of a Mechanical Engineering BSc thesis at the Lodz University of Technology. The aim of the project is a walking robot that is cheap and easy to make, repair and change.
You can print all the structural parts on a consumer 3D printer. All the electronic parts are standard parts that you can buy. The cost of one robot can be approximately 300 EUR.
The robot uses a tripod gait. You control the robot with a Nintendo Switch Pro Controller.
| Branch | Contents | Use |
|---|---|---|
main |
All the source code, the CAD files (CAD/CADs.zip), the STL files and RViz support. |
Use this branch on a development computer. |
hexumi-base |
The source code only. RViz does not start. | Use this branch on the Raspberry Pi of the robot. |
The robot has these main parts:
- A Raspberry Pi 4 Model B. This computer runs the ROS 2 nodes.
- A Pimoroni Servo2040 board (RP2040 microcontroller). This board operates the 18 servos.
- 18 servo motors.
- A Nintendo Switch Pro Controller. The controller connects to the Raspberry Pi through Bluetooth.
- The 3D-printed parts. The STL files are in the
STLfolder of themainbranch.
A USB cable connects the Servo2040 to the Raspberry Pi. The firmware uses this cable for the micro-ROS serial connection.
For the electrical connections, refer to the wiring diagram:
The repository contains these ROS 2 packages (folder src):
| Package | Function |
|---|---|
hexumi_bringup |
Contains the launch files and the robot parameters (config/global_params.yaml). The global parameter server reads the robot model and gives the leg dimensions to the other nodes. |
hexumi_teleop_joy |
Changes the controller input into motion commands. |
hexumi_kinematics |
Calculates the leg trajectories and the joint angles (inverse kinematics). |
hexumi_msgs |
Contains the custom messages for the motion commands. |
servo2040_uros |
Contains the messages that the Raspberry Pi and the Servo2040 share. |
hexumi_description |
Contains the robot model (URDF/xacro) and the RViz configuration. |
The folder uros contains the firmware for the Servo2040. The firmware receives 18 joint angles and moves the servos.
The data flows in this sequence:
Pro Controller -> joy_node -> hexumi_teleop_joy -> /teleop/* -> hexumi_kinematics -> /joint_angles -> micro-ROS agent -> Servo2040
The kinematics node also sends /kinematics/joint_states for RViz.
- Ubuntu 24.04 (64-bit) on the Raspberry Pi.
- ROS 2 Jazzy.
-
Install Ubuntu Server 24.04 (64-bit) on the Raspberry Pi.
-
Install ROS 2 Jazzy. Follow the instructions in the ROS 2 Jazzy installation guide. The package
ros-jazzy-ros-baseis sufficient. -
Install the build tools:
sudo apt install python3-colcon-common-extensions python3-rosdep git
-
Initialize rosdep. Do this step one time only:
sudo rosdep init rosdep update
-
Give your user access to the serial port and to the controller:
sudo usermod -aG dialout,input $USER -
Log out and log in again. This makes the group change active.
-
Install joycond. Follow the instructions in the joycond repository.
-
Pair the Pro Controller with the Raspberry Pi through Bluetooth.
-
Make sure that the controller is available as
/dev/input/js0:ls /dev/input/js0
-
Make a workspace and clone the
hexumi-basebranch into it:mkdir -p ~/hexumi_ws/src git clone -b hexumi-base https://github.com/firkowski/hexumi.git ~/hexumi_ws/src/hexumi
-
Install the dependencies:
cd ~/hexumi_ws source /opt/ros/jazzy/setup.bash rosdep install --from-paths src --ignore-src -y
-
Build the workspace:
colcon build
NOTE: colcon does not build the firmware folder
uros. The fileuros/COLCON_IGNOREprevents this.
The micro-ROS agent connects the Servo2040 to ROS 2. Build the agent in a different workspace.
-
Make the agent workspace and get
micro_ros_setup:mkdir -p ~/uros_agent_ws/src cd ~/uros_agent_ws git clone -b jazzy https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup
-
Build
micro_ros_setup:source /opt/ros/jazzy/setup.bash rosdep install --from-paths src --ignore-src -y colcon build source install/local_setup.bash
-
Build the agent:
ros2 run micro_ros_setup create_agent_ws.sh ros2 run micro_ros_setup build_agent.sh
NOTE: The agent and the firmware must use the same ROS 2 distribution. A Humble agent does not operate with a Jazzy firmware.
Do these steps on a development computer with Ubuntu 24.04 and ROS 2 Jazzy. You can also do them on the Raspberry Pi, but the build is slow.
-
Install the compiler and the build tools:
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib build-essential
-
Get the Pico SDK:
git clone -b 1.5.1 --recurse-submodules https://github.com/raspberrypi/pico-sdk.git ~/pico-sdk -
Set the SDK path. Add this line to
~/.bashrc:export PICO_SDK_PATH=~/pico-sdk
-
Open a new terminal. This makes the variable active.
NOTE: The firmware was written for Pico SDK 1.5. Newer SDK versions are not tested.
The firmware needs a micro-ROS library that contains the Hexumi messages. You must build this library before you build the firmware. You must build it again each time a message in servo2040_uros changes.
-
Clone the
mainbranch and get themicro_ros_setupsubmodule:git clone https://github.com/firkowski/hexumi.git ~/hexumi cd ~/hexumi git submodule update --init
-
Build the tools in the firmware workspace:
cd ~/hexumi/uros/uros_ws source /opt/ros/jazzy/setup.bash rosdep install --from-paths src --ignore-src -y colcon build source install/local_setup.bash
-
Make the micro-ROS firmware workspace:
ros2 run micro_ros_setup create_firmware_ws.sh generate_lib
-
Copy the Hexumi message package into the firmware workspace:
ros2 run servo2040_uros cp_pkg_to_firmware.sh
-
Build the library:
ros2 run micro_ros_setup build_firmware.sh $(pwd)/uros_toolchain.cmake $(pwd)/uros_colcon.meta
The library is in
uros/uros_ws/firmware/build.
-
Build the firmware:
cd ~/hexumi/uros mkdir -p build cd build cmake .. make -j$(nproc)
-
Make sure that the file
uros/build/src/hexumi_servo_driver.uf2is available.
NOTE: If CMake shows the message "micro-ROS headers not found", do the procedure in 6.2 first.
- Disconnect the Servo2040 from all power sources.
- Push and hold the BOOT/USER button on the Servo2040.
- Connect the Servo2040 to the computer with a USB cable.
- Release the button. The computer shows a USB drive with the name
RPI-RP2. - Copy the file
hexumi_servo_driver.uf2to theRPI-RP2drive. - Wait until the drive closes. The Servo2040 then starts the new firmware.
WARNING: Keep your hands away from the legs when the servos have power. The servos are strong and can cause injury.
CAUTION: Before the first operation, put the robot on a stand. The legs must not touch the ground. Make sure that each servo moves the correct leg. An incorrect servo connection can damage the robot.
-
Connect the Servo2040 to the Raspberry Pi with the USB cable.
-
Turn on the controller.
-
Open a terminal and start the micro-ROS agent:
source ~/uros_agent_ws/install/local_setup.bash ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0 -b 115200
-
Make sure that the agent shows a "session established" message. The firmware tries to connect again until the agent is available.
-
Open a second terminal and start the Hexumi nodes:
source ~/hexumi_ws/install/setup.bash ros2 launch hexumi_bringup test.launch.py
-
Wait until the kinematics node shows the message "Loaded parameters for 6 legs".
-
Operate the robot with the controller. Refer to 9. Controller functions.
- Push B. The robot sits down.
- Push H (HOME). The servos stop.
- Push Ctrl+C in each terminal.
NOTE: If you push H while the robot walks, the robot stops the step and sits down from its current position.
To test the controller without the robot, start only the controller nodes:
ros2 launch hexumi_bringup teleop.launch.pyTo see the commands, use:
ros2 topic echo /teleop/meta_cmdThe robot accepts commands in this sequence: power on, stand up, walk.
| Control | Action | Function |
|---|---|---|
| ZL + ZR | Hold for 3 seconds | Turns on the servos. |
| H (HOME) | Push | Turns off the servos. The robot sits down first. |
| B | Push | Stands up the robot, or sits down the robot. |
| Left stick | Move | Walk. Forward/back moves the robot forward/back. Left/right turns the robot. |
| R + left stick | Hold R and move | Omnidirectional walk. Left/right moves the robot to the side. The robot does not turn. |
| Right stick | Move | Tilts the body. |
| L + right stick | Hold L and move | Moves the body forward, back, left or right. The feet do not move. |
| A | Push | Selects the tripod gait. |
| X | Push | Selects the ripple gait. Refer to 12. Limitations. |
| Y | Push | Selects the wave gait. Refer to 12. Limitations. |
The file src/hexumi_bringup/config/global_params.yaml sets the maximum speeds and the body limits. For example, max_lin_velocity is the maximum walk speed in m/s.
You can see the robot motion in RViz without the robot. Use the main branch.
-
Install ROS 2 Jazzy Desktop on Ubuntu 24.04.
-
Build the workspace. Use the procedure in 5.4, but clone the
mainbranch. -
Connect the Pro Controller to the computer.
-
Start the nodes:
source ~/hexumi_ws/install/setup.bash ros2 launch hexumi_bringup test.launch.py
-
RViz opens and shows the robot model. Operate the model with the controller.
| Problem | Possible cause | Action |
|---|---|---|
| The agent does not show "session established". | The Servo2040 is not on /dev/ttyACM0. |
Do the command ls /dev/ttyACM*. Use the correct device in the agent command. |
| The agent and the firmware use different ROS 2 distributions. | Build the agent and the firmware library for Jazzy. | |
| The agent shows "permission denied". | Your user is not in the group dialout. |
Do step 5 and step 6 of 5.2. |
| The kinematics node waits for the parameter server. | The global parameter server did not start. | Look for errors in the launch output. Make sure that the robot model is correct. |
| The robot does not respond to the controller. | joy_node does not find the controller. |
Make sure that /dev/input/js0 is available. Do the command ros2 topic echo /joy. |
| The servos are off. | Hold ZL + ZR for 3 seconds. Then push B. | |
| The teleop node shows "Expected a Pro Controller". | The controller is not a Pro Controller, or joycond does not operate. | Use a Pro Controller with joycond. |
| The servos move to incorrect angles. | The micro-ROS library contains an old message definition. | Do the procedure in 6.2 again. Then build and install the firmware again. |
- Only the tripod gait operates. If you select the wave gait or the ripple gait, the robot uses the tripod gait and shows a warning.
- The IMU function (O button), the foot contact sensors and the current measurement are not available.
- The D-pad body height control is not available.
- If the agent connection stops, the servos keep their last position.
- The servo-to-leg mapping and the calibration of the servo for leg R3 are not verified on the robot. Do the check in the CAUTION in 8. Operation.
- Low cost. You can make the robot with a consumer 3D printer and standard electronic parts.
- Less material. The printed parts need few supports. Thus, the printer uses less material.
- Easy repair. The structure is modular. If a part breaks, you print only that part again. For example, to change the ground contact sensors, you print only the tips of the tibias.
- Expansion. The housing has space for more sensors, for example a LIDAR, a camera or an IMU. The robot has a 5 V USB port and can hold a static load of 1.5 kg.
- Easy use. The robot has a charge port and other simple interfaces for a new user.
For the design process and the detailed calculations, refer to the paper "Design and Simulation of a Six-Legged Walking Robot" (2023). The paper is on the author's ResearchGate profile.
The Servo2040 firmware uses code from:
- Source code: MIT license. Refer to src/LICENSE and uros/LICENSE.
- CAD files, STL files and the wiring diagram: Creative Commons Attribution 4.0 license. Refer to CAD/LICENSE, STL/LICENSE and img/LICENSE.

