Help a isloated and helpless learner in tf
Hi,everybody I'm a chinese student,because of the greatwall firewall,I can not get enough and explicit documentations except for wiki.ros.I'm so sorry to interrupt you for asking these silly questions,if you would share your valuable time to dispel my doubts,I am deeply grateful. Here are the baffle puzzled me: 1.what is the "lookupTransform" method below,what type of date does it return? I can not find any descriptions against it. 2.I'm fairly puzzled with traslation and transformation,they belong to the same description in chinese.And i get trouble with euler and quaternion,I don't understand what the arguments x,y,z,w refer to,I'm hoping for a nice boy to solve my problems,if you'd like to introduce more msg in ros detailed,nice of you!!!!^_^
The following is the unsolved code:
listener = tf.TransformListener()
rospy.wait_for_service('spawn')
spawner = rospy.ServiceProxy('spawn', turtlesim.srv.Spawn)
spawner(4, 2, 0, 'turtle2')
turtle_vel = rospy.Publisher('turtle2/cmd_vel', geometry_msgs.msg.Twist,queue_size=1)
rate = rospy.Rate(10.0)
while not rospy.is_shutdown():
try:
(trans,rot) = listener.lookupTransform('/turtle2', '/turtle1', rospy.Time(0))
except (tf.LookupException, tf.ConnectivityException, tf.ExtrapolationException):
continue
angular = 4 * math.atan2(trans[1], trans[0])
linear = 0.5 * math.sqrt(trans[0] ** 2 + trans[1] ** 2)
cmd = geometry_msgs.msg.Twist()
cmd.linear.x = linear
cmd.angular.z = angular
turtle_vel.publish(cmd)
rate.sleep()