ROS is an open-source framework that simplifies the development of complex robotic applications. It utilizes a distributed architecture that facilitates communication between various software components within a robot’s system.
ROS2 is a popular framework for developing robotics systems, which utilizes a flexible middleware called Data Distribution Service (DDS), providing improved support for real-time and distributed systems. However, it can be challenging to use on small, low-power devices due to its resource requirements.
Micro-ROS offers a lightweight and efficient implementation of ROS2, which can run on microcontrollers, making it suitable for resource-constrained environments such as embedded systems and mobile robots. It is an extension of ROS2 that enables developers to deploy the framework on microcontrollers.
In this article, we will explore some examples of how to control robot wheels using micro-ROS on MCU and the Robot Operating System.
For Installation of ROS2.
For more details about micro-ROS click here.
MCUs and ROS2 essentially communicate via the Micro-ROS Agent, which is a ROS 2 node that wraps the Micro XRCE-DDS Agent. The node acts as a server between the DDS Network and Micro-ROS nodes inside the MCU. It receives and sends messages from Micro-ROS nodes and keeps track of the Micro-ROS nodes, exposing them to the ROS 2 network. The node interacts with the DDS Global Data Space on behalf of the Micro-ROS nodes.
Click here to check list of Micro-ROS supported hardware.
Here, we are using an ESP32 development board to control robot movement through motor drivers and an NVIDIA Jetson kit to send Command Velocity. With the ESP32, we are effectively controlling wheel’s RPM, Direction, and Ticks. The direction is determined by the output of the Hall sensor, which is connected to our hub motor.
Meanwhile, the wheel’s RPM is calculated based on the command velocity that is transmitted from our Differential node, which is running on the Jetson board. Lastly, the number of ticks is tracked by counting the number of interrupts that are received from the Hall sensor, which is also used to determine the direction of the wheel.
The general steps to integrate Micro ROS porting on ESP32 with Nvidia Jetson Orin are mentioned below. The specific details may vary depending on your platform and the application you are developing.
Here we have used Arduino IDE to build ESP32 application. There are several steps to build, one can refer Esp32 board install on Arduino IDE, And Library build for micro-ROS in Arduino.
1.NVDIA AGX Orin Robotics Computer
2.ESP32 micro controller
• Communication between the NVIDIA AGX Orin and ESP32 takes place over the UART peripheral by exchanging standard ROS (Robotics Operating System) messages.
• The hub motor is connected to motor drivers, and the hall sensor, direction, and enable pins of the driver are connected to ESP32 GPIOs.
• The NVIDIA AGX Orin has a General-Purpose Operating System (GPOS) based computer running Ubuntu with ROS middleware available.
• Micro-ROS Agent running on AGX Orin is a ROS 2 node that wraps the Micro XRCE-DDS Agent. It receives and send messages from Micro-ROS nodes and It handles the ROS communication between AGX Orin and ESP32.
• We have also created a custom message for ROS2 and ESP applications, which is published from the differential node. The ESP32 subscribes to this message and handles the wheel RPM according to the data received.
• As mentioned earlier, the ESP32 handles driving the robot wheels using their associated motor drivers. The command to drive the robot is generated by the differential ROS node running inside the Orin device, which operates on the principle of a Differential Wheeled Robot.
• The differential node receives a command velocity message from any of the driver applications (e.g., Tele-op twist keyboard, Navigation stack, etc.). The command velocity message expresses velocity in free space, broken into its linear and angular parts. The differential node derives the left and right wheel velocity and sends them as ROS topics to the ESP32.
• Upon receiving the velocity messages, the ESP32 applies the required PWM (Pulse-Width Modulation) value to the associated motor drives, which drives the wheels.
To summarize, the successful porting of Micro-ROS to MCUs and its integration with ROS-based Linux OS represents a significant advancement in the field of robotics development. This development enables the creation of highly modular and scalable systems that can perform complex tasks by distributing the workload across multiple nodes. By leveraging the powerful tools and libraries provided by the ROS ecosystem, developers can build robust robotic systems that can run on low-power and resource-constrained devices.
The combination of low-power microcontrollers and high-performance computing platforms provides a flexible and powerful platform for building complex robotic systems. With the integration of Micro-ROS, the potential for further innovation in the field of robotics is limitless.
Ruchi is an experienced Embedded Engineer at EInfochips Pvt Ltd., where she has been working for the past 1.5 years. She completed her B. Tech degree in Electronics Engineering from Birla Vishwakarma Mahavidyalaya. Ruchi has experience in developing firmware and has worked on a variety of microcontrollers. She has been focused on using microcontrollers with micro-ROS to develop efficient and robust robotic systems.
Meet Gandhi is a skilled embedded software engineer associated with Einfochips Pvt Ltd. He is having 6+ years of experience building innovative solutions to complex problems. With expertise in Embedded Software development, Meet Gandhi is dedicated to delivering high-quality software that meets both technical and business requirements. A lifelong learner, Meet Gandhi is passionate about staying up-to-date with the latest trends and technologies in the field.
eInfochips, an Arrow Electronics company, is a leading provider of digital transformation and product engineering services. eInfochips accelerates time to market for its customers with its expertise in IoT, AI/ML, security, sensors, silicon, wireless, cloud, and power. eInfochips has been recognized as a leader in Engineering R&D services by many top analysts and industry bodies, including Gartner, Zinnov, ISG, IDC, NASSCOM and others.
Headquarters
– USA, San Jose
– INDIA, Ahmedabad
Write to Us: marketing@eInfochips.com
©2025 eInfochips (an Arrow company), all rights reserved. | Know more about Arrow’s Privacy Policy and Cookie Policy
Schedule a 30-minute consultation with our Automotive Solution Experts
Schedule a 30-minute consultation with our Battery Management Solutions Expert
Schedule a 30-minute consultation with our Industrial & Energy Solutions Experts
Schedule a 30-minute consultation with our experts