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

how to fix ros:Message error?

asked 2012-03-12 22:22:00 -0600

I try to run Minority Report Interface in MIT Kinect Demos, and when I rosmake kgui, I got this error:

/kgui/src/RosGlobals.h:293:21: error: ‘Message’ in namespace ‘ros’ does not name a type

and I checked RosGlobals.h, it says(start from Row 293):

 void Publish(const ros::Message&_msg){
      if(connected)
                    gf->publish(topic,(void*)&_msg);
    }

I did a little search and find this might be the difference between diamondback and electric, does anybody know how to solve this?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2012-03-13 07:07:17 -0600

dornhege gravatar image

Is using diamondback an option or are you looking for something more long-term.

If it is just that piece of code, you could template over the Message. That should work here. Alternately pass in a void* and change the calling code.

edit flag offensive delete link more

Comments

I'm not sure how to " template over the Message". would you be more specific please? I acutally met the same problem wen try to build motion_planning_rviz_plugin in ROS electric. Would really appreciate the help here.

AzureViolin gravatar image AzureViolin  ( 2012-03-14 20:41:25 -0600 )edit
1

Make the Publish function a templated function, e.g. over <template typename T> and replace ros::Message with T.

dornhege gravatar image dornhege  ( 2012-03-14 22:57:31 -0600 )edit
1

Finally, I get it work! Thanks. just insert "template typename rosMessage", then replace the "ros::Message" with "rosMessage" in line 293.

AzureViolin gravatar image AzureViolin  ( 2012-03-19 23:02:16 -0600 )edit

It works! Thanks.

AzureViolin gravatar image AzureViolin  ( 2012-03-19 23:02:18 -0600 )edit

Question Tools

Stats

Asked: 2012-03-12 22:22:00 -0600

Seen: 1,384 times

Last updated: Mar 13 '12