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

9 vues (au cours des 30 derniers jours)
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.

Réponse acceptée

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

Plus de réponses (1)

Nathan Hardenberg
Nathan Hardenberg le 1 Juin 2023
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 commentaires
Danaish
Danaish le 1 Juin 2023
Yes, there was a script with the same name. after removing it, the simulation is running without error. Thank you very much.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by