I need to control the zoom of visual sensor

Typically: "How do I... ", "How can I... " questions
Post Reply
Javierrc99
Posts: 23
Joined: 08 May 2022, 18:34

I need to control the zoom of visual sensor

Post 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

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: I need to control the zoom of visual sensor

Post 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

Post Reply