Hello,
during the last days i tried out some manipulator configurations with the SerialLink class. The configuration itself with the DH parameters works fine. But the visualization using SerialLink.plot was not satisfying. I got several problems that should not be there in my opinion. I work with MATLAB version R2013b and Robotics Toolbox 9.9.0, so it should be the newest version I think:
----------------------------------------------------------------------------------------------------
MATLAB Version: 8.2.0.701 (R2013b)
MATLAB License Number: 50505
Operating System: Linux 3.5.0-51-generic #76-Ubuntu SMP Thu May 15 21:19:10 UTC 2014 x86_64
Java Version: Java 1.7.0_11-b21 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
----------------------------------------------------------------------------------------------------
MATLAB Version 8.2 (R2013b)
Simulink Version 8.2 (R2013b)
RF Toolbox Version 2.13 (R2013b)
...
Robotics Toolbox Version 9.9.0
Robotics Toolbox Version 9.9.0
...
Everything else is also (R2013b) ...
-----------------------------------------------------------------------------------------------------
The first problem is, that I cannot use a prismatic joint as end effector . My SerialLink is R1 for example:
R1 =
noname (2 axis, RP, stdDH, slowRNE)
+---+-----------+-----------+-----------+-----------+
| j | theta | d | a | alpha |
+---+-----------+-----------+-----------+-----------+
| 1| q1| 1| 2| 0|
| 2| 0| q2| 1| 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
Plotting this SerialLink leads to the following error no matter what value I set for q2:
>> plot(R1,[0 0],'workspace',[-5 5 -5 5 -5 5])
creating new robot
Operands to the || and && operators must be convertible to logical scalar values.
Error in SerialLink/plot>create_robot (line 422)
if (links(end).d ~= 0) || (links(end).a ~= 0)
Error in SerialLink/plot (line 247)
handle = create_robot(robot, opt);
Should & and | be used there instead of && and ||?
A configuration with 3 Links could be the following:
R2 =
noname (3 axis, RPR, stdDH, slowRNE)
+---+-----------+-----------+-----------+-----------+
| j | theta | d | a | alpha |
+---+-----------+-----------+-----------+-----------+
| 1| q1| 1| 2| 0|
| 2| 0| q2| 1| 1.571|
| 3| q3| 2| 2| 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
When this SerialLink is plotted it looks like on the left side in the attached OriginalModified.pdf. The left red ellipse marks the part where the bar corresponding to the d1 value is missing. The second red ellipse marks where the bar representing the prismatic joint translation should be positioned. I had a closer look into the code of SerialLink.plot and SerialLink.animate and found some mistakes.
The first thing is in line 400 of SerialLink.plot. There for a second time t(2) ~= 0 is checked. But it should be t(3) I would say. If this is corrected, the bars representing the d values appear.
The second problem, the wrongly positioned prismatic joint bars, seems to be caused by applying the previous transformation (marked in green) twice on the bar.
If a joint has an alpha of half pi for example, the bar representing the d value is shown, but not where i expected it. It is linked to the end of the link so that the bars for d and a do not form a connection between the origin and the end of the link. The attached AlphaDA.pdf shows this for the following configuration:
R3 =
noname (3 axis, RRR, stdDH, slowRNE)
+---+-----------+-----------+-----------+-----------+
| j | theta | d | a | alpha |
+---+-----------+-----------+-----------+-----------+
| 1| q1| 2| 1| 1.571|
| 2| q2| 1| 2| -1.571|
| 3| q3| 0| 2| 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
I don't know yet what causes this phenomena.
I am not completely sure, if these problems are really caused by the supposed mistakes in the code or if i am doing something wrong. Anyway I modified the SerialLink.plot and SerialLink.animate files in a local toolbox copy to get a satisfying visualization. The result can be seen in the right subfigure in the attached OriginalModified.pdf.
Maybe everything was unnecessary and i am wrong. Then please tell me. Otherwise I would be pleased to receive some feedback, if anybody has the same problem for example or just comments on the presented problems.
Best regards
Gickl