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

Revision history [back]

click to hide/show revision 1
initial version

Just a syntax comment -- listener.waitForTransform("/Pioneer3AT/map", "Pioneer3AT/base_link", rospy.Time(), rospy.Duration(4.0) should instead have rospy.Time.now(), not rospy.Time(). The time argument passed to waitForTransform() says "I want a transform at the time I'm passing, wait the following duration to get it."

In the past I've had this same issue (i.e, tf_echo works fine but I get told frame doesn't exist in my Python script) because the listener was not initialized soon enough before I asked for the transform. In my case it was telling me that the Kinect's 'camera_rgb_optical_frame` didn't exist, which was asinine. It might be worthwhile to call rospy.sleep(10.0) before lookupTransform(), just for debugging purposes.

Just a syntax comment -- listener.waitForTransform("/Pioneer3AT/map", "Pioneer3AT/base_link", rospy.Time(), rospy.Duration(4.0) should instead have rospy.Time.now(), not rospy.Time(). The time argument passed to waitForTransform() says "I want a transform at the time I'm passing, wait the following duration to get it."

In the past I've had this same issue (i.e, tf_echo works fine but I get told frame doesn't exist in my Python script) because the listener was not initialized soon enough before I asked for the transform. In my case it was telling me that the Kinect's 'camera_rgb_optical_frame` camera_rgb_optical_frame didn't exist, which was asinine. It might be worthwhile to call rospy.sleep(10.0) right before lookupTransform(), (trans, rot) = listener.lookupTransform("/Pioneer3AT/map", "/Pioneer3AT/base_link", rospy.Time(0)) , just for debugging purposes.