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

8 次查看(过去 30 天)
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