Option 'nojoints' in SerialLink.plot

383 views
Skip to first unread message

Ozi

unread,
Nov 22, 2017, 10:19:57 AM11/22/17
to Robotics & Machine Vision Toolboxes
Hi everyone,

I am modelling a robot with a remote center of motion. To do so in the toolbox, I just created a joint, where the RCM lies. For the visualization, I would like to hide either all joints and links and only see the endeffector coordinate frame or in the best case hide just the particular joint (q5 in the example) and the connected links.

I tried using the 'nojoints' option from the plot method, but I get the following error message:


Reference to non-existent field 'pjoint'.

Error in SerialLink/animate (line 98)
                            set(h.pjoint(L), 'Matrix',
                            diag([1 1 max(eps, q(L)) 1]));

Error in SerialLink/plot (line 297)
    robot.animate(qq);

Error in codeforquestion (line 40)
bot.plot(q0, 'workspace', w_dim,'jointdiam', 1, 'scale',
0.1, 'nojoints')
 
The code that generated the error is below:

clearvars; close all; clc

%param
startup_rvc; %start robotics toolbox by peter corke

%Link config
off_z0 = 30; %offset from x,y stage in negative world_frame_z direction
r_arc = 140;
off_x1 = 150; %offset from first to second rotation axis
off_syr = 50; %final offset

off_dx = 10; %small offset so joints cant collide in simulation
off_dy = 10; %small offset so joints cant collide in simulation

y_max = 1000; %range
x_max = 1000; %range
z_max = 100; %range

%Robot link parameters, in D-H convention
theta =     [0      1       1       0               0          0        0] *pi/2;
d =         [0      0       0       off_z0+r_arc    0          r_arc    0];
a =         [0      0       0       0               0          0        0];
alpha =     [-1     -1      1       1               1          2        0] *pi/2;
isprism =   [1      1       1       0               0          0        1];
offset =    [0      off_dx  off_dy  0               0          0        off_syr];
qmin =      [0      0       0       0               0          0        0];
qmax =      [z_max  y_max   x_max   2*pi            pi/2       0        100];

%possible q0s
q0=[0  485.3401  289.1116    6.0947    1.0927    0  100.0000]
%dimensions for robot plot figure
w_dim =     [-450 50 -50 (1000) -300 100];

%build robot object from connected links
for i=1:(size(theta,2)-0)
    L(i) = Link ([theta(i) d(i) a(i) alpha(i) isprism(i) offset(i)], 'standard');
    L(i).qlim = [qmin(i) qmax(i)];
end
bot = SerialLink(L, 'name', 'PPRRP 5DOF')
bot.plot(q0, 'workspace', w_dim,'jointdiam', 1, 'scale', 0.1, 'nojoints')


Does anybody have an idea, how I could hide individual joints and links, if possible at all?

Thank you for your help and best regards,
Oliver Z

Peter Corke

unread,
Nov 25, 2017, 5:55:05 PM11/25/17
to Robotics & Machine Vision Toolboxes
There are no options to hide links and joints.  'nojoints' simply hides the cylinders that indicate joints, see below.  I'm using RTB10.2 and MATLAB 18b and didn't have any error.  All the source code is available so it shouldn't be too hard to make the links disappear as well.

Erik van Oene

unread,
Nov 26, 2017, 5:07:03 PM11/26/17
to Robotics & Machine Vision Toolboxes
Op zaterdag 25 november 2017 23:55:05 UTC+1 schreef Peter Corke:
> There are no options to hide links and joints.  'nojoints' simply hides the cylinders that indicate joints, see below.  I'm using RTB10.2 and MATLAB 18b and didn't have any error.  All the source code is available so it shouldn't be too hard to make the links disappear as well.
>
>
>
>
Hi,

What is a remote center of motion?

You can try to put the link length to zero..

Further the name of the robot ppr... does not match with the kinematic stucture I obtained from your code. Is this due to the extra joints? Please note that these extra joint(s) give extra degree of freedom on the model which you don't have in the real robot..

Erik

Ozi

unread,
Nov 27, 2017, 3:35:57 AM11/27/17
to Robotics & Machine Vision Toolboxes
Hi Peter, hi Erik

Peter: Thank you for the insights. I am using RTB10.2 as well, but Matlab 16a, maybe this combination causes the error. As a workaround, I am now setting the 'jointdiam' property to 0 and the 'scale' property to 0.02.

Erik: Thank you for your feedback. See this link for a visualization: Remote center of motion. What I am trying to model is similar to d). The extra joint is to rotate the coordinate system. The joint limits are set to qmin = 0 and qmax = 0, so it should not influence the model. I do some inv kinematic calculations, but I use ikcon, so it takes the limits into account.
About the name: Yes, it should be PPPRR(R)P, I forgot to update from a previous iteration.

Best regards,
Oliver

Erik van Oene

unread,
Dec 3, 2017, 3:30:07 AM12/3/17
to Robotics & Machine Vision Toolboxes
Op maandag 27 november 2017 09:35:57 UTC+1 schreef Ozi:
Hi,

I'm still not convinced this is the way to go.. with option D of you figure, you model this as an extra joint which has zero excursion. This means it is just a static rotation to he nezt joint. So not adding an extra degree of motion.

If this is true, there should exist a set of DH parameters such that you don't need the extra static joint.

Erik
Reply all
Reply to author
Forward
0 new messages