Repository Summary
Description | Support macros for building micro-ROS-based firmware. |
Checkout URI | https://github.com/micro-ros/micro_ros_setup.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2025-03-11 |
Dev Status | UNKNOWN |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
micro_ros_setup | 5.0.0 |
README
This ROS 2 package is the entry point for building micro-ROS apps for different embedded platforms.
- Supported platforms
- Dependencies
- Quick start
- Building
- Building micro-ROS-Agent
- Contributing
- Purpose of the Project
- License
- Known Issues / Limitations
- Papers
Supported platforms
This package provides tools and utils to crosscompile micro-ROS with just the common ROS 2 tools for the following platforms.
Note that this package provides basic support only, intended in particular for ROS developers who are new to microcontrollers. Micro-ROS components for each platform are available and provide a deeper and more flexible integration with the platform-specific build systems.
1 Community supported, may have lack of official support
2 Support for compiling apps in a native Linux host for testing and debugging
3 a valid CMake toolchain with custom crosscompilation definition is required
Standalone build system tools
micro_ros_setup
provides access to standalone build system tools using the component
command.
After building this package just run:
ros2 run micro_ros_setup component --help
micro-ROS standalone module for specific platforms are:
- a standalone micro-ROS component for Renesas e2 studio and RA6M5: this package enables the integration of micro-ROS in Renesas e2 studio and RA6M5 MCU family.
- a standalone micro-ROS component for ESP-IDF: this package enables the integration of micro-ROS in any Espressif ESP32 IDF project.
- a standalone micro-ROS module for Zephyr RTOS: this package enables the integration of micro-ROS in any Zephyr RTOS workspace.
- a standalone micro-ROS module for Mbed RTOS: this package enables the integration of micro-ROS in any Mbed RTOS workspace.
- a standalone micro-ROS module for NuttX RTOS: this package enables the integration of micro-ROS in any NuttX RTOS workspace.
- a standalone micro-ROS module for Microsoft Azure RTOS: this package enables the integration of micro-ROS in a Microsoft Azure RTOS workspace.
- a standalone micro-ROS module for RT-Thread RTOS: this package enables the integration of micro-ROS in a RT-Thread workspace.
- a standalone micro-ROS app for TI Tiva™ C Series: this package enables the integration of micro-ROS in a exas Instruments Tiva™ C Series.
- a set of micro-ROS utils for STM32CubeMX and STM32CubeIDE: this package enables the integration of micro-ROS in STM32CubeMX and STM32CubeIDE.
- a library builder for PlatformIO: this package enables the integration of micro-ROS in PlatformIO.
- a precompiled set of Arduino IDE libraries: this package enables the integration of micro-ROS in the Arduino IDE for some hardware platforms.
- a precompiled set of Raspberry Pi Pico SDK libraries: this package enables the integration of micro-ROS in the Raspberry Pi Pico SDK.
Dependencies
This package targets the ROS 2 installation. ROS 2 supported distributions are:
ROS 2 Distro | State | Branch |
---|---|---|
Crystal | EOL | crystal |
Dashing | EOL | dashing |
Foxy | EOL | foxy |
Galactic | EOL | galactic |
Humble | Supported | humble |
Iron | Supported | iron |
Jazzy | Supported | jazzy |
Rolling | Supported | rolling |
Some other prerequisites needed for building a firmware using this package are:
sudo apt install python3-rosdep
Building for Android needs Latest Android NDK to be installed and the following environment variables to be set:
```: CPU variant, refer [here](https://developer.android.com/ndk/guides/abis) for details.
-
```ANDROID_NATIVE_API_LEVEL
```: Android platform version, refer [here](https://developer.android.com/ndk/guides/cmake#android_native_api_level) for details.
-
```ANDROID_NDK
```: root path of the installed NDK.
# Quick start
Download [here](https://www.eprosima.com/index.php/downloads-all) the micro-ROS docker image that contains a pre-installed client and agent as well as some compiled examples.
# Building
Create a ROS 2 workspace and build this package for a given ROS 2 distro (see table above):
```bash
source /opt/ros/$ROS_DISTRO/setup.bash
mkdir uros_ws && cd uros_ws
git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup
rosdep update && rosdep install --from-paths src --ignore-src -y
colcon build
source install/local_setup.bash
Once the package is built, the firmware scripts are ready to run.
You can find tutorials for moving your first steps with micro-ROS on an RTOS in the micro-ROS webpage.
Creating micro-ROS firmware
Using the create_firmware_ws.sh [RTOS] [Platform]
command, a firmware folder will be created with the required code for building a micro-ROS app. For example, for our reference platform, the invocation is:
# Creating a FreeRTOS + micro-ROS firmware workspace
ros2 run micro_ros_setup create_firmware_ws.sh freertos olimex-stm32-e407
# Creating a Zephyr + micro-ROS firmware workspace
ros2 run micro_ros_setup create_firmware_ws.sh zephyr olimex-stm32-e407
Configuring micro-ROS firmware
By running configure_firmware.sh
command the installed firmware is configured and modified in a pre-build step. This command will show its usage if parameters are not provided:
ros2 run micro_ros_setup configure_firmware.sh [configuration] [options]
By running this command without any argument the available demo applications and configurations will be shown.
Common options available at this configuration step are:
-
--transport
or-t
:udp
,serial
or any hardware specific transport label -
--dev
or-d
: agent string descriptor in a serial-like transport (optional) -
--ip
or-i
: agent IP in a network-like transport (optional) -
--port
or-p
: agent port in a network-like transport (optional)
Please note that each RTOS has its configuration approach that you might use for further customization of these base configurations. Visit the micro-ROS webpage for detailed information about RTOS configuration.
In summary, the supported configurations for transports are:
FreeRTOS | Zephyr | |
---|---|---|
Olimex STM32-E407 | UART, Network | USB, UART |
ST B-L475E-IOT01A | - | USB, UART, Network |
Crazyflie 2.1 | Custom Radio Link | - |
Espressif ESP32 | UART, WiFI UDP | - |
ST Nucleo F446RE 1 | UART | UART |
ST Nucleo F446ZE 1 | UART | - |
ST Nucleo H743ZI 1 | - | UART |
ST Nucleo F746ZG 1 | UART | UART |
ST Nucleo F767ZI 1 | UART | - |
1 Community supported, may have lack of official support
Building micro-ROS firmware
By running build_firmware.sh
the firmware is built:
ros2 run micro_ros_setup build_firmware.sh
Flashing micro-ROS firmware
In order to flash the target platform run flash_firmware.sh
command.
This step may need some platform-specific procedure to boot the platform in flashing mode:
ros2 run micro_ros_setup flash_firmware.sh
Building micro-ROS-Agent
Using this package is possible to install a ready to use micro-ROS-Agent:
ros2 run micro_ros_setup create_agent_ws.sh
ros2 run micro_ros_setup build_agent.sh
source install/local_setup.sh
ros2 run micro_ros_agent micro_ros_agent [parameters]
Contributing
As it is explained along this document, the firmware building system takes four steps: creating, configuring, building and flashing.
New combinations of platforms and RTOS are intended to be included in config
folder. For example, the scripts for building a micro-ROS app for Crazyflie 2.1 using FreeRTOS is located in config/freertos/crazyflie21
.
This folder contains up to four scripts:
-
create.sh
: gets a variable named$FW_TARGETDIR
and installs in this path all the dependencies and code required for the firmware. -
configure.sh
: modifies and configure parameters of the installed dependencies. This step is optional. -
build.sh
: builds the firmware and create a platform-specific linked binary. -
flash.sh
: flashes the binary in the target platform.
Some other required files inside the folder can be accessed from these scripts using the following paths:
# Files inside platform folder
$PREFIX/config/$RTOS/$PLATFORM/
# Files inside config folder
$PREFIX/config
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 ROS 2 system_modes, see the file 3rd-party-licenses.txt.
Known Issues / Limitations
There are no known limitations.
If you find issues, please report them.
Papers
If you want to cite micro-ROS, please cite the following book chapter (PDF available at Springer Link):
Kaiwalya Belsare, Antonio Cuadros Rodriguez, Pablo Garrido Sánchez, Juanjo Hierro, Tomasz Kołcon, Ralph Lange, Ingo Lütkebohle, Alexandre Malki, Jaime Martin Losa, Francisco Melendez, Maria Merlan Rodriguez, Arne Nordmann, Jan Staschulat, and Julian von Mendel: Micro-ROS. In: Anis Koubaa (ed.) Robot Operating System (ROS): The Complete Reference (Volume 7), Springer, pp. 3–55, 2023. (Online since 2 February 2023.)
@INBOOK{Belsare_et_al_2023_Micro-ROS,
author = {Kaiwalya Belsare and Antonio Cuadros Rodriguez and Pablo Garrido S\'{a}nchez and Juanjo Hierro
and Tomasz Ko\l{}con and Ralph Lange and Ingo L\"{u}tkebohle and Alexandre Malki
and Jaime Martin Losa and Francisco Melendez and Maria Merlan Rodriguez and Arne Nordmann
and Jan Staschulat and and Julian von Mendel},
title = {Micro-ROS},
editor = {Anis Koubaa},
booktitle = {Robot Operating System (ROS): The Complete Reference (Volume 7)},
year = {2023},
publisher = {Springer},
pages = {3--55},
doi = {10.1007/978-3-031-09062-2_2}
}
CONTRIBUTING
Contributing
Want to contribute? Great! You can do so through the standard GitHub pull request model. For large contributions we do encourage you to file a ticket in the GitHub issues tracking system prior to any code development to coordinate with the system_modes development team early in the process. Coordinating up front helps to avoid frustration later on.
Your contribution must be licensed under the Apache-2.0 license, the license used by this project.
Add / retain copyright notices
Include a copyright notice and license in each new file to be contributed, consistent with the style used by this project. If your contribution contains code under the copyright of a third party, document its origin, license, and copyright holders.
Sign your work
This project tracks patch provenance and licensing using a modified Developer Certificate of Origin (DCO; from OSDL) and Signed-off-by tags initially developed by the Linux kernel project.
system_modes Developer's Certificate of Origin. Version 1.0
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the "Apache License, Version 2.0"
("Apache-2.0"); or
(b) The contribution is based upon previous work that is covered by
an appropriate open source license and I have the right under
that license to submit that work with modifications, whether
created in whole or in part by me, under the Apache-2.0 license;
or
(c) The contribution was provided directly to me by some other
person who certified (a) or (b) and I have not modified it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
metadata and personal information I submit with it, including my
sign-off) is maintained indefinitely and may be redistributed
consistent with this project and the requirements of the Apache-2.0
license or any open source license(s) involved, where they are
relevant.
(e) I am granting the contribution to this project under the terms of
Apache-2.0.
http://www.apache.org/licenses/LICENSE-2.0
With the sign-off in a commit message you certify that you authored the patch or otherwise have the right to submit it under an open source license. The procedure is simple: To certify above system_modes Developer’s Certificate of Origin 1.0 for your contribution just append a line
Signed-off-by: Random J Developer <random@developer.example.org>
to every commit message using your real name or your pseudonym and a valid email address.
If you have set your user.name
and user.email
git configs you can
automatically sign the commit by running the git-commit command with the -s
option. There may be multiple sign-offs if more than one developer was
involved in authoring the contribution.
For a more detailed description of this procedure, please see SubmittingPatches which was extracted from the Linux kernel project, and which is stored in an external repository.
Individual vs. Corporate Contributors
Often employers or academic institution have ownership over code that is written in certain circumstances, so please do due diligence to ensure that you have the right to submit the code.
If you are a developer who is authorized to contribute to system_modes on behalf of your employer, then please use your corporate email address in the Signed-off-by tag. Otherwise please use a personal email address.
Maintain Copyright holder / Contributor list
Each contributor is responsible for identifying themselves in the NOTICE file, the project’s list of copyright holders and authors. Please add the respective information corresponding to the Signed-off-by tag as part of your first pull request.
If you are a developer who is authorized to contribute to system_modes on behalf of your employer, then add your company / organization to the list of copyright holders in the NOTICE file. As author of a corporate contribution you can also add your name and corporate email address as in the Signed-off-by tag.
If your contribution is covered by this project’s DCO’s clause “(c) The contribution was provided directly to me by some other person who certified (a) or (b) and I have not modified it”, please add the appropriate copyright holder(s) to the NOTICE file as part of your contribution.