ROS包编译错误一例“ return m.__getMD5Sum().c_str();”

来源:互联网 发布:淘宝转运日本 编辑:程序博客网 时间:2024/06/04 20:13

/opt/ros/indigo/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::MD5Sum::value(const M&) [with M = unsigned char]’:
/opt/ros/indigo/include/ros/message_traits.h:255:104: required from ‘const char* ros::message_traits::md5sum(const M&) [with M = unsigned char]’
/opt/ros/indigo/include/ros/publisher.h:112:7: required from ‘void ros::Publisher::publish(const M&) const [with M = unsigned char]’
/home/aicrobo/catkin_ws/src/aic_follow_strategy/src/Follow_Strategy.cpp:45:48: required from here
/opt/ros/indigo/include/ros/message_traits.h:126:34: error: request for member ‘__getMD5Sum’ in ‘m’, which is of non-class type ‘const unsigned char’
return m.__getMD5Sum().c_str();
^
/opt/ros/indigo/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::DataType::value(const M&) [with M = unsigned char]’:
/opt/ros/indigo/include/ros/message_traits.h:264:106: required from ‘const char* ros::message_traits::datatype(const M&) [with M = unsigned char]’
/opt/ros/indigo/include/ros/publisher.h:112:7: required from ‘void ros::Publisher::publish(const M&) const [with M = unsigned char]’
/home/aicrobo/catkin_ws/src/aic_follow_strategy/src/Follow_Strategy.cpp:45:48: required from here
/opt/ros/indigo/include/ros/message_traits.h:143:36: error: request for member ‘__getDataType’ in ‘m’, which is of non-class type ‘const unsigned char’
return m.__getDataType().c_str();

出现这个问题,首先检查一下所有pub出去的数据类型是否正确!!!