robot toolbox rigidBodyTree function

조회 수: 7 (최근 30일)
Matthew Koithan
Matthew Koithan 2020년 6월 2일
답변: Cam Salzberger 2020년 6월 2일
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');

답변 (1개)

Cam Salzberger
Cam Salzberger 2020년 6월 2일
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

카테고리

Help CenterFile Exchange에서 Robotics System Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by