ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A
Ask Your Question

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){

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

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

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


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

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

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

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

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

It works! Thanks.

AzureViolin gravatar imageAzureViolin ( 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

Question Tools


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

Seen: 793 times

Last updated: Mar 13 '12