ArduPilot / ardupilot_gazebo

Plugins and models for vehicle simulation in Gazebo Sim with ArduPilot SITL controllers
GNU Lesser General Public License v3.0
81 stars 76 forks source link

Zoom slew rate #81

Closed Ryanf55 closed 7 months ago

Ryanf55 commented 7 months ago

Purpose

Solves #57 , implementing a zoom slew rate to give realistic zoom effect for optical cameras like the Nikon P1000.

Usage

Add the following to your CameraZoomPlugin:

<slew_rate>0.42514285714</slew_rate>

The value is camera-specific and can be calculated per the issue description.

Demo

https://github.com/ArduPilot/ardupilot_gazebo/assets/25047695/eb7485e4-2eae-4162-813c-2b3eeec506eb

Dependencies

Depends on #79 to go in first.

Assumptions

srmainwaring commented 7 months ago

@Ryanf55 - can you update base to target main. We'll port to ros2 once it's merged. (The ros2 branch only runs when launched using ROS launch scripts because of upstream package resolution issues).

Update done already, prior to review.

srmainwaring commented 7 months ago

@Ryanf55 - fix for the zoom returning to initial position in https://github.com/Ryanf55/ardupilot_gazebo/pull/1.

Ryanf55 commented 7 months ago

I had to add a fix for if the user doesn't specify slew_rate to behave like before without a crash. Everything seems to work for both cases now.