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_VisualOdom/Scripting: support Odometry's quality, add autoswitching script #26277

Merged
merged 9 commits into from
Feb 28, 2024

Conversation

rmackay9
Copy link
Contributor

@rmackay9 rmackay9 commented Feb 21, 2024

This improves the safety of using the ModalAI VOXL sensor by adding support for automatic switching to optical flow when the sensor loses its position estimate.

The detailed changes are:

  1. the ODOMETRY mavlink message's quality field (which the ModalAI provides) is consumed, and logged
  2. a new VISO_QUAL_MIN parameter has been added which blocks sending of positions and velocities to the EKF if their quality is too low. This parameter's default is zero so when ModalAI failed (and quality becomes -1) we will not send to the EKF. Other cameras are not affected because the quality will be 0 (unknown) and will thus pass and be sent to the EKF.
  3. a new ahrs-source-extnav-optflow.lua scripting applet has been added which allows easy manual or automatic switching between external nav and optical flow
  4. SITL's vicon feature sends a quality of 50 and gets parameter documentation

This has been tested in SITL and on a real vehicle and greatly improves handling of ModalAI camera failures.

Below is a screen-shot showing that SITL is sending a quality of 50.
sitl-odometry-quality

Below is a screen shot of a test to ensure the VISO_QUAL_MIN was working. When the required quality was increased above 50, SITL's simulated vicon values were not fused, the EKF failsafe triggered and the vehicle switched to Land mode
sitl-vicon-quality-test-map

@tridge tridge merged commit fb5df80 into ArduPilot:master Feb 28, 2024
93 checks passed
@rmackay9 rmackay9 deleted the scripting-modalai-Feb2024 branch February 28, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 4.5.0-beta3
Development

Successfully merging this pull request may close these issues.

2 participants