clear functions
close all
clear all
addpath ../mr
global link ToRad ToAngle
ToRad = pi/180;
ToAngle = 180/pi;
link(1).name = 'link1'; link(1).child = 2; link(1).mother = 0;
link(2).name = 'link2'; link(2).child = 3; link(2).mother = 1;
link(3).name = 'end_effector'; link(3).child = 0; link(3).mother = 2;
%% define the screw axis of each joint
% In this case, there are 2 joints. Both are the rotation about z axis.
N = 3;
link(1).ScrewAxis = [0 0 1 0 0 0]'; % [angular_velocity linear_velocity]'
link(2).ScrewAxis = [0 0 1 0 0 0]';
link(3).ScrewAxis = [0 0 0 0 0 0]';
%% joint realtive position (relative to parent)
link(1).b = [0 0 0]';
link(2).b = [0 0 1]';
link(3).b = [0 0 1]';
%% mass of each link
link(1).m = 1;
link(2).m = 1;
link(3).m = 0;
%% CoM positioin
link(1).c = [0 0 0.5]';
link(2).c = [0 0 0.5]';
link(
matlab 代码主要实现了一个机器人动力学相关的计算,涉及到机器人连杆的定义、关节参数的初始化,以及通过正向和反向运动学的计算来分析机器人的运动状态
最新推荐文章于 2025-02-17 20:47:41 发布