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

AP_Arming/AP_Terrain: pre-arm check if terrain allocation failed #12796

merged 5 commits into from Nov 18, 2019


Copy link

rmackay9 commented Nov 8, 2019

This adds a pre-arm check that the terrain following could allocate it's memory which resolves this issue: #12574. The user will be aware that the terrain database is not available much earlier than they would have.

As stated in the issue, master currently simply emits a nearly-never-seen text to the GCS saying "Terrain: Allocation failed" and then sets the TERR_ENABLE parameter is set to zero. This means that most users will only find out that terrain is not available when a terrain failsafe triggers during their mission.

This issue can be recreated in master by doing this:

  • set TERR_SPACING = 10 (to make terrain following try to consume a lot of memory)
  • set SCR_ENABLE = 1 (to enable scripting)
  • set SCR_HEAP = 50k (or even larger)

Below is a screen shot of the Pre-Arm message after making the above changes:

This PR also makes two drive-by fixes to small issues I noticed while working on the main fix:

  • constify a couple of functions within AP_Terrain that can be constified
  • add mission and rangefinder to the ARMING_CHECK parameter description Values. Most GCSs likely use the bitmask but Values are also there.
rmackay9 added 2 commits Nov 7, 2019
allows external caller to determine if terrain database failed to initialise
@rmackay9 rmackay9 force-pushed the rmackay9:terrain-alloc-prearm2 branch from d4e3e3f to 3aa263c Nov 8, 2019
@rmackay9 rmackay9 force-pushed the rmackay9:terrain-alloc-prearm2 branch from 3aa263c to 337de63 Nov 8, 2019
@tridge tridge merged commit d18432a into ArduPilot:master Nov 18, 2019
4 checks passed
4 checks passed
ArduPilot.ardupilot Build #20191109.2 succeeded
ArduPilot.ardupilot (Cygwin SITL build) Cygwin SITL build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
semaphoreci The build passed on Semaphore.
@rmackay9 rmackay9 removed this from PR in Rover 4.0 backports Nov 20, 2019
@tridge tridge added this to Pending in Plane 4.0 Backports Dec 9, 2019

This comment has been minimized.

Copy link
Contributor Author

rmackay9 commented Dec 16, 2019

this has been added to Copter-4.0.0-rc3

@rmackay9 rmackay9 moved this from PRs to 4.0.0-rc3 in Copter 4.0 backports Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.