Twist Message
The twist message is based on the screw interpretation of a velocity state. A screw being a 6-dimensional vector that can describe translational and rotational motion in a rather elegant form. A screw was first defined by Robert Ball in 1900 [1] . As this is not a class on Screws we will not go into great detail, if you are interested in more check out the class EML 6282 - Robot Geometry 2 taught by Dr. Crane usually in the Spring semester. Dr. Crane, Dr. Griffis and Dr. Duffy (The formers mentor) wrote a book [2] on screw theory if you are interested
The twist message defines a set of six variables. Usually a twist is written as
where \(\dot{x}\) … is the linear velocity and \(\dot{\phi_x}\)… is the angular velocity. In our case for our car, we will only have a \(\dot{x}\) linear velocity and \(\dot{\phi_z}\) angular velocity or yaw rate. The rest of them will be 0. In code you can define such a message as follows.
Twist().linear.x = linear_velocity_x
Twist().linear.y = linear_velocity_y
Twist().linear.z = linear_velocity_z
Twist().angular.x = angular_velocity_x
Twist().angular.y = angular_velocity_y
Twist().angular.z = angular_velocity_z
The twist message is one of the most used messages for us, as it transmits motion messages between our computer and our motor controller node. In simulation this will also be the only message that one can use to convey motion.