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

External vision ekf2 timeout and reset #10916

Closed
tuloski opened this issue Nov 26, 2018 · 10 comments
Closed

External vision ekf2 timeout and reset #10916

tuloski opened this issue Nov 26, 2018 · 10 comments

Comments

@tuloski
Copy link

tuloski commented Nov 26, 2018

Hi all.
I'm testing external vision for altitude on gazebo simulator.
I'm using:

  • EKF2_HGT_MODE vision
  • EKF2_EV_DELAY 100
  • I'm sending the EV mavlink message including ONLY timestamp and z field @20hz

but I get a few "EKF ev hgt timeout - reset to ev hgt" and suddenly the altitude have a jump and the quadrotor moves up or down.

My questions are:

  • Do I need to sync the timestamp of the external vision with the IMU? If yes with which precision?
  • Is EKF2_EV_DELAY the delay w.r.t. IMU data or w.r.t. the reality?
  • Can the "EKF ev hgt timeout" be only a simulator error due to poor hardware to simulate (the simulation on gazebo is running realtime @50Hz so it shouldn't be a big problem).
  • Why if I send the data @20hz, on the log the vision data is only @4hz? Is there a maximum rate? See the attached log.
  • Why the local position estimation seems to lag for a few seconds as if didn't have any data? See attached log. Probably related to "EKF timeout" problem.

Attached log: https://review.px4.io/plot_app?log=d9e21090-1c02-48d5-9b62-0781e04c77bf

@TSC21
Copy link
Member

TSC21 commented Nov 26, 2018

This happens because EKF2 expects you to send the full position vector (XYZ), not only one of the dimensions - https://github.com/PX4/Firmware/blob/master/src/modules/ekf2/ekf2_main.cpp#L1203.

@tuloski
Copy link
Author

tuloski commented Nov 26, 2018

@TSC21 are you sure? Because otherwise why does it work for a while, and tracks the altitude I send as vision estimate? And why is there "EKF2_HGT_MODE vision" that I can enable only for height?
I didn't put the flag to use complete vision for position estimation in EKF2_AID_MASK, but only EKF2_HGT_MODE.

BTW I send the full vision_estimate message, but the other fields are 0.

@TSC21
Copy link
Member

TSC21 commented Nov 26, 2018

@TSC21 are you sure? Because otherwise why does it work for a while, and tracks the altitude I send as vision estimate?

Yes I am sure. It tracks it because the other fields are 0 but are numbers.

And why is there "EKF2_HGT_MODE vision" that I can enable only for height?

It basically says that the estimator relies on the vision input only. But it doesn't mean you don't need the full vector.

@tuloski
Copy link
Author

tuloski commented Nov 26, 2018

Right. Thanks.
So there is no way to feed only the altitude from an external module, if not modifying the code.

@tuloski
Copy link
Author

tuloski commented Nov 26, 2018

BTW the documentation says:
"External Vision System
Position and Pose Measurements from an external vision system, e.g. Vicon, can be used:

External vision system horizontal position data will be used if bit position 3 in the EKF2_AID_MASK parameter is true.
External vision system vertical position data will be used if the EKF2_HGT_MODE parameter is set to 3.
External vision system pose data will be used for yaw estimation if bit position 4 in the EKF2_AID_MASK parameter is true."

So either the doc is wrong or there is another issue here.

@tuloski
Copy link
Author

tuloski commented Nov 29, 2018

Can someone point me at the code which triggers "EKF ev hgt timeout - reset to ev hgt"?

@TSC21
Copy link
Member

TSC21 commented Nov 29, 2018

@stale
Copy link

stale bot commented Feb 27, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Mar 13, 2019

Closing as stale.

@stale stale bot closed this as completed Mar 13, 2019
@kashishdhal
Copy link

Hello @tuloski,

I am having similar issue. You said it worked for a bit and EKF2 resets to zero. Were you able to resolve it? If yes, can you share?
My problem is mentioned in detail here:
https://discuss.px4.io/t/error-in-local-positioning-of-pixhawk4-using-vicon-data/16011/35

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

No branches or pull requests

3 participants