The DnR toolkit is based on Robotics2Tools by MoSamArafat. It includes useful scripts for the midterm / exam of Robotics 2.
Here are written the standards of the toolbox.
In case you don't understand some terminology of the toolbox, you may find (and also request) explanation here:
- rci : position wrt RFi of a link's CoM
- roc : position wrt RF0 of a link's CoM
The Toolkit uses the standard convention presented during lectures of Robotics1 and Robotics2:
alpha | d | a | theta |
---|---|---|---|
... | ... | ... | ... |
In order to build the table, let's see how one row generates a new frame RF1 from RF0:
KEEP IN MIND that you need to use the right hand rule to generate the first frame, then I suggest thinking at how you wish to place the next frame, and then build up a chain of rototranslations that can get you there. The 4 parameters of the table lets you play with this rototranslation in the following way:
- Take RF1 and place it with the same orientation on RF0 position
- Move RF1 on z0 axis by d, then apply a counter clockwise rotation by theta on RF1 from z0
- Move RF1 on x1 axis by a, then apply a counter clockwise rotation by alpha on RF1 from x1
Remember that only x and z axis are used during the rototranslation, and that (d, theta) are applied onto z0 while (a, alpha) are applied on x1.
Here the functions are briefly described
- h2r : Extracts the rotation matrix from a given homogeneous transformation matrix
- h2tr : Extracts the rotation matrix AND the offset vector from a given h.trasformation matrix
- dh_step : Compute a single link transformation, given a DH parameter row
- dh_transform_m : Compute the h.transformation matrix given the DH table, a source joint and a destination joint
- compute_roc : Compute the RoC vector given the DH table and a link index
- kr_task_dls : Computes the joint commands to complete a task r through DLS (Dampened Least Squares) method
- kr_task_pg : Computes the joint commands to complete a task r through PG (Projected Gradient) method
- kr_task_rg : Computes the joint commands to complete a task r through RG (Reduced Gradient) method
- kr_task_sns : Computes the joint commands to complete a task r through SNS (Saturation of Null-Space) method
- kr_task_wpinv : Computes the joint commands to complete a task r through Weighed PseudoInverse method
- compute_sym_m : Computes the Symbolic Inertia matrix M(q, q_dot)
- compute_num_m : Computes the Numerical Inertia matrix M(q, q_dot) through the Euler-Newton method.
- compute_christoffel : Computes the coriolis/centrifugal factorization through christoffel symbols
- compute_gravity : Compute the gravity vector for the arm
Parametric scripts used to compute robot dynamic models.
- planar_robot : Dynamic model for a generic planar robot.
- spatial_robot : Dynamic model for a generic spatial robot.
Some examples are also provided on operativity of the toolbox:
- planar_2r : Dynamic model for 2R planar robot.
- planar_prp : Dynamic model for PRP planar robot.
- planar_pprr : Dynamic model for PPRR planar robot.
- spatial_3r : Dynamic model for 3R spatial robot.
A simple matlab livescript (out_display.mlx) can be used to visualize functions output in a fancy way. Have fun!