This toolbox provides a set of functions for modelling 3-D rigid motions including
Euler angles, rotation and homogeneous matrixes, quaternions and dual quaternions, and
axis/angle representations. Before using the toolbox, you should run the script:
that will temporarily fix your path to include all the required folders (you can otherwise
include the line above in your 'startup.m' Matlab's config file).
The toolbox currently features these blocks:
- quaternions, dual numbers, and dual quaternions algebra. Corresponding classes have
been programmed for each one using Matlab's object oriented interface, allowing
to use them in the same way real or complex numbers (or matrixes) are used. For
example, a 3xN matrix xyz comprising N 3-D column vectors can be translated to its
quaternion representation just by typing:
>> myquaternions = [ii,jj,kk]*xyz; % 1xN array of quaternions
Or you can compute the rotation angle they represent as:
Or you can compute their squares or compare them:
>> myquaternions.*myquaternions == myquaternions.^2
- Conversions between the different representations of 3-D rotations (quaternions,
Euler angles with different conventions, axis/angle, rotation matrixes) and 3-D
rigid motions (homogeneous matrixes, dual quaternions), back and forth. All the
related functions are meant to work over N-dimensional arrays, so that you can
convert, for example, 8x7x6 quaternions to their corresponding rotation matrixes
(returned in a 3x3x8x7x6 array) with just one call to quat2rot.
- Robot kinematics. This toolbox is meant to analyze any kind of generic serial robot
described by just its Denavit-Hartenberg parameters (i.e. a Gx4 table, with G the
number of d.o.f. of the robot). The capabilities of the toolbox include:
+ analysis of forward kinematics, i.e., determining the position of the end
effector (as either a homogeneous matrix or a dual quaternion) as a function
of joint variables.
+ analysis of velocity kinematics, i.e., determining the Jacobian matrix that
linearly relates joint velocities with end effector velocities.
+ analysis of inverse kinematics, i.e., determining the joint values needed to
recover a desired position and orientation of the end effector (given as
either a known dual quaternion or a known homogeneous matrix). Since the
toolbox is intended for a generic robot, the approach has to be numeric (we
use a Newton-Raphson solver based on the Jacobian matrix).
- Robot dynamics. This works also for any generic serial robot, as long as the D-H
table and, of course, mass geometry parameters (masses, mass centers, inertia
moments) are known. The capabilities of the toolbox include:
+ Newton-Euler recursive dynamics, i.e. finding forces and torques at each
joint from known kinematics.
+ Lagrange-Euler dynamics, i.e. matrix relations between generalized forces
and d.o.f. positions, velocities, and accelerations.
+ A simple ad-hoc solver for forward dynamics, i.e., computing positions,
velocities and accelerations from known forces and torques of the actuators.
The aim when designing this code was mainly to provide an intuitive and flexible
interface to work with different representations of rigid motions. This means the
software is not particularly optimized for performance/execution speed. However, an
effort has been made to take advantage of Matlab's efficiency in matrix computations.
AUTHOR: Antonio Tristan-Vega (email@example.com)
Dept. Mechanical Engineering,
University of Valladolid (Spain)
Feel free to contact the author to report bugs or in case you miss some obvious functionality.
See also: https://es.mathworks.com/matlabcentral/fileexchange/61955-spongebob-squarepants-goes-3-d
Antonio Tristán Vega (2021). Rigid motions and robotics toolbox (https://www.mathworks.com/matlabcentral/fileexchange/56758-rigid-motions-and-robotics-toolbox), MATLAB Central File Exchange. Retrieved .
Inspired: Robotics DQ Toolbox
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!