I run `tf tf_echo /Pioneer3AT/map /Pioneer3AT/base_link` and compute exact data needed (so far so good):
...
At time 1407419581.729
- Translation: [-8.999, -22.000, 0.000]
- Rotation: in Quaternion [-0.000, 0.000, 0.850. 0.526]
in RPY [0.000. -0.000, 2.034]
...
I set up the following listener:
import roslib
import rospy
import tf
import sys, traceback
from nav_msgs.msg import Odometry
if __name__ == '__main__':
rospy.init_node('tf_P3AT')
listener = tf.TransformListener()
rate = rospy.Rate(10.0)
while not rospy.is_shutdown():
try:
now = rospy.Time(0)
(trans, rot) = listener.lookupTransform("/Pioneer3AT/map", "/Pioneer3AT/base_link", now)
except: (tf.LookupException, tf.ConnectivityException):
continue
print 'translation: ',trans
print 'rotation: ', rot
rate.sleep()
Prints out the correct data as above.
Next step: I would like to record this transform with rosbag.
Is this just a matter of publishing this data within my listener file, then running `rostopic echo`, then running `rosbag record`? Thanks for reading this.
↧