How to Control the UmiRobot Using ROS 2, micro-ROS, and MoveIt: A Step-by-Step Guide.

Baris Yazici
3 min readApr 25, 2024

--

UmiRobot executing MoveIt generated trajectories via ROS 2 interface

In the past year, there has been a huge interest in low-cost robotic manipulators, driven by their potential to automate household tasks using advances in Imitation Learning like the Aloha robot. These affordable robots offer several key advantages:

  • Ease of Use and Repair: Simplified maintenance and straightforward operation.
  • Energy Efficiency: Low power consumption makes them ideal for battery-powered applications.
  • Compact and Lightweight Design: Perfect for space-constrained environments.
  • Safety: Reduced risk when operating near humans.

Such traits make these robots particularly appealing for robotics enthusiasts and students, providing a practical platform to test and refine learning algorithms. In this context, 3D printed manipulators like the UmiRobot, introduced by Murilo M. Marinho, Ph.D., serve as a stepping stone for students to learn ROS and experiment with algorithms on actual hardware.

In this article, I’ll discuss how I’ve worked on integrating the UmiRobot with ROS 2. This integration aims to simplify UmiRobot control, significantly lowering the barriers for users. The following video shows the UmiRobot in action, executing motion plans generated by MoveIt.

https://www.youtube.com/watch?v=zb3xAI4kboM

ROS 2 Integration Using ESP32

I adapted the UmiRobot for ROS 2 integration with MoveIt by modifying the original design proposed by Marinho et al. The core of these enhancements is the ESP32 microcontroller, equipped with a dual-core processor that efficiently handles multiple tasks. For programming ESP32, the ESP-IDF (IoT Development Framework) was used. It’s an open-source SDK that facilitates firmware compilation and flashing. ESP32 is also supported by the micro-ROS.

Key Reasons for ESP32 Selection:

  • Multi-tasking Capability: Efficient handling of concurrent processes.
  • Comprehensive SDK Support: The ESP-IDF is actively maintained, with a broad range of networking stacks and rapid feature updates.
  • Community and Open Source Support: The ESP32 benefits from robust community support and open-source resources, which are critical for ongoing development and innovation.

For more details on starting with ESP-IDF, visit the ESP-IDF development guide.

Electronics Connection

The diagram below demonstrates how the ESP32 connects the 4 servo motors and the user’s computer which runs ROS 2 and sends hardware commands.

Servo 1 is connected to the second GPIO, Servo 2 to the fourth GPIO, Servo 3 to GPIO 17, and Servo 4 to GPIO 18.

Embedding micro-ROS

The integration of ROS 2 with the UmiRobot utilizes micro-ROS on middleware level. Micro-ros is ROS 2 adaptations for microcontrollers. By using micro-ROS we eliminate the need for separate hardware drivers, enabling direct communication with the hardware through ROS 2 topics.

  • Direct Integration: While micro-ROS does not integrate directly with ESP32. An open-source repository help integration within the IDF SDK by treating micro-ROS as an ESP32 component.(https://github.com/micro-ROS/micro_ros_espidf_component.)
  • Servo Drive Implementation: I have extended the micro-ROS component to include a servo drive example, available on my fork of the repository here.

I use a ROS 2 topic, /set_servo_angle, to maintain the communication between the ROS 2 hardware interface and the microcontroller. The micro-ROS example subscribes to this topic, receiving angle commands for each motor, which are then executed using the MCPWM library to send the appropriate PWM signals to the servos.

MoveIt Integration

To enhance functionality, the integration with MoveIt allows for trajectory planning and execution while avoiding collisions. This requires a MoveIt configuration package and a URDF file with collision meshes for collision detection and inverse kinematics calculations.

Conclusion

The entire codebase, including the integration of ROS 2 with the UmiRobot is open-sourced.

Key components of the project are available on my GitHub repositories. The servo drive example, part of the micro_ros_espidf_component repository, can be explored here: Servo Drive Example. Additionally, the ROS 2 hardware interface package, which includes umi_robot_msgs, and the MoveIt configuration package, are both available in the umi_robot_ros2 repository, accessible at: UmiRobot ROS 2 Repository.

--

--

Baris Yazici

Software engineer based in Munich. Interested in reinforcement learning in robotics application.