Bug Report
Copter's auto mode may quietly interpret a waypoint's "0" alt above terrain as current-alt-above-home if the terrain database is disabled. This also affect most other commands including Land, Vtol-land, Loiter unlimited, payload place, loiter time, arc waypoint, loiter-turns (aka circle), spline.
The issue is mostly avoided because of pre-arm checks ensuring the terrain database is loaded before flight but users can force arm to bypass the check.
The issue is in the loc_from_cmd function which silently falls back to using alt-above-home.
This was discovered as part of PR #32634 which removed the text warning to the pilot if this occurs in Land mode.
Issue details
The issue can be reproduced by doing this
- ./Tools/autotest/sim_vehicle.py --map --console -L Karuizawa (or another mountainous region)
- param set TERRAIN_ENABLE 0 (to disable the terrain database)
- param set AUTO_OPTIONS 3 (to allow arming from auto mode to ease testing)
- create a mission with WAYPOINT commands, alt=0, alt-type:Terrain
- auto
- arm throttle force
When the vehicle flies the mission the vehicle will not track the terrain nor will a terrain failsafe be triggered.
The correct behaviour would be for the terrain failsafe to be triggered and the vehicle to RTL home (perhaps not using the terrain database)
Below is a screen shot from SITL using the above steps. In this case the vehicle takes off to 20m and the waypoint command's alt of 0 with alt-frame of terrain should result in the vehicle flying at 20m above terrain but instead it quietly flies at 20m above home and gets within 2m of the ground.
Version
4.7, 4.8
Platform
[ ] All
[ ] AntennaTracker
[x] Copter
[ ] Plane
[ ] Rover
[ ] Submarine
Bug Report
Copter's auto mode may quietly interpret a waypoint's "0" alt above terrain as current-alt-above-home if the terrain database is disabled. This also affect most other commands including Land, Vtol-land, Loiter unlimited, payload place, loiter time, arc waypoint, loiter-turns (aka circle), spline.
The issue is mostly avoided because of pre-arm checks ensuring the terrain database is loaded before flight but users can force arm to bypass the check.
The issue is in the loc_from_cmd function which silently falls back to using alt-above-home.
This was discovered as part of PR #32634 which removed the text warning to the pilot if this occurs in Land mode.
Issue details
The issue can be reproduced by doing this
When the vehicle flies the mission the vehicle will not track the terrain nor will a terrain failsafe be triggered.
The correct behaviour would be for the terrain failsafe to be triggered and the vehicle to RTL home (perhaps not using the terrain database)
Below is a screen shot from SITL using the above steps. In this case the vehicle takes off to 20m and the waypoint command's alt of 0 with alt-frame of terrain should result in the vehicle flying at 20m above terrain but instead it quietly flies at 20m above home and gets within 2m of the ground.
Version
4.7, 4.8
Platform
[ ] All
[ ] AntennaTracker
[x] Copter
[ ] Plane
[ ] Rover
[ ] Submarine