robot toolbox rigidBodyTree function

7 Ansichten (letzte 30 Tage)
Matthew Koithan
Matthew Koithan am 2 Jun. 2020
Beantwortet: Cam Salzberger am 2 Jun. 2020
I am trying to get started with the robot toolbox. I am getting this error when using the rigidBodyTree function.
Undefined function or variable 'rigidBodyTree'.
Error in DIYbotcode (line 4)
robot = rigidBodyTree('Dataformat','column','MaxNumbodies',3);
So far I have tried unistalling the robot toolbox add on, turning on and off my computer, and updating Matlab. Here is the code that I am running. I am using This as my template https://www.mathworks.com/help/robotics/ug/2d-inverse-kinematics-example.html.
%DIY robot rigidbody%
%start with blank tree model%
robot = rigidBodyTree('Dataformat','column','MaxNumbodies',3);
%specigy arm lengths%
L1 = 4.75;
L2 = 6.66;
%L3 = 1.5;
%add link1 and joint1%
body = rigidBody('link1');
joint = rigidBodyJoint('joint1','revolute');
setFixedTransformation(joint,trvec2tform([0 0 0]));
joint.JointAxis = [0 0 1];
body.joint = joint
addBody(robot. body, 'base');
%Add 'link2' body with 'joint2' joint%
body = rigidBody('link2');
joint = rigidBodyJoint('joint2','revolute');
setFixedTransform(joint, trvec2tform([L1,0,0]));
joint.JointAxis = [0 0 1];
body.Joint = joint;
addBody(robot, body, 'link1');

Antworten (1)

Cam Salzberger
Cam Salzberger am 2 Jun. 2020
Matthew,
One thing to check is which version of MATLAB you have. rigidBodyTree was introduced in R2016b.
Another is to make sure you are installing MathWorks' Robotics System Toolbox, not Peter Corke's Robotics Toolbox. rigidBodyTree is only in the Robotics System Toolbox.
Finally, you can try running these commands to reset the MATLAB Search Path to the default value:
restoredefaultpath
rehash toolboxcache
If that fixes the issue, you can save this for future sessions with:
savepath
-Cam

Kategorien

Mehr zu Robotics System Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by