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

ToF terrain jump handling in EKF #1431

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gemenerik
Copy link
Member

This PR proposes enhancements to the EKF to improve its ability to handle jumps caused by terrain height changes when using ToF sensors. The aim is to ensure more accurate elevation estimates and minimize the impact of sudden terrain variations on EKF performance.

This commit introduces tracking of elevation and predicted terrain height in the EKF ToF measurement model. If a significant difference between the predicted elevation and measured elevation is detected (i.e., greater than the terrain threshold), the model attributes this change to a terrain height adjustment. This predicted terrain height is then subtracted on each iteration to correct the elevation estimate.

The threshold is currently set at 0.04m, based on a maximum vertical velocity of 1 m/s and a ToF sensor update rate of 25Hz. This value represents the maximum achievable elevation difference without a terrain change.

Known Issues:
- Vertical velocity is currently not considered when detecting terrain jumps, leading to the assumption that any elevation change upon exceeding the threshold is entirely due to a terrain shift. Accounting for vertical velocity could improve accuracy.
- This approach introduces dead reckoning into the Z-axis estimate, with errors accumulating each time the threshold is exceeded, causing drift in the Z estimate.
@gemenerik gemenerik changed the title Terrain jump handling in EKF ToF measurement model Terrain jump handling in EKF Oct 30, 2024
@gemenerik gemenerik linked an issue Oct 30, 2024 that may be closed by this pull request
@gemenerik
Copy link
Member Author

gemenerik commented Oct 30, 2024

The first commit introduces tracking of elevation and predicted terrain height in the EKF ToF measurement model. If a significant difference between the predicted elevation and measured elevation is detected (i.e., greater than the terrain threshold), the model attributes this change to a terrain height adjustment. This predicted terrain height is then subtracted on each iteration to correct the elevation estimate.

The threshold is currently set at 0.04m, based on a maximum vertical velocity of 1 m/s and a ToF sensor update rate of 25Hz. This value represents the maximum achievable elevation difference without a terrain change.

Known Issues:

  • This approach introduces dead reckoning into the Z-axis estimate, with errors accumulating each time the threshold is exceeded, causing drift in the Z estimate.
  • Another limitation is that, since this relies on outliers, it cannot detect a smooth terrain change.

IMG_0070

@gemenerik gemenerik changed the title Terrain jump handling in EKF ToF terrain jump handling in EKF Oct 30, 2024
@gemenerik gemenerik self-assigned this Oct 30, 2024
@gemenerik
Copy link
Member Author

VL53L1x can be configured for higher ranging frequency at a cost in accuracy and max ranging distance. This could allow us to put lower a lower threshold on the terrain changes.

@tobbeanton
Copy link
Member

Nice! Is this a feature we would like to be configurable?

@gemenerik
Copy link
Member Author

Nice! Is this a feature we would like to be configurable?

Absolutely, especially given the limitations I think making it a non-default configurable is a good choice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Constant height while flying over obstacles with Flow Deck
2 participants