Ask Your Question
0

Symbol 'subscribe' could not be resolved

asked 2012-11-28 03:03:04 -0500

Eisenhorn gravatar image

Hello,

I am trying to subscribe to a topic, namely nav_msgs::Odometry. subodom = nh_.subscribe<nav_msgs::odometry> ("RosAria/pose", 1, &SensorSonar::callback, this); Strangely I get this error message: Description Resource Path Location Type Symbol 'subscribe' could not be resolved libSENSOR.h /mmrprojekt/src line 79 Semantic Error

Just one line bellow I subscurbe to another Topic without any problem. sub = nh_.subscribe <sensor_msgs::pointcloud> ("/RosAria/sonar",1, &SensorSonar::callback, this);

Any ideas?

BR

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-11-28 03:25:53 -0500

Ben_S gravatar image

You are using the same callback for both subscribes. I would guess, that the parameter only fits one of those, so that the signature of the templated method does not match the given callback.

edit flag offensive delete link more

Comments

Arg yes I changed it shortly after writing this question. I was too blind :-) Thanks!

Eisenhorn gravatar imageEisenhorn ( 2012-11-29 07:23:35 -0500 )edit

Glad you solved it. Such errors are really annoying... :) Could you please accept my answer, so that its obvious, that the question is finished? Thanks!

Ben_S gravatar imageBen_S ( 2012-11-29 09:04:01 -0500 )edit

Ops sorry. I clicked the green checkbox to the left. Is that all I have to do? :-)

Eisenhorn gravatar imageEisenhorn ( 2012-12-05 01:09:42 -0500 )edit

Yes, thats it. :) Thanks

Ben_S gravatar imageBen_S ( 2012-12-05 01:37:37 -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

1 follower

Stats

Asked: 2012-11-28 03:03:04 -0500

Seen: 159 times

Last updated: Nov 28 '12