Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Multiple uses of Spray_Add

Some general inquiries about the use of Spray_Add. I'm using the code snippets below to add a spray gun for simulation purposes: 

RDK.Spray_Clear(-1) # Clear any spray objects.

RDK.Spray_Add(item_tool, item_object, "PARTICLE=SPHERE(4) PROJECT COLOR=blue") # Add simulated spray gun.
RDK.Spray_SetState(robolink.SPRAY_ON) # Turn the spray gun on.

# (Add inbetween code)

RDK.Spray_SetState(robolink.SPRAY_OFF) # Turn the spray gun off.

Can the color of a the particles be changed after the initial call? E.g. I'd like to first add blue particles, and then add yellow particles (without removing the present blue particles).

Can two or more spray guns be used at the same time?

Is there a function similar to the spray gun, which allows to add a particle at a specified pose w.r.t. a certain reference frame? Independent of any robot tools. I think this would be useful, e.g. to visualize calculated coordinates. Likewise, it would be useful to be able to 3d draw lines and surfaces etc. in a station.

Kind regards,

It is not possible to change the color or properties of a spray once you create it but you can use multiple spray objects, there is no limit.

Particles should be linked to a tool and an object. If you don't provide the tool or object items, RoboDK tries to find the closest object to the tool. Make sure you at least have a tool and an object, otherwise you won't see the particles. Also, if you remove the project flag it should not project the particles to the object.

Most of our dispensing application examples show the trace of the TCP by using particles. You can find these examples here:

Also, for your information, you can activate or deactivate the trace by using Tools-Trace.
Could you provide a few lines of code to illustrate how two (or more) individual spray objects can be created, and how they can be turned on and off individually?
You can find an example attached which uses the same Arc script to turn on and off the trace for welding paths. This example uses 4 robots. You can run the MAIN program to see the result.

This example is not fully working as one robot doesn't move because it has an invalid path.

Attached Files
.rdk   SingleAxis_4Panasonic_FullProcess v3.rdk (Size: 16.17 MB / Downloads: 169)
Ok thanks, I now understand the id_spray = RDK.Spray_Add() returns a handle id_spray to the spray gun, which can then be provided as an argument to e.g. Spray_SetState(state, id_spray) to target that specific spray gun. Stripped down I can now use a blue and a yellow spray gun on the same robot as follows:
spray_blue = RDK.Spray_Add(item_tool, item_object, "PARTICLE=SPHERE(4) PROJECT COLOR=blue")
# do something...

spray_yellow = RDK.Spray_Add(item_tool, item_object, "PARTICLE=SPHERE(4) PROJECT COLOR=yellow")
# do something...
Does what I was looking for.

Users browsing this thread:
1 Guest(s)