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

error: ‘__s_getMD5Sum’ is not a member

asked 2011-10-04 13:46:14 -0600

130s gravatar image

updated 2011-10-05 05:18:38 -0600

I keep getting this error while porting old code to adjust to the current ROS. Any idea to workaround would be appreciated. Let me notice that I'm not that familiar with boost::bind yet, and I'm asking at this forum because I wonder if this is either bind question, ROS' or else.

Extracted code:

class CS {
 private:
    ros::NodeHandle *ros_node_;
    void bvmHandler(void *flag) {
        *(bool *) flag = true;
    }
    void funcB() {
        ros_node_->subscribe("topic", //
          1000, //
          &CS::bvmHandler, //     <----- line #431
          this);
    }
};

Error:

CS.cpp:431:   instantiated from here
/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp_traits/include/ros/message_traits.h:121: error: ‘__s_getMD5Sum’ is not a member of ‘void*’

Environment: Ubuntu 10.10, ROS Electric


Update 10/5/2011) Thanks to @Eric Perko, I modified the code to workaround (at least compile moves on to the next phase):

#include "std_msgs/Bool.h"
void bvmHandler(std_msgs::BoolConstPtr *flag)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2011-10-04 14:09:26 -0600

Eric Perko gravatar image

updated 2011-10-05 16:58:16 -0600

Take a look at the roscpp::NodeHandle docs for the subscribe method. These valid signatures are also included on the wiki. None of those look like they will work with a function that takes a void* argument. All seem to require a function or method that takes a ros message either by value or shared_ptr.

Note that your callback function should take some type of ROS message, not a void*. Changing CS::bvmHandler to something like CS::bvmHandler(std_msgs::Bool::Ptr flag) would probably compile (once you fix up the function body logic for the new flag type), since it gives the compiler enough hints about which subscribe template to pick and instantiate.

edit flag offensive delete link more

Comments

There's a list of valid callback signatures on the wiki at http://www.ros.org/wiki/roscpp/Overview/Publishers%20and%20Subscribers#Callback_Signature
tfoote gravatar image tfoote  ( 2011-10-04 17:30:42 -0600 )edit
Thanks. Your link didn't open itself. This should work http://goo.gl/Dqmxm
130s gravatar image 130s  ( 2011-10-05 04:58:54 -0600 )edit
Added the list of signatures on the wiki to my answer.
Eric Perko gravatar image Eric Perko  ( 2011-10-05 16:58:47 -0600 )edit

Question Tools

Stats

Asked: 2011-10-04 13:46:14 -0600

Seen: 5,489 times

Last updated: Oct 05 '11