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

Callback doen't respond

asked 2017-09-12 13:18:39 -0500

Younès gravatar image

I have the following node :

    def set_set_goal_pose_callback(pose,em):
        print "i am here", pose.pose.position.x
    def listener()
        em=ratslam.experience_map_younes.ExperienceMap()
        sub_goal=rospy.Subscriber("/ExperienceMap/RobotPose",PoseStamped,set_goal_pose_callback,em)
        rospy.spin()

   if __name__=='__main__':
        rospy.init_node("RatSLAMExperienceMap')
        listener()

When I execute the node, the function set_goal_pose_callback isn't called. What could I do?

edit retag flag offensive close merge delete

Comments

Are you sure that you are publishing something to that topic elsewhere?

amstrudy gravatar image amstrudy  ( 2017-09-12 13:26:25 -0500 )edit

No I don't publish any thing on that topic

Younès gravatar image Younès  ( 2017-09-12 13:30:17 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2017-09-12 14:29:59 -0500

jayess gravatar image

If nothing is published on that topic then that callback won't be executed. You need to publish information on that topic.

edit flag offensive delete link more

Comments

@Younès: if this solved your problem, please click the check mark to mark it as correct.

jayess gravatar image jayess  ( 2017-09-15 16:46:55 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2017-09-12 13:18:39 -0500

Seen: 227 times

Last updated: Sep 12 '17