Getting error in Inverse Kinematic block using robotics system toolbox for 2 DOF planner robot

조회 수: 3 (최근 30일)
I'm trying to control 2 DOF manipulator by providing xyz waypoints using signal builder. The robot model is imported from SolidWorks.
I have also tried to run simulation without IK block providing some input to joint q1 and q2 to check the simlation model and it shows no error. However with inverse kinematics it shows error.
The Simulink model is attached below;
And when I simulate the model it shows error as;
clicking the IKBlock line and following the code going to line 69 we get;
% Assign the robot internal property by instantiating from the structure
obj.TreeInternal = robotics.manip.internal.RigidBodyTree(obj.TreeStruct.NumBodies, obj.TreeStruct);
obj.IKInternal = inverseKinematics('RigidBodyTree', obj.TreeInternal, ... % ---------------line 69
'SolverAlgorithm', obj.SolverName, 'SolverParameters', obj.SolverParameters, ...
'UserTimer', obj.UserTimer);
end
I have tried few resources but couldn't get answer to solve this issue. Unfortuanelty, I am not sure how I can make the simulation work for 2 DOF model.Thank you.

채택된 답변

Walter Roberson
Walter Roberson 2023년 6월 1일
rename your MATLAB\inverseKinematics.m to a different name. The current name is interfering with a built-in model with the same name.

추가 답변 (1개)

Nathan Hardenberg
Nathan Hardenberg 2023년 6월 1일
Your error seems to indicate, that you want to run a script as a function. While your setup looks good, it could be that you have a script named "inverseKinematics.m" or "inverseKinematics.mlx" in your working directory. Maybe MATLAB then confuses this with the desired function. (Link to related Post)
If this is the case, simply renaming this script should resolve the problem!
Otherwise the more time-efficient method is maybe calculating the inverse kinematics yourself with a MATLAB-function. Since it is only a 2-DOF Robot this should not be that difficult.
  댓글 수: 2
Danaish
Danaish 2023년 6월 1일
Yes, there was a script with the same name. after removing it, the simulation is running without error. Thank you very much.

댓글을 달려면 로그인하십시오.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by