On Mon, Oct 25, 2010 at 10:32 AM, Patrick Bouffard < bouffard@eecs.berkeley.edu> wrote: > Thanks Josh. I did try a lot of versions of the callback declaration > and the getMessage line, taking away that const for instance but still > could not get it to work. What still puzzles me is that my code is > basically copy & paste from the documentation page that I cited, the > only difference being the message type is control_mode_status (my own > message type) and not std_msgs::String as in the example in the docs. > > You have two sets of errors there, one of which is unrelated to the MessageEvent. Did you maybe fix one problem but not the other? And, just to be sure, did you try: const control_mode_statusConstPtr& msg = event.getMessage(); ? In a quick test, both: void chatterCallback(const ros::MessageEvent& evt) { const std_msgs::StringConstPtr msg = evt.getMessage(); ROS_INFO("I heard: [%s]", msg->data.c_str()); } and void chatterCallback(const ros::MessageEvent& evt) { const std_msgs::StringPtr msg = evt.getMessage(); ROS_INFO("I heard: [%s]", msg->data.c_str()); } work fine. Josh