How Can I Plot SerialLink in 3D graph in App Designer

조회 수: 8 (최근 30일)
Ke Wei Ong
Ke Wei Ong 2020년 8월 16일
편집: Ke Wei Ong 2020년 8월 22일
Hi,
I would like to know how can I plot SerialLink arm in 3D grap in App Designer?
Here is my code:
app.L = Link();
app.L(1) = Link([0 0.127300 0.000000 pi/2]);
app.L(2) = Link([0 0.000000 -0.61200 0]);
app.L(3) = Link([0 0.000000 -0.57230 0]);
app.L(4) = Link([0 0.163941 0.000000 pi/2]);
app.L(5) = Link([0 0.115700 0.000000 -(pi/2)]);
app.L(6) = Link([0 0.092200 0.000000 0.000000]);
app.Rob = SerialLink(app.L);
app.Rob.name = 'UR10';
app.Rob.plot( [app.j]);
and i have my value app.j as well. Just that if i used app.Rob.plot( [app.j]); it would be a pop up graph, however i would like it to stick on my main interface, where i located a axes graph for it.
I tried app.Rob.plot(app.j,app.UIAxes2);
Here is the error message, please help:-
Error using matlab.ui.control.UIAxes/horzcat
Conversion to matlab.ui.control.UIAxes from char is not possible.
Error in RTBPlot.plot_options (line 719)
error(['unknown option: ' args{1}]);
Error in SerialLink/plot (line 213)
opt = RTBPlot.plot_options(robot, varargin);

답변 (1개)

Prabhanjan Mentla
Prabhanjan Mentla 2020년 8월 19일
Hi,
To plot in the app designer, you can use plot function for a 2d plot and mesh and surf function for 3D plot.
For more information about these functions, visit the below links:
Hope this helps.
  댓글 수: 1
Ke Wei Ong
Ke Wei Ong 2020년 8월 22일
Hi Prabhanjan,
Thanks for your reply. Sorry not making myself clear.
Here is my code:
app.L = Link();
app.L(1) = Link([0 0.127300 0.000000 pi/2]);
app.L(2) = Link([0 0.000000 -0.61200 0]);
app.L(3) = Link([0 0.000000 -0.57230 0]);
app.L(4) = Link([0 0.163941 0.000000 pi/2]);
app.L(5) = Link([0 0.115700 0.000000 -(pi/2)]);
app.L(6) = Link([0 0.092200 0.000000 0.000000]);
app.Rob = SerialLink(app.L);
app.Rob.name = 'UR10';
app.Rob.plot( [app.j]);
and i have my value app.j as well. Just that if i used app.Rob.plot( [app.j]); it would be a pop up graph, however i would like it to stick on my main interface, where i located a axes graph for it.
I tried app.Rob.plot([app.j], app.UIAxes2); or app.Rob.plot("Parent",app.j)
but they don't work.
(I will edit it in question)
Thanks.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by