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

EKF2 not resetting position state when stopping GPS use and EV is already running #12558

Closed
artifactz opened this issue Jul 25, 2019 · 4 comments · Fixed by PX4/PX4-ECL#626
Closed

Comments

@artifactz
Copy link
Contributor

artifactz commented Jul 25, 2019

Description
"Failsafe enabled: no local position" when EKF2 switches from GPS to external vision. You can read my diary on discuss.px4.io, which is a lot more detailed.

To Reproduce
Steps to reproduce the behavior:

  1. drone with GPS and SLAM, visual odometry or similar via /mavros/vision_pose, VISION_POSITION_ESTIMATE or similar
  2. EKF2_AID_MASK is GPS + EV_POS + EV_YAW
  3. take off, hover/fly for at least 30 seconds (due to some internal EKF2 checks, see forum post)
  4. fly into a GPS-denied area (tunnel, hall etc.)

Expected behavior
EKF2 recognizes a decrease in GPS quality and switches to EV as primary localization source.
Because GPS was bad and EV can be imperfect as well, it needs to reset its position state, to avoid failing _vel_pos_test_ratio checks.

Log File
https://logs.px4.io/plot_app?log=b7f5fb21-808a-42eb-844d-18901eb24620

Screenshot
plot

  • pos_test_ratio explodes as soon as stopping GPS use
  • EKF states[7..8] (position) are only reset after dead reckoning and failsafe

Drone

  • rotary wing
@julianoes
Copy link
Contributor

@priseborough would be great if you could comment.

@mhkabir
Copy link
Member

mhkabir commented Jul 26, 2019

@artifactz is your vision yaw in the NED frame? Because if it's not, then your settings are inappropriate - you should be using rotate external vision instead of vision yaw in EKF2_AID_MASK.

@artifactz
Copy link
Contributor Author

artifactz commented Jul 29, 2019

@mhkabir My vision yaw is in ENU, because I use Mavros:

ROS uses ENU frames as convention, therefore position feedback must be provided in ENU.
(https://dev.px4.io/v1.9.0/en/ros/external_position_estimation.html)

Is that incorrect?

Also, the vision orientation is initialized using the IMU orientation.
Position control without GPS using only vision works in my case.

@LorenzMeier
Copy link
Member

@jkflying Could you please assist the review?

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

Successfully merging a pull request may close this issue.

4 participants