Jeff Gensler
1 min readOct 14, 2021

--

Hey Mark,

It has been some time since I worked on this project so hopefully I can remember the moving parts. The job of the HWInterface is to issue synchronous commands to/from hardware interfaces. In my testing, this would be like writing the value 180 to a servo (or writing a x rotations per second to a continuous joint). I don't think that you'll be able to subscribe/publish anywhere in the HWInterface. Instead, you may end up needing ROS2 Services for communication or integrating with other components. I think I used something of the sort where a separate Python Service would write to a servo over serial.

"Write" ROS Service calls could be placed inside of the HWInterface in the `write` method: https://github.com/jgensler8/my_rotate_bot/blob/main/src/my_rotate_bot_hardware.cpp#L187

a similar pattern could be used for read.

I believe that there aren't Service abstractions because the controller needs to read/write on the order of milliseconds or less (I think I saw 60hz in one config) and not seconds (which is what network calls could possibly take).

--

--

No responses yet