Sharing code with ROS2 node

mr_koz

Member
Greetings, just looking for some advice.

I am building robot spiders, they're entirely driven by teensy4.1s and it's working well! But I want to use machine learning to train the robot in simulation and this means i need to run the motion planner code in a ROS2 node, this is currently running on the Teensy.

There's a considerable amount of things like analogue sensors, SPI, i2c and serial interfaces that wont move across, the code I want to be shared is absolute coordinate and IK-based motion planner logic.

I could rewrite the code or patch a version of it to work as standard c++ but then I'd be manually maintaining 2 sets of code - does anyone have any tips of how i could share code between a c++ ROS2 node and the embedded C code I run on the teensy?

I'd thought if having heaps of compiler defines and `ifdef` for things like memory releasing etc but I can't help but think this may be a solved problem.

Thanks!
 
Back
Top