Ask Your Question

Need to Connect uP to ROS/Linux on a new project. Is ROS2 the way to go?

asked 2019-03-29 16:46:48 -0500

chrisalbertson gravatar image

I have a STM32F type microcontroller running a sensor and I'd like it to interface to ROS as a node over a serial (USB, SPI, I2C,..) link. This uP is not an Arduino. It runs a real-time OS.

With Effort, I might get ROS Serial to work and then run a ROS Serial server on the Linux side. In fact, I've prototyped this using an Arduino in place of my actual device and messages flow in both directions.

But if ROS 2 is the future perhaps I should run a DDS library on my STM32? And then some kind of DDS to ROS 1 bridge on the Linux side? I've not studied ROS 2 enough but I think it uses a "standard" message passing protocol and I should use that, especially if my RTOS supports it.

Just looking for general advice at this time. Possibly I've not thought of some good options.

My use case is building "smart" controllers that play with ROS well. For example, a base controller that connects with USB to a ROS/Linux system and subscribes to cmd_vel and publishes TF and odometry. Literally a "plug and play" ROS node.

edit retag flag offensive close merge delete


Is a uP a microprocessor?

jayess gravatar imagejayess ( 2019-03-29 16:54:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-03-29 16:53:38 -0500

tfoote gravatar image

I know that there's several ongoing efforts. In particular I think that is the most actively used/hands on. There's active work to extend that implementation at:

Another bridging approach is implemented in

There's a much more comprehensive project: to fully leverage DDS XRCE implementations and provide a more complete ROS2 API inside the microcontroller instead of a bridging approach that's under active development.

edit flag offensive delete link more


@tfoote: it's OSS, so bound to happen, but: ros2_serial_example looks like it sits in a similar space as the ros2arduino packages creates by ROBOTIS. What was the rationale for creating ros2_serial_example?

gvdhoorn gravatar imagegvdhoorn ( 2019-03-30 02:41:15 -0500 )edit

It's a short term project focused on upgrading the px4_ros_com implementation with the goal to merge back. As can be seen at the top of the Readme there's a lot of similar implementations we linked to, including ros2arduino,out there and we'd like to bring them all together. We specidically called ours an example as it's not designed to be a long term package. We worked on things like leveraging the ROS2 type support libraries and other things to help with scaling instead of I think all the other approaches that hard code message support.

tfoote gravatar imagetfoote ( 2019-04-01 13:22:25 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-03-29 16:46:48 -0500

Seen: 69 times

Last updated: Mar 29