How to create rviz display plugin for msg without header?
Hi,
I'm developing custom rviz display plugin, according to the ImuDisplay tutorial.
But when I changed sensor_msgs::Imu
to my custom msg, build failed because my custom msg doesn't have header.
How to create rviz display plugin for msg without header?
I changed
rviz::MessageFilterDisplay<sensor_msgs::Imu>
to
rviz::MessageFilterDisplay<mu_custom_msg>
Build error log
In file included from /opt/ros/kinetic/include/rviz/message_filter_display.h:41:0,
from /home/myname/catkin_ws/src/my_rviz_plugins/src/imu_display.h:36,
from /home/myname/catkin_ws/src/my_rviz_plugins/src/imu_display.cpp:43: /opt/ros/kinetic/include/rviz/frame_manager.h: In instantiation of ‘void rviz::FrameManager::messageCallback(const ros::MessageEvent<const M>&, rviz::Display*) [with M = my_custom_msg_<std::allocator<void>
>]’: /opt/ros/kinetic/include/rviz/frame_manager.h:176:41: required from ‘void rviz::FrameManager::registerFilterForTransformStatusCheck(tf::MessageFilter<M>*, rviz::Display*) [with M = my_custom_msg_<std::allocator<void>
>]’ /opt/ros/kinetic/include/rviz/message_filter_display.h:106:7: required from ‘void rviz::MessageFilterDisplay<MessageType>::onInitialize() [with MessageType = my_custom_msg_<std::allocator<void>
>]’ /home/myname/catkin_ws/src/my_rviz_plugins/src/imu_display.cpp:80:13: required from here /opt/ros/kinetic/include/rviz/frame_manager.h:217:5: error: ‘const struct my_custom_msg_<std::allocator<void>
>’ has no member named ‘header’
messageArrived(msg->header.frame_id, msg->header.stamp, authority, display);
^ /opt/ros/kinetic/include/rviz/frame_manager.h:217:5: error: ‘const struct my_custom_msg_<std::allocator<void>
>’ has no member named ‘header’
Thanks,
this is certainly possible, but: what is your plugin actually doing? If it is going to render your message in the 3D visualisation of RViz, how would you know where to place the object(s) if you have no TF data (ie: no
frame_id
)?Thank you. Actually, my custom msg is like this,
my_custom_msgs/Arrows.msg
my_custom_msgs/Arrow.msg
So, each Arrow.msg can be placed in 3D space, but I want to display them together by Arrows.msg.