ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org

micro-ROS teensy support?

Hello @kfriesth, in order to implement these kinds of custom transports I guess that some minor changes will be needed at some points. Are you planning to use the Arduino IDE for programming this Teensy 4.1 or you have another kind of custom build system?

I think that using Ethernet or EtherCAT in Teensy 4.1 would be interesting despite the need of having to purchase an external RJ45 connector.

Let us know if you figure out how to embed your transport library. Here at micro-ROS team, we will be happy to help you to integrate it in the micro-ROS stack.

I am interested in getting Ethernet working on Teensy boards and I may have some time to work on that when I finish up my current projects. One slight issue is that uploading new firmware to Teensy boards requires USB right now so Ethernet cannot be the one and only communication channel to the board.

Are you committed to Ethercat? Is that proprietary? More deterministic communication would be great, but something open source would be even better.

I have been super curious about trying TSN ever since @vmayoral and his group used it on their H-ROS hardware. I do not know if that is considered open source either, though, and that may require extra hardware or an FPGA. So that might be a better fit for Zync-based boards.

The use in chiips for the slave is protected, there is however open source ethercat linux software solutions such as the one I linked. https://github.com/OpenEtherCATsociety/SOES.

Another solution would be changing the DP83825I phy to relatively cheap LAN9252/ LAN9253/ LAN9254 https://www.microchip.com/wwwproducts/en/LAN9252 chip solution for a hardware solution to ethercat.

In general, I think it is wise to offload to dedicated chips as much as possible, saving the microcontroller for other processing and for connecting all of the chips together. Many people disagree with that, though, and prefer to do everything in firmware and software.

It might make sense to implement all of the communication protocol in firmware if it allowed you to avoid making custom hardware. Since you have to add an external RJ45 connector anyway, though, in my opinion you might as well add a nice IC to properly handle the communication details.

Do you think EtherCAT is better than Time Sensitive Networking? Or do you have other parts of your system that require it?

Our plan is to use this with some open source robotic arms we are developing. if you load up everything on firmware and hardware you have to scale the processor and support components.

For instance with a modular robot with mcu’s at each arm joint you could use the use offload chips like LAN9252/3/4 you can now network via ethercat with very low jitter, If you need encoders you could add trinimac TMC4671-LA chips you can then interface stepper, servo or bldc motors, add external drivers, have encoding, temp, voltage, current sensing, brake control with connecting at an arm joint to a single mcu chip or use them for industrial bots placing the controllers and drivers at the base and then using mcu’s for networking and sensors at the joint. You can of course use cheaper trinimac chips or similar controllers for those not needing or wanting encoding functionality and such built in.

Sounds like a nice design. I am a big fan of Trinamic chips, I have used them with Teensy boards on many projects.

Your whole system sounds very similar to H-ROS, which I still think was a fantastic idea even though it is no longer being developed.

The Teensy also has a CAN FD bus, which could be another nice option for more deterministic communication between devices. The wiring would be pretty minimal and the peer-to-peer nature seems like it would fit well with publish/subscribe data transfer.

In case anybody wants to use this lib with platformio, it appears that adding the following line (for Teensy 4.1)

build_flags = -L ./lib/microros_ros_arduino-0.0.2/imxrt1062/fpv5-d16-hard/ -l libmicroros

to platformio.ini fixes the linker issues, without having to modify the platform.txt file needed when compiling with the Arduino IDE.

Hello @rom1 could you share some instructions for using micro-ROS with PlatformIO?

I’m still testing it right now, but so far it does compile and upload correctly. All that’s needed is to create a new PlatformIO project, placing the micro_ros_arduino folder inside the lib/ folder that’s generated when you create a new project. After that, you need to modify the platform.txt file to add the build_flags, it’ll end up looking something like this (in my case, the micro_ros_arduino is named microros):

[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
build_flags = -L ./lib/microros/imxrt1062/fpv5-d16-hard/ -l libmicroros

You might need to add #include <Arduino.h> to some files, since platformio does not include it by default. I’ve been trying to test it but haven’t been able to compile the micro_ros_agent to do so.

The issue that the Agent has this weeking is solved check here and here.

Let me know if you have any other problem build the agent and please give us feedback about the PlatformIO + micro-ROS behavior.

Oh, thanks, that was exactly the issue that I was getting. I’ll get back to you after I test this. On an unrelated note, does micro-ROS support UART? I modified the teensy_transports.c just to test with the normal arduino Serial.write() and Serial.read().

Update: the example publisher works well when compiled with PlatformIO and using uart.

1 Like

Cool, maybe we can do some kind of tutorial in order to show this PlatformIO initial test to the community.

Thoughts @FraFin @jamoralp?

Sounds good @pablogs. Nice work @rom01! Thanks for sharing it!

1 Like

In case of anyone interested to know how to connect and use micro-ros with teensy, I have published a tutorial article in this link. how-to-connect-teensy-3-2-with-micro-ros-and-ros2-foxy. Hope this helps someone.

3 Likes

Thanks for this great quality article!

1 Like

Hi guys, I managed to run a simple pub-sub demo using PlatformIO. I documented my progress here GitHub - linorobot/micro_ros_platformio

Is there any potential way to create a ROS 2 node on a microcontroller without the Micro-ROS agent? I was thinking about whether it would be possible to create a simple pub/sub (constrained even to a single type like String is fine!) with a ESP32 microcontroller that is not reliant on an agent living somewhere else, as that breaks decentralization.

Hello, the brokerless P2P does not entirely fit your needs because it only communicates micro-ROS nodes, and in this P2P mode there is no interaction between micro-ROS and ROS 2.

With no agent, one idea could be to write a RMW with a lightweight RTPS compatible middleware, for example embeddedRTPS. We think that it is possible to port embeddedRTPS to the ESP32 LwIP layer and will look into it.