Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zoom slew rate to CameraZoomPlugin #80

Closed
Ryanf55 opened this issue Jan 23, 2024 · 1 comment
Closed

Add zoom slew rate to CameraZoomPlugin #80

Ryanf55 opened this issue Jan 23, 2024 · 1 comment

Comments

@Ryanf55
Copy link
Contributor

Ryanf55 commented Jan 23, 2024

Feature request

Is your feature request related to a problem? Please describe.

Not all cameras can do instant zoom. I'd like to achieve the nice optical zoom rate limit that nice cameras have.

Describe the solution you'd like

Add one new parameter "slew_rate", which is the change in focal length per second possible from the camera.

The gazebo camera zoom plugin should be able to configure something like this:
https://www.youtube.com/watch?v=jShVCd7m1ak&ab_channel=SuperZoom
https://www.nikonusa.com/en/nikon-products/product/compact-digital-cameras/coolpix-p1000.html

Example:

Nikon has a P1000 has a 125x optical zoom (3000mm / 24mm = 125x). From the video, it takes about 7 seconds to do the zoom action.

Converting to SI, because REP-15, you have a 3 meter to 0.024 meter change.

Slew Rate [m/s] = ( 3 - 0.024) / 7 = 0.42514285714 m/s
Thus, you would add to models/gimbal_small_3d/model.sdf:

        <plugin filename="CameraZoomPlugin"
            name="CameraZoomPlugin">
          <max_zoom>125.0</max_zoom>
          <slew_rate>0.42514285714</slew_rate>
        </plugin>

Describe alternatives you've considered

N/A

Platform
[ x] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine

Assumptions

Ignore the weird lens effects at high zoom levels. If someone wants to make a 50-9999999 lens simulator, then let them.
Assume most users want instant zoom, so the default for the zoom rate will be infinity.

Additional context

I can do the implementation. Just requires a bit more math. It will be nice internally in the plugin to start doing math against focal lengths instead of the currently exposed zoom factor.

https://www.scantips.com/lights/fieldofviewmath.html
https://en.wikipedia.org/wiki/Focal_length

@Ryanf55
Copy link
Contributor Author

Ryanf55 commented Feb 3, 2024

Completed by #83 and #81

@Ryanf55 Ryanf55 closed this as completed Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant