mirror of https://github.com/ArduPilot/ardupilot
1.5 KiB
1.5 KiB
Mount POI
This script displays the location (lat, lon and altitude) that the gimbal is currently pointing towards
Parameters
POI_DIST_MAX : POI's max distance (in meters) from the vehicle
How To Use
- Set RCx_OPTION to 300 or 301 to enable triggering the POI calculation from an auxiliary switch. If 301 is used the gimbal will also lock onto the location
- Optionally set POI_DIST_MAX to the maximum distance (in meters) that the POI point could be from the vehicle
- Fly the vehicle and point the camera gimbal at a point on the ground
- Raise one of the RC auxiliary switches and check the GCS's messages tab for the latitude, longitude and alt (above sea-level)
How It Works
The script's algorithm is implemented as follows
- Get the POI_DIST_MAX and TERRAIN_SPACING parameter values
- Get the vehicle Location (lat, lon, height above sea-level), initialise test-loc and prev-test-loc
- Get the vehicle's current alt-above-terrain
- Get gimbal attitude (only pitch and yaw are used)
- The test_loc variable is initialised to the vehicle's current location
- The prev_test_loc variable is a backup of test_loc
- test_loc is moved along the line defined by the gimbal's pitch and yaw by TERRAIN_SPACING (meters)
- Get the terrain's altitude (above sea-level) at test_loc
- Steps 6, 7 and 8 are repeated until test_loc's altitude falls below the terrain altitude
- Interpolate between test_loc and prev_test_loc to find the lat, lon, alt (above sea-level) where alt-above-terrain is zero
- Display the POI to the user