Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

use baro for the ekf alignment if range finder is primary height source #292

Merged
merged 1 commit into from Jul 3, 2017

Conversation

ChristophTobler
Copy link
Contributor

As discussed in #290, I changed it to use baro if range finder is primary height.

@priseborough
Copy link
Collaborator

Do you have a test log?

@ChristophTobler
Copy link
Contributor Author

@priseborough
Copy link
Collaborator

I have verified that it is able to switch to range finder when it is available.

@priseborough priseborough merged commit ae11894 into master Jul 3, 2017
@ChristophTobler ChristophTobler deleted the pr-use_baro_align branch July 3, 2017 11:23
@jlecoeur
Copy link

@ChristophTobler @priseborough @mhkabir I think this introduced another bug in height estimation.
Was this tested for flight at fixed altitude above ground with baro+sonar and no GPS?
In my scenario I give an altitude command of -1m in offboard mode.
After this PR, I have a large offset in the actual drone altitude (it either descends to the ground, or flies too high at approx 2m)
By checking the commit before this PR, the 1m height is correctly tracked (but of course #290 is back!)

@ChristophTobler
Copy link
Contributor Author

@jlecoeur Thanks for reporting. Can you share the two logs?

@jlecoeur
Copy link

Not at the moment. I can make new tests tomorrow.

@ChristophTobler
Copy link
Contributor Author

I think I know what the problem is. Before, https://github.com/PX4/ecl/blob/ec2b54fde7a590178483ab9623459109003a4a44/EKF/control.cpp#L759-L765 did not run because _control_status_prev.flags.rng_hgt was already true because of https://github.com/PX4/ecl/pull/292/files#diff-0871d0235139c63531138e2793b76de7L213. Hence, the _hgt_sensor_offset was zero.
However, with the new changes, https://github.com/PX4/ecl/blob/ec2b54fde7a590178483ab9623459109003a4a44/EKF/control.cpp#L759-L765 runs after the initialization with baro. Therefore, _hgt_sensor_offset is non-zero.

This is not a problem with a good rangefinder as it will output the minimum distance when close to ground (or at least negligible). I suspect that your sonar will output a lot of noise when on ground and therefore _hgt_sensor_offset is initialized with a wrong value.

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

Successfully merging this pull request may close these issues.

None yet

3 participants