ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
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.
2 | No.2 Revision |
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.