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

Subscription of pose is not properly subscribed

asked 2011-12-24 06:51:47 -0500

alfa_80 gravatar image

updated 2011-12-25 01:30:05 -0500

joq gravatar image

I have a publisher node that publishes a pose message. I have check via rostopic echo -c /topic and it is there the pose message. There is another node (subscriber) that subscribes to the publisher node via callback member function. The weird thing I am currently facing is the subscriber node is node able to subscribe to the message that being published. The subscriber node is not only not being able to subscribe to the message, but also, it could not send a signal that the function is ever called like below:

void PointCloudBuilder::poseLDCallback(const geometry_msgs::PoseStampedConstPtr& poseLD_ptr)
{
    ROS_INFO("I heard something");
}

I have also tried to publish the message in the publisher node using Pose type instead of PoseStamped and changed accordingly in the input parameter from the callback subscriber member function, however, nothing is fixed.

I am pretty sure that it is not well subscribed because I have seen the output from rxconsole and previously I have been doing to subscribe to pose2D type, and it was working well, and could see the correct output from rxconsole.

Any idea what actually went wrong with this kind of strange behavior of my subscription.

Thanks in advance.

edit retag flag offensive close merge delete

Comments

I think more information is needed. Does `rxgraph` show those nodes connected for this topic? Might you somehow have stopped and then restarted `roscore` sometime during the test?
joq gravatar image joq  ( 2011-12-24 09:45:51 -0500 )edit
@joq: Thanks a lot for suggesting the right debugging way. That worked! I didn't realize that the topic name for the subscriber (a string) should match exactly the topic of interest being published.
alfa_80 gravatar image alfa_80  ( 2011-12-24 19:38:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2011-12-24 19:42:09 -0500

alfa_80 gravatar image

updated 2011-12-24 21:21:10 -0500

I didn't realize that the topic name for the subscriber (a string) has to match exactly the topic of interest being published. Previously, I thought only types of them have to be the same. When I analyze the thing in rxgraph, the topic of interest is never subscribed by any nodes. From there I started to think that the published and subscribed topic might have to be identical. And, after changing it, it worked. The credit should go to @joq for giving me a great hint to debug this issue.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2011-12-24 06:51:47 -0500

Seen: 571 times

Last updated: Dec 24 '11