Implement direct kinematics for a 6DOF arm - LCAS/RBT1001 GitHub Wiki
Arm with spherical wrist
:arrow_forward: :desktop_computer: 1. In the editor, open the file RBT1001/src/week4/direct_kinematics.py
. This is an uncomplete code for a ROS Node that computes the forward kinematics for the arm.
:arrow_forward: :technologist: 2. Based on the series of homogeneous transformations that you have found in the previous task, complete the code. Find all the places where there is a ### TODO
and add your code in there.
- :exclamation: We will use the Numpy (numerical python) library for computing the following values:
- cos:
np.cos(...)
- sin:
np.sin(...)
- pi:
np.pi(...)
- cos:
- :exclamation: Note that the matrix multiplication (dot product) between numpy matrices can be obtained using the
@
operator, e.g.
self.HR('z', np.pi/2) @ self.HR('y', np.pi/2)
Once you have finished it's time to test it!
:arrow_forward: :desktop_computer: 3. Launch the visualiser for the same robot with ros2 launch week3 view_robot.launch.py description_file:=mecharm_270_m5.urdf.xacro
:exclamation: You can reduce the dimension of the reference frames by setting the "Marker Scale" to 0.5 in the left bar options under TF.
:arrow_forward: :desktop_computer: 4. In a different terminal, launch your script: python3 src/week4/direct_kinematics.py
:arrow_forward: :desktop_computer: 5. In an adjacent terminal, launch the ROS TF echo functionality which automatically computes the transformation: ros2 run tf2_ros tf2_echo base link6
. :exclamation: If your transformation is correct, you should see the same matrix - randomize the joints positions to check if the transformation is always accurate.