[Scilab-users] plotting 2 robots in same graphic

Tim Wescott tim at wescottdesign.com
Mon Feb 23 21:06:13 CET 2015


On Mon, 2015-02-23 at 19:34 +0000, hvn wrote:
> Hi,
> 
> I'm using v 5.5.1 with the Robotics Toolbox and want to display 2 
> manipulators in the same graphic. Following the Help and the Toolbox 
> demo, I write this code:
> 
> //define links
> L1 = Link('d',0,'a',1,'alpha',%pi/2);
> L2 = Link('d',0,'a',1,'alpha',%pi/4);
> L3 = Link('d',0,'a',1,'alpha',%pi/3);
> L4 = Link('d',0,'a',1,'alpha',%pi/5);
> 
> // create lists
> La = list(L1, L2);
> Lb = list(L3, L4);
> 
> //couple and create robots
> bot1 = SerialLink(La, 'name', 'bot1');
> //bot2 = SerialLink(Lb, 'name', 'bot2','base',transl(-1, 1, 0));
> 
> //define end effector positions
> pos1 = [0.1 0.2];
> pos2 = [0.2 0.8];
> 
> // draw robots
> plot_robot(bot1, pos1);
> bot2 = SerialLink(Lb, 'name', 'bot2','base',transl(-1, 1, 0));
> plot_robot(bot2, pos2)
> 
> ending up with 1 manipulator in 1 graphic. What do I do wrong ?

I have no direct experience with that toolbox, but if you're ending up
with a drawing of the second bot's manipulator each time, "plot_robot"
probably clears the figure before plotting.

A quick tour of the plot_robot code may tell you if that's happening.
It's probably in a file called plot_robot.sci, if the authors of the
toolbox have adhered to the naming conventions.

If there's a way of plucking the contents out of one graphic and
inserting them into another that may be a work-around.  You'd have two
plots, but at least one would have what you want.  I don't know if that
is possible -- but I'd ask the question here, and see what response I
got.

-- 

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432




More information about the users mailing list