[![View Spatial Math Toolbox on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/70373-spatial-math-toolbox)
[![Build Status](https://travis-ci.com/petercorke/spatialmath-matlab.svg?branch=master)](https://travis-ci.com/petercorke/spatial-math)
![Coverage](https://codecov.io/gh/petercorke/spatial-math/branch/master/graph/badge.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/petercorke/spatialmath-matlab/graphs/commit-activity)
[![GitHub stars](https://img.shields.io/github/stars/petercorke/spatialmath-matlab.svg?style=social&label=Star&maxAge=2592000)](https://GitHub.com/petercorke/robotics-toolbox-matlab/stargazers/)
# 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](https://github.com/petercorke/robotics-toolbox-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](https://github.com/petercorke/spatialmath-python) and [PyPI](https://pypi.org/project/spatialmath-python).
## Manual
Comprehensive detail of all functions is provided in the [PDF-format manual (~200 pages)](https://github.com/petercorke/spatialmath-matlab/releases/download/untagged-a2f9c8b2bd21cca9fe39/spatialmath.pdf).
## 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
```matlab
>> 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
```matlab
>> tranimate(R)
```
![animation from tranimate()](doc/figs/tranimate.gif)
Convert roll-pitch-yaw angles to a unit quaternion
```matlab
>> 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
```matlab
>> q = UnitQuaternion(R)
q =
0.95155 < 0.038135, 0.18931, 0.2393 >
```
or create the unit quaternion directly using a variant constructor
```matlab
>> q2 = UnitQuaternion.rpy(10, 20, 30, 'deg')
q2 =
0.95155 < 0.038135, 0.18931, 0.2393 >
```
## What's new
* Continuous integration using [Travis CI](https://travis-ci.com/petercorke/spatial-math) and [codecov](https://codecov.io/gh/petercorke/spatial-math)
* 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](https://github.com/petercorke/robotics-toolbox-matlab). RTB now contains only robotics specific code, eg. for manipulator arms and mobile robots.
## Online resources:
* [Tutorial style exampes](https://github.com/petercorke/spatial-math/wiki)
* [Home page](http://www.petercorke.com)
* [Robotics, Vision & Control (book)](http://petercorke.com/wordpress/rvc)
* [Discussion group](http://groups.google.com/group/robotics-tool-box?hl=en)
Please email bug reports, comments or code contribtions to me at rvc@petercorke.com
## 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](http://tiny.cc/rvcforum) for this Toolbox and also
[Robotics Toolbox for MATLAB](https://github.com/petercorke/robotics-toolbox-matlab).
## License
This toolbox is released under MIT Licence.
没有合适的资源?快使用搜索试试~ 我知道了~
使用Python创建、操作和转换2D或3D中的位置和方向表示
共205个文件
m:156个
html:6个
pdf:6个
需积分: 2 0 下载量 34 浏览量
2024-03-23
14:44:02
上传
评论
收藏 5.41MB ZIP 举报
温馨提示
使用Python创建、操作和转换2D或3D中的位置和方向表示
资源推荐
资源详情
资源评论
收起资源包目录
使用Python创建、操作和转换2D或3D中的位置和方向表示 (205个子文件)
CITATION 475B
CONTRIB 61B
style.css 146B
DEPENDENCIES 62B
CT-02-02.eps 3.84MB
CT-02-03.eps 2.83MB
tripleangle.fig 28KB
tranimate.gif 1.05MB
more_arrows.gif 121B
bullet_orange.gif 52B
.gitignore 122B
tripleangle_App_report.html 17KB
release.html 7KB
introduction.html 2KB
robot_product_page.html 2KB
acknowledgements.html 979B
license.html 959B
tex-config.ini 244B
right.ist 63B
LICENSE 1KB
UnitQuaternion.m 54KB
PGraph.m 53KB
TransformationsTest.m 40KB
SE3.m 39KB
RTBPose.m 35KB
arrow3.m 34KB
SO3.m 33KB
Quaternion.m 28KB
Plucker.m 27KB
SE2.m 21KB
UnitQuaternionTest.m 20KB
Twist.m 17KB
tripleangle.m 16KB
SO2.m 16KB
tb_optparse.m 14KB
Transformations2Test.m 13KB
trplot.m 13KB
SO3Test.m 11KB
stlRead.m 11KB
QuaternionTest.m 11KB
SE3Test.m 10KB
Animate.m 10KB
plotXTest.m 10KB
UtilityTest.m 10KB
plot_ellipse.m 8KB
trplot2.m 8KB
tboptparseTest.m 8KB
PluckerTest.m 8KB
SpatialVec6.m 7KB
DifferentialMotionTest.m 7KB
tr2rpy.m 7KB
SpatialInertia.m 7KB
tranimate.m 6KB
SE2Test.m 6KB
tranimate2.m 6KB
plot_poly.m 6KB
trchain.m 6KB
PlotTest.m 6KB
trchain2.m 6KB
trprint.m 5KB
plot_box.m 5KB
trlog.m 5KB
plot_point.m 5KB
SO2Test.m 4KB
rpy2r.m 4KB
trexp.m 4KB
SpatialTest.m 4KB
smtbcheck.m 4KB
plot_ribbon.m 4KB
plot_circle.m 4KB
TwistTest.m 4KB
SpatialM6.m 4KB
tr2angvec.m 4KB
trexp2.m 4KB
transl.m 4KB
trinterp2.m 4KB
trinterp.m 4KB
trprint2.m 4KB
SpatialVelocity.m 4KB
SpatialAcceleration.m 3KB
SpatialForce.m 3KB
rpy2jac.m 3KB
tr2delta.m 3KB
plot_sphere.m 3KB
tr2eul.m 3KB
angdiff.m 3KB
SpatialMomentum.m 3KB
transl2.m 3KB
plotvol.m 3KB
RTBPoseTest.m 3KB
homtrans.m 3KB
rpy2tr.m 3KB
eul2r.m 3KB
plot_arrow.m 3KB
plot_homline.m 3KB
about.m 3KB
trnorm.m 3KB
PGraphTest.m 3KB
SpatialF6.m 3KB
circle.m 2KB
共 205 条
- 1
- 2
- 3
资源评论
若明天不见
- 粉丝: 1w+
- 资源: 273
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功