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

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

最近更新

  1. TCP协议是安全的吗?

    2024-01-16 15:20:06       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-16 15:20:06       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-16 15:20:06       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-16 15:20:06       20 阅读

热门阅读

  1. 智慧校园云桌面解决方案简述

    2024-01-16 15:20:06       37 阅读
  2. 2024 CKA 题库 | 10、创建 PV

    2024-01-16 15:20:06       36 阅读
  3. Linux篇之Centos中将系统时间设置为本地时间

    2024-01-16 15:20:06       40 阅读
  4. 嵌入式工程师必须掌握的几种系统架构

    2024-01-16 15:20:06       32 阅读
  5. 【数据库原理】(29)数据库设计-需求分析阶段

    2024-01-16 15:20:06       37 阅读
  6. Golang 通道输入输出学习(同刚上手的小新手)

    2024-01-16 15:20:06       34 阅读
  7. 33、病隙随笔——浅聊脑机接口BCI

    2024-01-16 15:20:06       30 阅读