mindstorm ev3を利用した2自由度マニピュレータの制御
显示 更早的评论
matlab及びプログラミング初心者です。
こちらのサイト(https://haribo-tsuntsun.hateblo.jp/entry/2018/12/03/015955)から以下のプログラムを使ってev3を制御しようとしたところ、
「関数または変数 'mymotor2' が未定義です。」というエラーメッセージが表示されましたが、定義の仕方がわかりません。アドバイスいただけないでしょうか。よろしくお願い致します。
%forward kinematics
l1=65;
l2=120;
t1=30; %target theta_1
t2=30; %target theta_2
x=l1*cos(deg2rad(t1))+l2*cos(deg2rad(t1+t2))
y=l1*sin(deg2rad(t1))+l2*sin(deg2rad(t1+t2))
resetRotation(mymotor1)
resetRotation(mymotor2)
motor_move(mymotor1,10,t1)
motor_move(mymotor2,10,t2)
function motor_move(motorname,power,theta)
rotation=readRotation(motorname);
error=theta-rotation;
while(abs(error)>2)
motorname.Speed=error/power+10;
start(motorname);
rotation=readRotation(motorname);
error=(theta-rotation);
end
stop(motorname);
end
1 个评论
michio
2019-2-10
質問の投稿、ありがとうございました。
回答の内容で課題や疑問が解決されましたら、
ぜひ「この回答を採用」ボタンのクリックをお願いいたします。
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 インストールとライセンスの紹介 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!