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

Mavrosflight logger abstraction #137

Closed jbwillis closed 3 years ago

jbwillis commented 4 years ago

Part of #131. Abstract the use of ROS loggers out of mavrosflight.

Because you need to declare the type of a template class in the file where it is implemented, I added the USE_ROS and STANDALONE compiler macros which are checked in mavrosflight.cpp, time_manager.cpp, and param_manager.cpp. Not sure if this is the cleanest/best option.

Currently there is a warning: format not a string literal and no format arguments when this is built. This is because we are passing the format string into the logger as a variable. I think typically the compiler can trace const char* and figure out if there is an issue, but I think there is something in what I am doing that makes it unable to track down the use of the format string. If you have any suggestions on how to get rid of that warning, that'd be great.