Repository Summary
Description | micro-ROS ESP32 IDF component and sample code |
Checkout URI | https://github.com/micro-ros/micro_ros_espidf_component.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2025-01-30 |
Dev Status | UNKNOWN |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | esp-idf micro-ros |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Packages
Name | Version |
---|---|
micro_ros_espidf | 5.0.1 |
README
micro-ROS component for ESP-IDF
This component has been tested in ESP-IDF v4.4, and v5.2 with ESP32, ESP32-S2, ESP32-S3, ESP32-C3 and ESP32-C6.
Dependencies
This component needs colcon
and other Python 3 packages inside the IDF virtual environment in order to build micro-ROS packages:
. $IDF_PATH/export.sh
pip3 install catkin_pkg lark-parser colcon-common-extensions empy==3.3.4
Middlewares available
This package support the usage of micro-ROS on top of two different middlewares:
- eProsima Micro XRCE-DDS: the default micro-ROS middleware.
- embeddedRTPS: an experimental implementation of a RTPS middleware compatible with ROS 2.
In order to select it, use idf.py menuconfig
and go to micro-ROS Settings > micro-ROS middleware
Usage
You can clone this repo directly in the components
folder of your project.
If you encounter issues during the build process, ensure that you are running in a clean shell environment without the ROS 2 setup script sourced.
Example
In order to test a int32_publisher example:
. $IDF_PATH/export.sh
cd examples/int32_publisher
# Set target board [esp32|esp32s2|esp32s3|esp32c3]
idf.py set-target esp32
idf.py menuconfig
# Set your micro-ROS configuration and WiFi credentials under micro-ROS Settings
idf.py build
idf.py flash
idf.py monitor
To clean and rebuild all the micro-ROS library:
idf.py clean-microros
Is possible to use a micro-ROS Agent just with this docker command:
# UDPv4 micro-ROS Agent
docker run -it --rm --net=host microros/micro-ros-agent:foxy udp4 --port 8888 -v6
Build with docker container
It’s possible to build this example application using preconfigured docker container. Execute this line to build an example app using docker container:
docker run -it --rm --user espidf --volume="/etc/timezone:/etc/timezone:ro" -v $(pwd):/micro_ros_espidf_component -v /dev:/dev --privileged --workdir /micro_ros_espidf_component microros/esp-idf-microros:latest /bin/bash -c "cd examples/int32_publisher; idf.py menuconfig build flash monitor"
Dockerfile for this container is provided in the ./docker directory and available in dockerhub. This approach uses ESP-IDF v5.
Using serial transport
By default, micro-ROS component uses UDP transport, but is possible to enable UART transport or any other custom transport setting the colcon.meta
like:
...
"rmw_microxrcedds": {
"cmake-args": [
...
"-DRMW_UXRCE_TRANSPORT=custom",
...
]
},
...
An example on how to implement this external transports is available in examples/int32_publisher_custom_transport
.
Available ports are 0
, 1
and 2
corresponding UART_NUM_0
, UART_NUM_1
and UART_NUM_2
.
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:foxy serial --dev [YOUR BOARD PORT] -v6
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.
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.