All Projects → petercorke → spatialmath-matlab

petercorke / spatialmath-matlab

Licence: MIT license
Create, manipulate and convert representations of position and orientation in 2D or 3D using Python

Programming Languages

matlab
3953 projects
HTML
75241 projects

Projects that are alternatives of or similar to spatialmath-matlab

Spatialmath Python
Create, manipulate and convert representations of position and orientation in 2D or 3D using Python
Stars: ✭ 78 (-45.07%)
Mutual labels:  robot, math, transform, 2d
StuyLib
Award-Winning FRC Library by StuyPulse Team 694
Stars: ✭ 17 (-88.03%)
Mutual labels:  robot, math
Mathnet Spatial
Math.NET Spatial
Stars: ✭ 246 (+73.24%)
Mutual labels:  math, 2d
ReferenceFrameRotations.jl
A toolbox to represent 3D rotations of coordinate frames for Julia language.
Stars: ✭ 48 (-66.2%)
Mutual labels:  quaternion, euler-angles
Unitymathreference
Math reference for games and more. All visualized in Unity3D.
Stars: ✭ 166 (+16.9%)
Mutual labels:  math, 2d
Black
World's fastest HTML5 2D game engine   🛸
Stars: ✭ 174 (+22.54%)
Mutual labels:  math, 2d
Pybotics
The Python Toolbox for Robotics
Stars: ✭ 192 (+35.21%)
Mutual labels:  robot, math
vecti
A tiny TypeScript library for 2D vector math.
Stars: ✭ 14 (-90.14%)
Mutual labels:  math, 2d
abacus
📐 C# cross precision 3D maths library.
Stars: ✭ 35 (-75.35%)
Mutual labels:  math, quaternion
TransformUtils.jl
Lie groups and algebra with some quaternions
Stars: ✭ 18 (-87.32%)
Mutual labels:  quaternion, 2d
zalgebra
Linear algebra library for games and real-time graphics.
Stars: ✭ 129 (-9.15%)
Mutual labels:  math, quaternion
Sophus
C++ implementation of Lie Groups using Eigen.
Stars: ✭ 1,048 (+638.03%)
Mutual labels:  math, 2d
Mathc
Pure C math library for 2D and 3D programming
Stars: ✭ 504 (+254.93%)
Mutual labels:  math, 2d
Ugm
Ubpa Graphics Mathematics
Stars: ✭ 178 (+25.35%)
Mutual labels:  math, transform
SharpMath2
2D math / geometry collision library for C#, compatable with monogame.
Stars: ✭ 36 (-74.65%)
Mutual labels:  math, 2d
FixedPoint-Sharp
Fixed point math with 48.16 precision (based on lib by https://github.com/fholm)
Stars: ✭ 114 (-19.72%)
Mutual labels:  math, 2d
hlml
vectorized high-level math library
Stars: ✭ 42 (-70.42%)
Mutual labels:  math, quaternion
Quaternion.js
A JavaScript Quaternion library
Stars: ✭ 86 (-39.44%)
Mutual labels:  math, quaternion
SCNMathExtensions
Math extensions for SCNVector3, SCNQuaternion, SCNMatrix4
Stars: ✭ 32 (-77.46%)
Mutual labels:  math, quaternion
Quadcopter SimCon
Quadcopter Simulation and Control. Dynamics generated with PyDy.
Stars: ✭ 84 (-40.85%)
Mutual labels:  quaternion, euler-angles

View Spatial Math Toolbox on File Exchange Build Status Coverage License: MIT Maintenance GitHub stars

Spatial Math Toolbox for MATLAB®

Synopsis

This Toolbox contains functions and classes to represent orientation and pose in 2D and 3D (SO(2), SE(2), SO(3), SE(3)) as orthogonal and homogeneous transformation matrices, unit quaternions, twists, triple angles, and matrix exponentials. The Toolbox also provides functions for manipulating these datatypes, converting between them, composing them, graphically displaying them, and transforming points and velocities.

Much of this Toolbox functionality was previously in the Robotics Toolbox for MATLAB.

Advantages of the Toolbox are that:

  • the code is mature and provides a point of comparison for other implementations of the same algorithms;
  • the routines are generally written in a straightforward manner which allows for easy understanding, perhaps at the expense of computational efficiency. If you feel strongly about computational efficiency then you can always rewrite the function to be more efficient, compile the M-file using the MATLAB compiler, or create a MEX version;
  • source code is available for the benefit for understanding and teaching.

There is now a Python version of this Toolbox on GitHub and PyPI.

Manual

Comprehensive detail of all functions is provided in the PDF-format manual (~200 pages).

Installation

From the MATLAB toolstrip Home>Add-Ons>Get Add-Ons will bring up the Add-On Explorer. Enter "spatial math" into the search box, select the first entry and then click "Add from GitHub". The Toolbox will be downloaded and added to your path.

Code Example

>> R = rotx(0.2)  % SO(3) rotation matrix
R =
    1.0000         0         0
         0    0.9801   -0.1987
         0    0.1987    0.9801

which we could animate simply as

>> tranimate(R)

animation from tranimate()

Convert roll-pitch-yaw angles to a unit quaternion

>> R = rpy2r(10, 20, 30, 'deg')
R =
    0.8138   -0.4410    0.3785
    0.4698    0.8826    0.0180
   -0.3420    0.1632    0.9254

which uses the ZYX convention by default, ie. this is a rotation by the yaw angle (30 deg) about the Z-axis, followed by a rotation by the pitch angle (20 deg) about the Y-axis, followed by a rotation by the roll angle (10 deg) about the X-axis. We can convert this to a unit quaternion

>> q = UnitQuaternion(R)
q = 
0.95155 < 0.038135, 0.18931, 0.2393 >

or create the unit quaternion directly using a variant constructor

>> q2 = UnitQuaternion.rpy(10, 20, 30, 'deg')
q2 = 
0.95155 < 0.038135, 0.18931, 0.2393 >

What's new

  • Continuous integration using Travis CI and codecov
  • Support for spatial vector notation (Featherstone's 6D vectors)
  • prod() method for all RTBPose subclasses and Twist
  • Factored out of the Robotics Toolbox for MATLAB. RTB now contains only robotics specific code, eg. for manipulator arms and mobile robots.

Online resources:

Please email bug reports, comments or code contribtions to me at [email protected]

Octave

The functions, but not the classes, should work fine with Octave 5.x.

Contributors

Contributions welcome. There's a user forum at http://tiny.cc/rvcforum for this Toolbox and also Robotics Toolbox for MATLAB.

License

This toolbox is released under MIT Licence.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].