Error - "Attempt to execute SCRIPT ikine as a function:"

I am trying to run a function from the robotics toolbox installed on my matlab, but I get this error. I googled about this and got to know that it usually occurs when the filename is same as that of the function, but in my case the filename is different. I also went to the path displayed on the error and tried altering the names there, but of no use.
Here is a snippet of my code and the error:

댓글 수: 9

And you wrote a function "ikine" as
function inv = ikine(A)
...
end
and saved it as "ikine.m" in the working directory ?
Are you perhaps trying to use the ikine method of SerialLink objects from the Peter Corke Robotics Toolbox? https://www.petercorke.com/RTB/r9/html/SerialLink.html
@Sampath Vinay Pilla - are you sure you can use the ikine in this manner? From this example, ikine seems to be a method of an object that you need to create (like SerialLink).
Thanks for your replies @Walter Roberson@Geoff Hayes I made changes to the code accordingly, and I get a different error. Any chance you would be able to advise?
L1 = 4;
L2 = 3;
L3 = 2;
DH = [0 0 0 0; 0 0 L1 0; 0 0 L2 0];
L(1) = Link('revolute','d',DH(1,2),'a',DH(1,3),'alpha',DH(1,4));
L(2) = Link('revolute','d',DH(2,2),'a',DH(2,3),'alpha',DH(2,4));
L(3) = Link('revolute','d',DH(3,2),'a',DH(3,3),'alpha',DH(3,4));
M=[1 1 0 0 0 1]
Rob = SerialLink(L,'name','3R Planar Robot')
for i=1:4
for j=1:4
tr_matrix(i,j) = input("Enter the element " + i+","+j+" of transformation matrix: ");
end
end
disp("The entered matrix is: ")
disp(tr_matrix)
inv = ikine(Rob,tr_matrix,'mask',M)
This is the output:
Image Analyst
Image Analyst 2021년 12월 29일
편집: Image Analyst 2021년 12월 29일
@Sampath Vinay Pilla attach ikine.mlx so we can try things.
ikine is from the Peter Corke Robotics Toolbox
N/A
N/A 2021년 12월 30일
@Image Analyst please see attached ikine file below
I don't have much time today and I don't have that toolbox or any robots, so don't depend on me. I really have no idea about that function at all. Can you contact Peter Corke or else just do what the warnings say? Like limit your steps to less than 100, or try a different initial value.
@Image Analyst No problem at all. Thanks for trying. Really appreciate it

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Robotics System Toolbox에 대해 자세히 알아보기

질문:

N/A
2021년 12월 29일

댓글:

N/A
2022년 1월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by