There is no offset between my first joint and the base when I want to model a two axis planar robot using Robotics System Toolbox
Show older comments
Here is the image of the robot and related D-H parameters:


and this is my code:
% 1. Buliding the manipulator robot tree
% 0. Create a rigid body tree
two_axis_planar_robot = rigidBodyTree;
% 1. Create a rigid body with a unique name
body1 = rigidBody('body1');
% 2. Create a revolute joint
jnt1 = rigidBodyJoint('jnt1','revolute');
body1.Joint = jnt1;
% 3. D-H Parameters
dhparams = [1 , 0 , 0 , 0
1 , 0 , 0 , 0];
% Note the toolbox order:
% 1st column : a
% 2nd column : alpha
% 3rd column : d
% 4th column : theta
% 4. Add the rigid body to the tree. Specify the body name that you are
% attaching the rigid body to. Because this is the first body, use the base
% name of the tree
setFixedTransform(jnt1,dhparams(1,:),'dh');
basename = two_axis_planar_robot.BaseName;
addBody(two_axis_planar_robot,body1,basename)
% 5. Use showdetails on the tree to confirm the rigid body and joint were
% added properly.
showdetails(two_axis_planar_robot)
%Show
show(two_axis_planar_robot);
axis([-2,2,-2,2,-2,2])
grid minor
axis on
Finally, the result:

Due to the D-H parameters table, the first link should appear!!
Accepted Answer
More Answers (0)
Categories
Find more on Manipulator Modeling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!