# How it works
A number of toolbox functions such as `accel()`, `gravload()`, `coriolis()`, `inertia()`
rely on multiple calls to the function `rne()`. The Simulink ROBOT block in turn
relies on `accel()`. Since `rne()` is an M-file things can run rather slowly.
This directory contains source code for a MEX file `frne.mex` which typically runs better than an order of magnitude faster than the M-file.
The M-file `rne.m` checks:
- that MEX speedup is requested, that is the `fast` flag in the `SerialLink` robot object is true. Its status can be tested as `robot.fast` or seen by the presence of the _fastRNE_ tag displayed above the DH parameters.
- that a MEX file is present, ie. the file `frne.mex` exists
and if this is the case then it will call `frne.mex` rather than `rne_dh.m` or `rne_mdh.m`.
# Building the MEX file
The mex file compries 3 files written in vanilla C with no other library
dependencies (apart from libm):
| File | Purpose |
|---------|---------------------|
| frne.c | MEX function main, handles different call formats, unpacks the SerialArm object |
| ne.c | The actual recursive Newton-Euler code for standard and modified DH parameters |
| vmath.c | A very simple vector and matrix (linalg) library |
These are compiled and linked together, resulting in a MEX file called
frne. The extension of the file depends on the operating system and architecture.
## For Linux or MacOS just run:
```
% make
```
which assumes that the `mex` utility is in your current path. This is typically
found in the `bin` subdirectory of your installed MATLAB. You do of course also
need a C compiler.
## For Windows:
Probably easier to run the script from inside MATLAB
```
>> make
```
you will need to have a C compiler installed and configured within MATLAB.
MathWorks provide a free C compiler for Windows called [`MinGW`](http://www.mingw.org) (minimalist GNU compiler). You can install this through the AddOns manager from MATLAB desktop.
# Notes on performance
The MEX file speedup is greater when invoked on multiple points, not just one. This
is because of startup overhead in extracting the kinematic and dynamic parameters
from the MATLAB `SerialArm` object.
## Limitations
- The MEX file does not support base or tool transforms. `rne.m` performs a hack with the gravity vector simulate the effect of a base transform.
## Testing
The script `check.m` compares the results and execution time for two different robots (Puma560, Stanford arm which has a prismatic link) each represented using standard or modified DH parameters. The script output is below (for an i7 Macbook Pro)
```
>> check
***************************************************************
************************ Puma 560 *****************************
***************************************************************
************************ normal case *****************************
DH: Speedup is 25, worst case error is 0.000000
MDH: Speedup is 34, worst case error is 0.000000
************************ no gravity *****************************
DH: Speedup is 30, worst case error is 0.000000
MDH: Speedup is 24, worst case error is 0.000000
************************ ext force *****************************
DH: Speedup is 16, worst case error is 0.000000
MDH: Speedup is 30, worst case error is 0.000000
***************************************************************
********************** Stanford arm ***************************
***************************************************************
************************ normal case *****************************
DH: Speedup is 35, worst case error is 0.000000
MDH: Speedup is 30, worst case error is 0.000000
************************ no gravity *****************************
DH: Speedup is 32, worst case error is 0.000000
MDH: Speedup is 31, worst case error is 0.000000
************************ ext force *****************************
DH: Speedup is 31, worst case error is 0.000000
MDH: Speedup is 29, worst case error is 0.000000
```
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
MATLAB机器人工具箱.zip (709个子文件)
frne.c 14KB
ne.c 12KB
joystick.c 4KB
vmath.c 4KB
CITATION 475B
OutputStreamSend.class 1KB
CONTRIB 1KB
CONTRIB 707B
VisualServoing.cpp 19KB
ne.cpp 9KB
ArmControl.cpp 9KB
SSC32Controller.cpp 4KB
crustcrawler.cpp 4KB
Command.cpp 2KB
style.css 146B
DEPENDENCIES 62B
hidapi64.dll 88KB
hidapi64_thunk_pcwin64.dll 38KB
hidapi32.dll 12KB
Create Set Up BlueSoliel.doc 398KB
Belkin Bluetooth connection to iRobot Create.doc 375KB
Matlab_Toolbox_iRobot_create_doc.doc 243KB
hidapi64.dylib 30KB
hidapi64_thunk_maci64.dylib 5KB
nominal.eps 6.22MB
pose2.eps 6.22MB
above.eps 6.22MB
pose1.eps 6.22MB
side.eps 6.22MB
CT-02-02.eps 3.84MB
CT-02-03.eps 2.83MB
caranim.eps 195KB
hidapi64_thunk_pcwin64.exp 2KB
phantomx.ezdraw 1.96MB
rob2.ezdraw 542KB
rob3.ezdraw 542KB
rob1.ezdraw 420KB
rob4.ezdraw 311KB
rtbdemo_gui.fig 29KB
tripleangle.fig 28KB
RobotGuiControl.fig 5KB
killian.g2o 4.83MB
pg1.g2o 439B
3point.gif 6.56MB
quad.gif 5.08MB
pf.gif 1.78MB
move2ball.gif 492KB
KeyBoardControl.gif 23KB
more_arrows.gif 121B
bullet_orange.gif 52B
hidapi.h 13KB
frne.h 4KB
vmath.h 1KB
ArmControl.hpp 4KB
SSC32Controller.hpp 2KB
Command.hpp 2KB
tripleangle_App_report.html 17KB
release.html 7KB
introduction.html 2KB
robot_product_page.html 2KB
acknowledgements.html 979B
license.html 959B
right.ist 63B
Element.java 17KB
ElementList.java 10KB
DHFactor.java 7KB
OutputStreamSend.java 1KB
leg 35B
hidapi64_thunk_pcwin64.lib 4KB
LICENSE 26KB
Command.m 92KB
arrow.m 54KB
SerialLink.m 41KB
Brick.m 40KB
Link.m 39KB
VREP.m 38KB
EKF.m 37KB
RTBPlot.m 33KB
ETS.m 31KB
SerialLinkTest.m 30KB
Arbotix.m 30KB
ETS3.m 29KB
ikine6s.m 29KB
ETS2.m 28KB
Navigation.m 27KB
CodeGeneratorTest.m 25KB
DstarPO.m 25KB
AstarPO.m 25KB
DstarMOO.m 25KB
AstarMOO.m 25KB
Astar.m 24KB
LinkTest.m 21KB
PoseGraph.m 19KB
Vehicle.m 19KB
RRT.m 19KB
Dstar.m 19KB
TrajectoryTest.m 18KB
plot.m 18KB
Lattice.m 17KB
tripleangle.m 16KB
共 709 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
- m0_603574022024-03-18简直是宝藏资源,实用价值很高,支持!
GeekyGuru
- 粉丝: 1604
- 资源: 1099
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功