[ros-users] Help with subscriber error

Bhaskara Marthi bhaskara at willowgarage.com
Mon Apr 5 21:06:07 UTC 2010


Hi Nate, can you check that your callback has signature
void tCallback (const std_msgs::Float32::ConstPtr& m);
(as opposed to just taking in a Float32)

- Bhaskara

On Mon, Apr 5, 2010 at 2:00 PM, Nate R <throwawaynate2009 at gmail.com> wrote:

> Hi,
>
> I am having a small issue with subscribing to a topic. I wrote a lot of my
> code on an older install of ROS, and I've since decided to install my
> package on a 'backup' laptop. Everything compiles and runs fine on the
> original, but when I try to compile on the backup laptop I get these errors
> about my subscribers:
>
> error: no matching function for call to ‘ros::NodeHandle::subscribe(const
> char [15], int, void (&)(std_msgs::Float32))’
> /home/ttu/ros/ros/core/roscpp/include/ros/node_handle.h:504: note:
> candidates are: ros::Subscriber
> ros::NodeHandle::subscribe(ros::SubscribeOptions&)
>
> That error comes from the line of code:
> tSubscriber = tHandle.subscribe("TurnAngle", 1, tCallback);
>
> Could someone please help me figure out why this is happening. I have
> verified that the syntax is correct, and it compiles fine on an older svn
> build of ROS.
>
> I am having the compile problem on a svn build of ROS from today. Also,
> there are other executables in the package that have the same subscribe
> syntax, but they compile just fine.
>
> Thanks,
> Nate
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>


-- 
Bhaskara Marthi
Research Scientist
Willow Garage Inc.
650-475-2856
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100405/4ce85558/attachment-0003.html>


More information about the ros-users mailing list