Ask Your Question
0

how to fix ros:Message error?

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

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 -0500

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 ( 2012-03-14 20:41:25 -0500 )edit
1

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

dornhege ( 2012-03-14 22:57:31 -0500 )edit
1

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

AzureViolin ( 2012-03-19 23:02:16 -0500 )edit

It works! Thanks.

AzureViolin ( 2012-03-19 23:02:18 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Stats

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

Seen: 316 times

Last updated: Mar 13 '12