Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MicroROS on Espressif #9955

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

hierophect
Copy link
Collaborator

@hierophect hierophect commented Jan 12, 2025

This draft PR is an attempt to add MicroROS as an optional addition to the Espressif port. The Robot Operating System (ROS and sucessor ROS2) is a very commonly used collection of software and standards in professional and research robotics. It is somewhat misnamed: it is not an operating system or RTOS, but a collection of middleware and type standards for different robot parts to talk to each other. MicroROS is an API for embedded systems that allows them to talk to a ROS system on a linux machine, such as a big computer running perception, kinematics or machine learning tasks.

https://micro.ros.org/docs/overview/hardware/

The goal of this project is to allow Espressif Circuitpython boards to recieve and transmit data over WIFI to a computer running ROS, to publish sensor data, take in motor commands, and other tasks. The secondary goal of the project is to prevent as much of ROS's extreme complexity as possible from entering Circuitpython's build system (native ROS is not beginner software and has many tricky requirements). I'm focusing on the latter to start, to try and see whether this project is possible/practical before designing a full API.

Questions / priorities:

  • Since ROS is not a priority for most Circuitpython users it probably makes sense to make this either an optional build flag that is user-compiled. Alternatively, it could be an "alt board" build for some specific Espressif boards with high utility, like the Feathers.
  • This project uses the Espressif MicroROS component, which requires ROS-specific build tools to compile (colcon and ament). To avoid adding these to CI I've pre-compiled the component and included it as a .a library. However this does make the project more difficult to keep up to date - I'm not sure what the best option is here?
  • MicroROS is also supported for STM32 boards and could potentially be added later, so I'm not sure if the bindings for this project are better placed in ports/espressif/bindings or shared-bindings
  • The include additions are kind of insane, maybe could be either broken off into a separate repo, or whittled down to a more circuitpython-specific subset.

In the off-chance that anyone has actually used ROS and has specific concerns or API requests, they'd be great to hear, so far I'm just going off suggestions from people in my personal robotics network.

Will resolve #8139

@hierophect hierophect added the espressif applies to multiple Espressif chips label Jan 12, 2025
@hierophect hierophect added this to the Long term milestone Jan 12, 2025
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do these microros-ext files come from? Can you submodule them instead?

@hierophect
Copy link
Collaborator Author

hierophect commented Jan 13, 2025

I agree we should submodule somehow - microros-ext is sourced from https://github.com/micro-ROS/micro_ros_espidf_component, which I avoided including directly due to the additional requirements in the idf virtual environment, pip3 install catkin_pkg lark-parser colcon-common-extensions empy==3.3.4, and the extended build process caused by colcon fetching all the message type packages. I didn't want them clogging up Circuitpython's CI process, but @dhalbert suggested it might not be a big deal to include those directly, as long as the component isn't enabled willy-nilly. I'm happy to either include it directly and refactor the build system changes, or make a submodule of the precompiled version to use instead.

@tannewt
Copy link
Member

tannewt commented Jan 14, 2025

I don't understand the build stuff you are referring to. A README.md in microros-ext would be helpful in explaining where it came from and how to update it.

@hierophect
Copy link
Collaborator Author

I don't understand the build stuff you are referring to.

Sorry, let me say that in a less confusing way. Compiling the MicroROS component installs a bunch of python package managers, is slow, and has a lot of verbose build output. To avoid adding that to Circuitpython's CI tests, I made a pre-compiled version, which is what I've included. I've recieved feedback already that that might be less easy to maintain, so I could revert back to including the original component as a submodule if you feel this feature being more futureproofed would be worth a small performance hit to the CI. Which would you prefer?

@tannewt
Copy link
Member

tannewt commented Jan 16, 2025

How about splitting the difference and making a separate repo for the precompiled files? That way it isn't in CP but it doesn't require building every time.

@furbrain
Copy link

I'd just like to comment that this looks awesome, having ROS on CircuitPython could open up lots of opportunities. I'm currently thinking of making a CircuitPython sensor -> ROS factory utility class - so you could just set up your sensor, pass it into the class and it starts publishing on an appropriate topic - so an accelerometer+gyro would start publishing IMU messages for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
espressif applies to multiple Espressif chips
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ROS2 networking via MicroROS
3 participants