Matlab 使用 DH table 建立的 robot 和实际不符

机器人仿真

想借助 matlab robotics toolbox 来仿真机器人,但是直接输入自己的 DH table 显示出来的 robot 和实际不情况不符。

DH table 建立 robot

Build Manipulator Robot Using Kinematic DH Parameters

主要使用 setFixedTransform,DH table 中都是数值,不带变量

robot = rigidBodyTree;

bodies = cell(6,1);
joints = cell(6,1);
for i = 1:6
    bodies{i} = rigidBody(['body' num2str(i)]);
    joints{i} = rigidBodyJoint(['jnt' num2str(i)],"revolute");
    setFixedTransform(joints{i},dhparams(i,:),"dh");
    bodies{i}.Joint = joints{i};
    if i == 1 % Add first body to base
        addBody(robot,bodies{i},"base")
    else % Add current body to previous body by name
        addBody(robot,bodies{i},bodies{i-1}.Name)
    end
end

原因一 theta 角度中的 固定偏置 默认被忽略

setFixedTransform 会默认忽略 旋转关节 theta 角度中的固定偏置,看帮助文档
The theta input is ignored when specifying the fixed transformation between joints because that angle is dependent on the joint configuration.

感谢 matlab 论坛 的资源

由于固定忽略偏置,需要手动设置 home position,并在后续计算中,对 theta 角度手动加上这个偏置

robot.Bodies{2}.Joint.HomePosition=-pi/2;
robot.Bodies{4}.Joint.HomePosition=pi/2;

原因二 参数错了

检查 DH table 中的 角度 与 长度 是不是错了,尤其是长度部分的数值。

原因二 DH table 建立方式不符合matlab标准

检查 DH table 建立方法,常见有两种,参考下面两个作者的书

  • John J. Craig ----- Introduction to Robotics Mechanics and Control
  • Bruno Siciliano ----- Robotics, Modeling, Planning and Control

Matlab setFixedTransform 采用 Siciliano方法,帮助手册有写

  • A — Length of the common normal line between the two z-axes, which is perpendicular to both axes
  • α — Angle of rotation for the common normal
  • d — Offset along the z-axis in the normal direction, from parent to child
  • θ — Angle of rotation for the x-axis along the previous z-axis

Craig

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

Siciliano

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • 10
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值