File Exchange

image thumbnail

Rigid motions and robotics toolbox

version 1.1 (493 KB) by Antonio Tristán Vega
3D rigid transforms and robotics with quaternions and dual quaternions (OO interface)

12 Downloads

Updated 28 Mar 2017

View License

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:
>> setup__robotics_toolbox
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:
>> angle(myquaternions),
Or you can compute their squares or compare them:
>> myquaternions.*myquaternions == myquaternions.^2
Get started:
demo_quaternion
demo_dualnumber
demo_dualquaternion
- 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.
Get started:
demo_conversions3x3
demo_conversions4x4
- 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).
Get started:
demo_kinematics
demo_inversekinematics
- 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.
Get started:
demo_dynamics
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 (atriveg@eii.uva.es)
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

Comments and Ratings (2)

Updates

1.1

This update improves the rtarrayMatrixCheckUnitary.m function that finds the rotation matrix closest to a given matrix. Singularities when the rotation matrix approaches a 180º degrees turn are now avoided.

1.1.0.0

Minor changes to the description.

1.1.0.0

This update corresponds to a bug fix: the previous version returned wrong axis-angle representations for certain 3-D rotations. "quat2aa.m" has been changed to fix this behavior.

1.1.0.0

Added serial robot dynamics module, including Newton-Euler and Lagrange-Euler dynamics.

1.0.0.0

Minor changes to the description

1.0.0.0

zip fil re-uploaded

1.0.0.0

Minor changes to the description

1.0.0.0

Minor changes to the description

MATLAB Release Compatibility
Created with R2013b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor

rtm_v1.1/robotics/

rtm_v1.1/robotics/core/conversions3x3/

rtm_v1.1/robotics/core/conversions4x4/

rtm_v1.1/robotics/core/dynamics/

rtm_v1.1/robotics/core/dynamics/ODE/

rtm_v1.1/robotics/core/kinematics/

rtm_v1.1/robotics/core/kinematics/inversekinematics/

rtm_v1.1/robotics/core/oo/

rtm_v1.1/robotics/core/oo/@dualnumber/

rtm_v1.1/robotics/core/oo/@dualquaternion/

rtm_v1.1/robotics/core/oo/@quaternion/

rtm_v1.1/robotics/core/utils/defaults/

rtm_v1.1/robotics/core/utils/matrixarrays/

rtm_v1.1/robotics/core/utils/redimension/

rtm_v1.1/robotics/demos/

rtm_v1.1/robotics/demos/robots/ScorbotER4u/

rtm_v1.1/robotics/demos/robots/cylindricalrobot/

rtm_v1.1/robotics/demos/robots/snakerobot/

rtm_v1.1/robotics/demos/utils/

rtm_v1.1/robotics/testing/

rtm_v1.1/robotics/testing/dynamics/

rtm_v1.1/robotics/testing/euler2quat2euler/

rtm_v1.1/robotics/testing/inversekinematics/

rtm_v1.1/robotics/testing/kinematics/

rtm_v1.1/robotics/testing/kinematicsJacobian/

rtm_v1.1/robotics/testing/scorbot/