ROS2 control Humble hardware interface
Hi I have been on a 2 week steep slippery slope crash course on Ros2 Humble. I've been following John Newans on YouTube but he uses Foxy and I have started with Humble which seems to have some subtle differences 😞
My sticking point is ros2 control hardware interfaces. I'm trying to connect to the Hoverboard Firmware mod by Alex Makarov.
The Humble hardware interface seems to have a read() and write() methods which doesn't quite work with the hoverboard firmware that send odometer data at a fixed rate and waits for commands.
I think what I need is a middle task to sit listening to the hoverboard, then when a hardware interface read() occurs it retuns the data since the last read and when a write() occurs it saves the data in a temporary buffer to be sent to the hoverboard at the next opportunity.
My problem is I don't know where to put that middle code??? It must go int the hardware interface somewhere and presumably must call back back to ros????? I'm more of a C coder than C++ which doesnt help 😀
If someone could help I'd be most grateful, thank-you.
My robot hardware is sat waiting for some control 😞
Andrew
Asked by Rekabuk on 2022-10-29 06:39:49 UTC
Comments
Can I just use pthread_create in ::on_activate() to create my new thread then delete it in ::on_deactivate(). The new thread can then just block on reading the serial stream from the hoverboard firmware. Andrew
Asked by Rekabuk on 2022-10-29 16:17:32 UTC
Does anyone have any ideas? 😞
Asked by Rekabuk on 2022-10-31 07:04:51 UTC