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

Multiple uses of Spray_Add

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

Code:
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,

Maarten
#2
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:
https://robodk.com/stations#filter?appli...size=small

Also, for your information, you can activate or deactivate the trace by using Tools-Trace.
#3
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?
#4
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: 147)
#5
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:
Code:
spray_blue = RDK.Spray_Add(item_tool, item_object, "PARTICLE=SPHERE(4) PROJECT COLOR=blue")
RDK.Spray_SetState(robolink.SPRAY_ON,spray_blue)
# do something...
RDK.Spray_SetState(robolink.SPRAY_OFF,spray_blue)

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




Users browsing this thread:
1 Guest(s)