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

2 ビュー (過去 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);
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 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 Center および File ExchangeRobotics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by