I have a problem whith a line of code in which i have 3 robots with each a seperate tool. Each tool has the tag tool1-3 depending on the robot now the tool is drawn with the line command inside a loop where it extracts vectorised x,y,z values from a struct. The loop is within another loop inside a switch case for each robot.
my initial thought was to maby declare more than one tag to the obj with the use of j for allocating the same line obj ones it's suppoed to redraw it.
code in which the problem stems is this one:
for j = 1: size(td,2)
p = V(1:3,4);
V(1:3,4) = V(1:3,4)+td(1:3,j);
q = V(1:3,4);
x = [p(1) q(1)];
y = [p(2) q(2)];
z = [p(3) q(3)];
h = line(x,y,z);
what i get is a figure that prints multiple tool lines as the robot moves and i need someway to redraw those away for the updated position of the tool.
the thing i'm getting at the moment looks like this:
I might be going at this all wrong and maby whould collect the vectors in seperate x(j) and y(j), z(j) arrays and ones those have been gathered draw the new line with or something.