安装
- 下载工具箱(约20M)
- 将rvctools放在MATLAB安装目录下的toolbox文件夹下
- 设置路径,添加rvctools文件夹
- 将运行目录放到rvctools文件夹下,命令行运行 startup_rvc
具体步骤参考https://blog.csdn.net/AprilsHell/article/details/90722892(10.3版本)
上面的工具箱下载链接有些慢,可从csdn上下载
https://download.csdn.net/download/gyxx1998/12267522(10.3版本、9.1版本及机器人工具箱说明书)
删除工具箱
因为想把9.1改为10.3
所以需要删除再重新安装
参考:
- 几种卸载方法https://kr.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/66698/versions/2/previews/doc/scatool/html/doc_01_installation.html?access_key=
- 通过命令行删除https://ww2.mathworks.cn/help/matlab/ref/matlab.addons.toolbox.uninstalltoolbox.html
- https://blog.csdn.net/dujiahei/article/details/80502972
- HOME > Add-Ons > Manage Add-Ons
以及查看现有工具箱的方法
https://blog.csdn.net/yaked/article/details/48933603
一个demo
%%begin
% A serial link manipulator comprises a series of links. Each link is described
% by four Denavit-Hartenberg parameters.
%
% Let's define a simple 2 link manipulator. The first link is
L1 = Link('d', 0, 'a', 1, 'alpha', pi/2)
% The Link object we created has a number of properties
L1.a
L1.d
% and we determine that it is a revolute joint
L1.isrevolute
% For a given joint angle, say q=0.2 rad, we can determine the link transform
% matrix
L1.A(0.2)
% The second link is
L2 = Link('d', 0, 'a', 1, 'alpha', 0)
% Now we need to join these into a serial-link robot manipulator
bot = SerialLink([L1 L2], 'name', 'my robot')
% The displayed robot object shows a lot of details. It also has a number of
% properties such as the number of joints
bot.n
% Given the joint angles q1 = 0.1 and q2 = 0.2 we can determine the pose of the
% robot's end-effector
bot.fkine([0.1 0.2])
% which is referred to as the forward kinematics of the robot. This, and the
% inverse kinematics are covered in separate demos.
% Finally we can draw a stick figure of our robot
bot.plot([0.1 0.2])
说明:
- L1 = Link(‘d’, 0, ‘a’, 1, ‘alpha’, pi/2)
设置连杆的各参数 d、a、 α \alpha α
通过“ L1.a ”等 可以输出具体参数 - L1.isrevolute
显示其是否为旋转关节 - L1.A(0.2)
设置 θ \theta θ为 0.2 rad ,输出其转换矩阵 - bot = SerialLink([L1 L2], ‘name’, ‘my robot’)
建立机械臂模型,设置机械臂名称为“my robot”,输出其DH矩阵与相关基础设置参数 - bot.n
输出关节自由度 - bot.fkine([0.1 0.2])
第一个关节 θ \theta θ为 0.1 rad, 第一个关节 θ \theta θ为 0.2 rad,根据正向运动学(FK),输出转换矩阵 - bot.plot([0.1 0.2])
- 第一个关节 θ \theta θ为 0.1 rad, 第一个关节 θ \theta θ为 0.2 rad,画出机械臂图像
机器人工具箱常用函数
Link类
Link 对象包括连杆的各种属性:运动学参数、惯性张量、电机、传递矩阵等
Link 的类函数:
信息/显示方式:
display : 显示连杆参数表格
dyn : 显示动力学参数
type: 关节类型:‘R’或者’P’
转换方式:
char : 转化为字符串
运算方式:
A :关节传动矩阵
friction : 摩擦力
nofriction : 摩擦为0
测试方式:
islimit:检测关节变量是否超出范围
isrevolute : 检测关节是否为转动关节
isprismatic : 检测关节是否为移动关节
issym: 检测关节和连杆是否有符号参数
Link 的类属性(读/写):
运动学:
theta: 关节角
d: 连杆偏移量
a: 连杆长度
alpha:连杆转角
mdh: 默认0,SDH;1,MDH
offset:关节变量偏移量
qlim:关节变量范围[min max]
动力学:
m: 质量
r: 质心
I: 惯性张量
B: 粘性摩擦
Tc: 静摩擦
G: 减速比
Jm: 转子惯量
Seriallink 类
类函数比较多,包括显示机器人、动力学、逆动力学、雅可比等
Seriallink 的类函数:
显示/画图方式:
animate: 动画机器人模型
display: 显示连杆参数表格
dyn: 显示动力学参数
edit: 显示和编辑运动学与动力学参数
getpos: 获取机器人图形位置
plot: 显示机器人模型
plot3d: 显示机器人3d模型
teach: 驱动机器人模型
测试方式:
islimit: 检测机器人是否超出范围
isconfig: 检测机器人关节结构属性
issym: 检测关节和连杆是否有符号参数
isprismatic: 检测是否移动关节
isrevolute: 检测是否转动关节
isspherical: 检测是否为球关节
转换方式:
char : 转化为字符串
sym: 转化为符号参数
todegrees: 关节角转化为角度
toradians: 关节角转化为弧度
选项
‘name’,NAME: 设置机器人名字属性为NAME
‘manufacturer’,MANUF : 设置机器人制造者的名字为MANUF
‘comment’,COMMENT: 设置机器人注释为COMMENT
‘base’,T: 设置基坐标系矩阵属性为T
‘tool’,T: 设置工具坐标系矩阵属性为T
‘gravity,G’: 设置重力矢量属性为G
‘plotpt’,P: 为.plot()设置默认选项为P
‘plotpt3d’,P: 为.plot3d()设置默认选项为P
‘nofast’: 不使用
评论(0)
您还未登录,请登录后发表或查看评论