How to check that message exists with catkin for conditional compilation (sensor_msgs/BatteryState)
Hello, i want to add support for new message but i need some "how to" on detecting available messages with catkin.
I'm thinking to use cmake execute_process() for that. Some thing like that:
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "from sensor_msgs.msg import BatteryState"
RESULT_VARIABLE BATTERY_STATE_RESULT
)
But maybe catkin already has some macro for that task?
An alternative way would be to use something like
rosmsg show sensor_msgs/BatteryState
. Also there seems to be generated variables of the form<package_name>_MESSAGE_FILES
which are the lists of paths. However, to get it you probably have tofind_package
first.