-3

I am trying to create a code for the purposes of plotting a robot. I am using the Peter Corke Robotic toolbox. So far it seems fairly simple until I came about with the struggle of simply plotting a robot.

My code at the moment is as followed:

%Theta Inputs
T1= 45;
T2= 60;
T3= 40;
T4= 45;
T5= 90;
T6= 50;
T7= 45;

%Input Conversion
T1 = T1*pi/180;
T2 = T2*pi/180;
T3 = T3*pi/180;
T4 = T4*pi/180;
T5 = T5*pi/180;
T6 = T6*pi/180;
T7 = T7*pi/180;

T = [T1,T2,T3,T4,T5,T6,T7];

LL = Link([0,0,0,0]);
LL(2) = Link([0,0,69,pi/2]);
LL(3) = Link([0,364.35,0,-pi/2]);
LL(4) = Link([0,0,69,pi/2]);
LL(5) = Link([0,374.29,0,-pi/2]);
LL(6) = Link([0,0,10,pi/2]);
LL(7) = Link([0,229.525,0,-pi/2]);

%DH table
R7 = SerialLink(LL)
R7.name = 'BAXTER'

%Plot
R = R7.plot(T)

The command window provides me with the table I am looking for but yells at me for having too many outputs. The plot also won't generate.

BAXTER (7 axis, RRRRRRR, stdDH, fastRNE)                         

+---+-----------+-----------+-----------+-----------+-----------+
| j |     theta |         d |         a |     alpha |    offset |
+---+-----------+-----------+-----------+-----------+-----------+
|  1|         q1|          0|          0|          0|          0|
|  2|         q2|          0|         69|     1.5708|          0|
|  3|         q3|     364.35|          0|    -1.5708|          0|
|  4|         q4|          0|         69|     1.5708|          0|
|  5|         q5|     374.29|          0|    -1.5708|          0|
|  6|         q6|          0|         10|     1.5708|          0|
|  7|         q7|    229.525|          0|    -1.5708|          0|
+---+-----------+-----------+-----------+-----------+-----------+

grav =    0  base = 1  0  0  0   tool =  1  0  0  0              
          0         0  1  0  0           0  1  0  0              
       9.81         0  0  1  0           0  0  1  0              
                    0  0  0  1           0  0  0  1              

Error using SerialLink/plot
Too many output arguments.

Error in SevDOF (line 30)
R = R7.plot(T)
PTRK
  • 899
  • 1
  • 5
  • 18
Vonny
  • 1
  • 3
  • Also, I tried [0 0 0 0 0 0 0] for the plot command and received the same result. – Vonny Apr 26 '18 at 03:20
  • try just R7.plot(T) and not R = R7.plot(T) – PTRK Apr 26 '18 at 06:16
  • 2
    Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. (Putting this in the title is considered in an especially poor light, somewhat akin to content vandalism). – halfer Apr 26 '18 at 08:32

1 Answers1

0

Reading the pdf help document, it is said

SerialLink.plot

Graphical display and animation

R.plot(q, options) displays a graphical animation of a robot based on the kinematic

So it looks like this functions as no output argument. I suggest to replace R = R7.plot(T) by R7.plot(T)

PTRK
  • 899
  • 1
  • 5
  • 18
  • Thanks, I'm new to MATLAB and didn't realize that R was being read as an output of a function. – Vonny Apr 26 '18 at 18:49