ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
4

differential_drive compilation error: request for member ‘__getMD5Sum’ in ‘m’, which is of non-class type ‘const int’

asked 2013-07-29 01:48:17 -0500

updated 2013-07-29 10:42:22 -0500

Hi guys,

I'm trying to follow this tutorial:

http://www.ros.org/wiki/differential_drive

but when I compile it I get the following error:

/opt/ros/groovy/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::MD5Sum<M>::value(const M&) [with M = int]’:
  /opt/ros/groovy/include/ros/message_traits.h:255:104:   instantiated from ‘const char* ros::message_traits::md5sum(const M&) [with M = int]’
  /opt/ros/groovy/include/ros/publisher.h:112:7:   instantiated from ‘void ros::Publisher::publish(const M&) const [with M = int]’
  /home/d4n/sdc2130/src/auto.cpp:204:29:   instantiated from here
  /opt/ros/groovy/include/ros/message_traits.h:126:34: error: request for member ‘__getMD5Sum’ in ‘m’, which is of non-class type ‘const int’
  /opt/ros/groovy/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::DataType<M>::value(const M&) [with M = int]’:
  /opt/ros/groovy/include/ros/message_traits.h:264:106:   instantiated from ‘const char* ros::message_traits::datatype(const M&) [with M = int]’
  /opt/ros/groovy/include/ros/publisher.h:112:7:   instantiated from ‘void ros::Publisher::publish(const M&) const [with M = int]’
  /home/d4n/sdc2130/src/auto.cpp:204:29:   instantiated from here
  /opt/ros/groovy/include/ros/message_traits.h:143:36: error: request for member ‘__getDataType’ in ‘m’, which is of non-class type ‘const int’
  /opt/ros/groovy/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::MD5Sum<M>::value(const M&) [with M = int]’:
  /opt/ros/groovy/include/ros/message_traits.h:127:3: warning: control reaches end of non-void function [-Wreturn-type]
  /opt/ros/groovy/include/ros/message_traits.h: In static member function ‘static const char* ros::message_traits::DataType<M>::value(const M&) [with M = int]’:
  /opt/ros/groovy/include/ros/message_traits.h:144:3: warning: control reaches end of non-void function [-Wreturn-type]
  make[2]: *** [CMakeFiles/sdc2130.dir/src/auto.cpp.o] Error 1
  make[1]: *** [CMakeFiles/sdc2130.dir/all] Error 2

the line that give me the error is:

rwheel_pub.publish(absenc2);

someone tell that could be an error from the different format type of the variable, could someone help me a little more?

thanks guys

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2013-10-25 03:59:51 -0500

Michael.Camilleri gravatar image

is absenc2 an int or an std_msgs::Int8. It should be the latter

edit flag offensive delete link more

Comments

1

a more detailled answer :

std_msgs::Int8 absenc2;
absenc2.data=0;
rwheel_pub.publish(absenc2);
aymar111 gravatar image aymar111  ( 2017-01-04 05:24:34 -0500 )edit

I find on some systems I can compile int val=8; pub.publish(val) and other times I can't and get the md5sum error and have to make the message and assign the value to data, as if different compile options are being used in either case.

lucasw gravatar image lucasw  ( 2018-03-23 16:17:48 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2013-07-29 01:48:17 -0500

Seen: 4,740 times

Last updated: Oct 25 '13