rosflight / rosflight_ros_pkgs

ROS packages for the ROSflight autopilot
http://rosflight.org/
BSD 3-Clause "New" or "Revised" License
86 stars 56 forks source link

Cleanly abstract ROS from mavrosflight #131

Closed superjax closed 5 months ago

superjax commented 4 years ago

(This is in preparation for a port to ROS 2)

bsutherland333 commented 8 months ago

This is kind of a tricky issue. When I went about updating the ROSflight repository to ROS2, I found that the template abstractions as they were designed did not fit the ROS 2 API very well due to how ROS 2 handles execution.

The thing that was giving me difficulty was that I couldn't find a good way to get the timer callbacks to actually be called, as all timers and callbacks would need to be created before the node was passed off to the ROS 2 executor, or the timer would exist but never execute callbacks. I don't remember all of the details as to why it wasn't working, but I do know I spent quite a bit of time on it.

I eventually started questioning the necessity for this abstraction and after deciding that the abstractions would need some redesign anyways to work well with ROS 2, and ended up just removing them.

It may be worthwhile re-implementing this as decoupling ROS from mavrosflight would make mavrosflight much more transferable, but it does add more complexity to the mavrosflight code base. I may just leave this issue open for now in case we decide that this is worthwhile to re-implement, but I don't think we have any immediate need for it.