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

Sudden change in altitude estimate #15311

Open
kvmanohar22 opened this issue Jul 12, 2020 · 2 comments
Open

Sudden change in altitude estimate #15311

kvmanohar22 opened this issue Jul 12, 2020 · 2 comments
Labels

Comments

@kvmanohar22
Copy link

kvmanohar22 commented Jul 12, 2020

Describe the bug
Altitude estimate from the topic /mavros/altitude before and after acquiring home lock changes drastically. Although this sudden change is expected due to GPS altitude fusion, this can be catastrophic which I learnt the hard way.

While testing offboard mode, my sequence of steps are as follows (All these steps are automated in an offboard node i.e, all I had to do is turn on the drone and the drone will take care of executing each of the mentioned steps below(except of course for step 3)):

  1. Arm
  2. Takeoff (3m above ground)
  3. Wait for switch to OFFBOARD mode from RC
  4. Execute the path

While in step 2 (takeoff), the code generates altitude based on the current altitude estimate from /mavros/altitude topic. This altitude from the mentioned topic can be different depending on whether home position lock was acquired or not as explained below:

  • Home position lock not acquired: In this case /mavros/altitude outputs barometric altitude.
  • Home position lock acquired: In this case, barometric altitude is fused with GPS and a new estimate is put on the topic /mavros/altitude.

Log Files and Screenshots

  • Log analysis when starting the script after home lock is acquired: link
  • Log analysis when starting the script before home lock is acquired: link

Note that step 2 (takeoff) altitude setpoint is of 3m. In the first log, you can clearly see that 3m altitude setpoint is relative to fused altitude whereas in the second log, you can see that it is way off.

Additional context
We were testing simple path execution via offboard mode.

@bresch
Copy link
Member

bresch commented Jul 14, 2020

Just to clarify, the EKF isn't fusing the GPS altitude in you case because EKF2_HGT_MODE is set to barometric altitude. However, yes, the altitude is adjusted when the GPS altitude is acquired. Could you simply check for the validity of the global position solution before generating your path?

@stale
Copy link

stale bot commented Oct 12, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants