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

# something about sendtransform, quaternion and euler

Hi,you, I'm a clown boy and the following params puzzled me,can you make a description for me? My questions are: first:I don't understand "the translation of the transformtion as a tuple (x, y, z)",It seems that translation is equal to transformtion,they has same means unexpectedly! And what do "msg.x" , "msg.y" and "0" actually mean in robot pose? Can i comprehend like this:msg.x and msg.y are Coordinate value where 0 means z=0?

second:param rotation: the rotation of the transformation as a tuple (x, y, z, w),what does (0, 0, msg.theta) mean in robot pose?And what are the relations between rotation and translation?

sendTransform((msg.x,msg.y,0),
tf.transformations.quaternion_from_euler(0, 0, msg.theta),
rospy.Time.now(),
turtlename,
"world")

edit retag close merge delete

Sort by ยป oldest newest most voted

You didn't, but should've provided a link to the source of the code you show. I believe it came from the Writing a tf broadcaster in Python.

Translation, in this context, refers to linear movement through space. Transformation refers to the conversion of a position in 3d space (location and orientation) between frames of reference. A transform in ROS represents the position of an object in 3d space at a specific time between two specific frames of reference.

In the case you cite, a fixed elevation (z location coordinate) is given, which happens to be 0. Also, only the theta value (i.e., yaw, rotation around the Z axis) of the Euler orientation changes -- the pitch and roll (rotation around the Y and X axes, respectively) are fixed at 0.

Putting that all together, as the turtle moves in its own frame of reference (i.e., turtlename), its (x,y) location and theta orientation changes (in 2d space on the plane with z=0) relative to the world frame of reference. The sendTransform method enters that information into ROS's TF system with an assigned timestamp.

more