get the message definition in c++
Hi everyone,
i would like to get the ros message defintion file as a string in c++. Similar to how it is done in python ...
Where I just have to call:
rosmsg.get_msg_text("sensor_msgs/Joy")
and get the following output:
std_msgs/Header header
uint32 seq
time stamp
string frame_id
float32[] axes
int32[] buttons
The message type is not known before compile time ... Thus, everything I have is a string in the following format
std::string strType = "sensor_msgs/Joy"; // or something else like = "std_msgs/String" ...
so i need a method or a function which takes in a string, defining the package and the message type ... and want to get out a string with the complete message definition ...
But like it is done in python, not only the content of sensor_msgs/msg/Joy.msg, which is:
Header header # timestamp in the header is the time the data is received
float32[] axes # the axes measurements from a joystick
int32[] buttons # the buttons measurements from a joystick
I need the extracted format of all nested message definitions like presented in the first example ...
I think this is also possible somehow in roscpp, but I could not figure it out yet, thanks for any suggestions ...
Cheers ...