tl;dr: How can I send a 6 DOF robot arm a "move to (x, y, z, roll, pitch, yaw)" command using ROS MoveIt?
I'm trying to control a Universal Robots UR5 6-degree-of-freedom robot arm with ROS and MoveIt, using the Python Move Group Interface. I'm missing the fundamental "how to send robot end effector to this point" control. I'm interpreting "end effector" as the "hand" of the robot on the very end. Intuitively, I want to make the end effector move using something like:
pose_goal.position.x = x_coordinate # x, y, z, r, p, y are in a fixed reference frame
pose_goal.position.y = y_coordinate
pose_goal.position.z = z_coordinate
pose_goal.orientation.roll = roll_angle
pose_goal.orientation.pitch = pitch_angle
pose_goal.orientation.yaw = yaw_angle
move_group.set_pose_target(pose_goal)
plan = move_group.go(wait=True)
But, the geometry_msgs.msg.Pose() object wants a quaternion in the format (x, y, z, w).
Some things I have done / researched:
- Got ROS talking to and moving the robot through the Move Group Python Interface
- General understanding of what a quaternion is
- ROS documentation on quaternions
- What's a Quaternion Rotation (Stack Overflow)
Some other info:
- Running ROS Melodic on Ubuntu 18.04
- Simulating UR5 robot arm in RViz and Gazebo but also have the physical arm
Questions
- My research says that a quaternion of form (x, y, z, w) describes rotation in 3D space only. How does the robot know what position to move to if it only gets rotation information?
- Can I convert from (x, y, z, roll, pitch, yaw) to quaternion? Or do those describe two different things?
- Do quaternions have to be normalized so that the sum of squares equals one? If so, how can I tell my robot arm to go to a physical point in space like (0.5m, 0.3m, 0m)?
- Can someone provide a layman's terms explanation of describing rotation (3D) with a quaternion (4D)?