Hello,
I have created a scene in vrep but I want programmatically to set and unset the scene objects' properties.
Specifically, I want to set the object property to be detectable by laser scanner, so I use the "simSetObjectSpecialProperty" command alongside the "sim_objectspecialproperty_detectable_laser" flag, but after a while I would like the object to not be detectable by the laser, but how can I unset the property?
It is that the scene is big, so if all the objects are detectable, everything is getting really slow, so I try to make detectable only the objects that are around my robot.
Unset object property
Re: Unset object property
Update:
I think I found it.
I just use the command simSetObjectSpecialProperty(objectHandle,0) and it works. Whatever property I set before now is unset. However I am not sure if it is a right way to do stuff.
I think I found it.
I just use the command simSetObjectSpecialProperty(objectHandle,0) and it works. Whatever property I set before now is unset. However I am not sure if it is a right way to do stuff.
Re: Unset object property
Hello,
if you want to set property sim_objectspecialproperty_detectable_laser for instance, then you should do:
to clear it:
But it should not make a difference speed-wise: V-REP will do a 2-pass check, where the first pass is very fast and coarse.
Cheers
if you want to set property sim_objectspecialproperty_detectable_laser for instance, then you should do:
Code: Select all
local p=simGetObjectSpecialProperty(objHandle)
p=simBoolOr32(p,sim_objectspecialproperty_detectable_laser)
simSetObjectSpecialProperty(objHandle,p)
Code: Select all
local p=simGetObjectSpecialProperty(objHandle)
p=simBoolOr32(p,sim_objectspecialproperty_detectable_laser)-sim_objectspecialproperty_detectable_laser
simSetObjectSpecialProperty(objHandle,p)
Cheers
Re: Unset object property
Yes, that seems like the right way!
Thanks for the answer!
Thanks for the answer!