Page 1 of 1

I need to control the zoom of visual sensor

Posted: 07 Jul 2022, 11:14
by Javierrc99
The thing is i need to control the "zoom" of 2 visual sensors in order to keep track of some objectives, i have searched but i haven' t found a clear way on how to "modify" the zoom of the sensor during the simulation via code. If it is possible i would like to be able to do it via an external API python code, but if it would be enough if it can be done via child scripts and signals from the API. Any possibilities?
Thanks in advance

Re: I need to control the zoom of visual sensor

Posted: 07 Jul 2022, 14:55
by coppelia
Hello,

You can modify various settings of a vision sensor programmatically, e.g. in your case:

Code: Select all

sim.setObjectFloatParam(visionSensorHandle,sim.visionfloatparam_perspective_angle,viewAngle)
sim.setObjectInt32Param(visionSensorHandle,sim.visionintparam_resolution_x,resX)
sim.setObjectInt32Param(visionSensorHandle,sim.visionintparam_resolution_y,resY)
See also the other object parameter IDs.

Cheers