Home

Awesome

banner banner

micro-ROS for Arduino

This is a micro-ROS library for baremetal projects based on Arduino IDE or Arduino CLI.

As the build process for ROS 2 and micro-ROS is based on custom meta-build system tools and CMake, this library is provided as a precompiled library. However, users can rebuild their own precompiled libraries in order to modify the micro-ROS configuration or RMW parameters by customizing the respective .meta file.

Supported boards

Supported boards are:

BoardMin versionStateDetails.meta file
Arduino Portenta H7 M7 Corev1.8.5SupportedOfficial Arduino supportcolcon.meta
Arduino Nano RP2040 Connectv1.8.5SupportedOfficial Arduino supportcolcon_verylowmem.meta
OpenCRv1.4.16SupportedBased on custom boardcolcon.meta
Teensy 4.0v1.8.5Not testedBased on Teensyduino (1.58.x)colcon.meta
Teensy 4.1v1.8.5SupportedBased on Teensyduino (1.58.x)colcon.meta
Teensy 3.2/3.1v1.8.5SupportedBased on Teensyduino (1.58.x)colcon_lowmem.meta
Teensy 3.5v1.8.5Not testedBased on Teensyduino (1.58.x)colcon_lowmem.meta
Teensy 3.6v1.8.5SupportedBased on Teensyduino (1.58.x)colcon_lowmem.meta
ESP32 Dev Modulev1.8.5SupportedArduino core for the ESP32 (v2.0.2)colcon.meta

Community contributed boards are:

BoardMin versionContributorDetails.meta file
Arduino Due-@lukicdarkoocolcon_verylowmem.meta
Arduino Zero-@lukicdarkoocolcon_verylowmem.meta
Kakute F7-@amferncolcon.meta
STM32-E407-@dominikncolcon.meta
Wio Terminal-@maehara-keisukecolcon.meta
Raspberry Pi Pico-@maehara-keisukewith ESP-ATcolcon_verylowmem.meta
Seeed Studio XIAO SAMD21-@maehara-keisukewith ESP-ATcolcon_verylowmem.meta
Seeed Studio XIAO RP2040-@maehara-keisukewith ESP-ATcolcon_verylowmem.meta
Arduino Giga R1-@gbr1colcon.meta
Arduino UNO R4 WiFi-@gbr1colcon.meta
Arduino UNO R4 Minima-@gbr1colcon.meta
Arduino Opta-@gbr1colcon.meta

You can find the available precompiled ROS 2 types for messages and services in available_ros2_types.

How to use the precompiled library

Arduino IDE

Go to link to release section and download the last release of micro-ROS library for Arduino.

Include it in your project using Sketch -> Include library -> Add .ZIP Library...

You can test micro-ROS examples located in this repo examples folder.

Remember that is possible to use a micro-ROS Agent just with this docker command:

# Serial micro-ROS Agent
docker run -it --rm -v /dev:/dev --privileged --net=host microros/micro-ros-agent:rolling serial --dev [YOUR BOARD PORT] -v6

PlatformIO

PlatformIO support for this repository has been deprecated in favor of its own build system: micro_ros_platformio

How to build the precompiled library

If you need to add custom packages or types, or customize any internal parameter of the micro-ROS stack, you will need to recompile this library from source code:

docker pull microros/micro_ros_static_library_builder:rolling
docker run -it --rm -v $(pwd):/project --env MICROROS_LIBRARY_FOLDER=extras microros/micro_ros_static_library_builder:rolling

Optionally a specific single target can be built using the -p <LIBRARY_TARGET> argument like this:

docker run -it --rm -v $(pwd):/project --env MICROROS_LIBRARY_FOLDER=extras microros/micro_ros_static_library_builder:rolling -p <LIBRARY_TARGET>

Available targets LIBRARY_TARGETS are available on the top of the extras/library_generation/library_generation.sh file

Folders added to extras/library_generation/extra_packages and entries added to extras/library_generation/extra_packages/extra_packages.repos will be taken into account by this build system. This should be used for example when adding custom messages types or custom micro-ROS packages.

You can configure many parameters of the library by editing the respective .meta file in the extras/library_generation/ directory.

Patch Arduino board for support precompiled libraries

Patch Teensyduino

Go inside your Arduino + Teensyduino installation and replace platform.txt:

export TEENSYDUINO_VERSION=[Your Teensyduino library version, e.g: 1.58.0]
export ARDUINO_PATH=[Your Arduino + Teensyduino path]
cd $ARDUINO_PATH/hardware/avr/$TEENSYDUINO_VERSION/
curl https://raw.githubusercontent.com/micro-ROS/micro_ros_arduino/main/extras/patching_boards/platform_teensy.txt > platform.txt

The patch applies the changes detailed on the first two sections of this post: Solution for adding support for pre-compiled Libraries

Patch SAM

Go inside your Arduino installation and replace platform.txt:

export ARDUINO_PATH=[Your Arduino path]
cd $ARDUINO_PATH/hardware/sam/1.6.12/
curl https://raw.githubusercontent.com/micro-ROS/micro_ros_arduino/main/extras/patching_boards/platform_arduinocore_sam.txt > platform.txt

Purpose of the Project

This software is not ready for production use. It has neither been developed nor tested for a specific use case. However, the license conditions of the applicable Open Source licenses allow you to adapt the software to your needs. Before using it in a safety relevant setting, make sure that the software fulfills your requirements and adjust it according to any applicable safety standards, e.g., ISO 26262.

License

This repository is open-sourced under the Apache-2.0 license. See the LICENSE file for details.

For a list of other open-source components included in this repository, see the file 3rd-party-licenses.txt.

Known Issues/Limitations