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

[MAVSDK TEST] Groundtruth always zero for vision and flow model #14760

Closed
kamilritz opened this issue Apr 25, 2020 · 4 comments
Closed

[MAVSDK TEST] Groundtruth always zero for vision and flow model #14760

kamilritz opened this issue Apr 25, 2020 · 4 comments

Comments

@kamilritz
Copy link
Contributor

kamilritz commented Apr 25, 2020

Inside the mavsdk test, when using the offboard mode, ground truth information from the gazebo simulation is used to perform checks.
Apparently for the two models iris_vision, iris_opt_flow_mockup the ground truth information is not received correctly and is always zero. Therefore all tests are passing.
MAVSDK

The ground truth information seems correct for the plain iris (GPS) model. (Except when running at speed factor 1, then target is also zero)

How to check:
Print out target_pos and current_pos variable here

For me it seems that there are two issues:

  1. With speed factor 1 it can happen that some received ground truth positions in the beginning are zero. This is set as ground truth home and when compared later to the exact (far not zero) ground truth position, the test is failing.
  2. For the vision and flow models the ground truth is always zero. We end up by CHECK_EQ(0, 0), which of course passes independent of the actual flight.

@julianoes Any idea how to solve this?

@julianoes
Copy link
Contributor

Thanks @kamilritz. I was seeing these errors too but then gave up debugging it.

  1. We should not send 0, right!?
  2. Why is the ground truth 0 for these models? That's also wrong, right?

@kamilritz
Copy link
Contributor Author

@julianoes

  1. I was printing out the ground truth inside the gazebo_gps_plugin. I never observed that it was generating a 0 in the beginning and switching to another value in the beginning. A hacky way to solve this, would be to check for an non zero ground truth position during the request_ground_truth() call. But actually a ground truth position of 0 could happen. Especially if it is not received correctly for models like in 2)
    Could it be that somewhere inside the Firmware or MAVSDK a variable that got initialized to 0 is passed further.
  2. I have no idea. I checked the uorb topic while running normal simulation with these models, and I could see the *_groundtruth topics as well. But I haven't check their content.

@kamilritz
Copy link
Contributor Author

@julianoes I was able to solve both issues with one change. It is caused by filling the GROUND_TRUTH message with content from the vehicle_global_position message. This message is coming from the estimator and is only published when the ekf is accepting global information. This is not the case for the iris_flow and iris_vision model. On the other side the ekf is publishing the vehicle_global_position message only after the gps data is passing the checks. This is causing the ground truth message to show 0 in the beginning until the ekf is publishing the information.

This can be easily solved by using to the raw gps data for the ground truth. I will open a PR.

@julianoes
Copy link
Contributor

Thanks @kamilritz!

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

2 participants