Use ground truth data for ground truth mavlink message #14806
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously the ground truth data that is published over the mavlink hil_state_quaternion message, were filled with information from non-groundtruth messages. Some of them such as
vehicle_global_position
message is sent by the EKF only after the passing checks. The ground truth gps coordinate was therefore not available from beginning and only for vehicle flying using GPS data for estimation. This is causing issues during integration tests. #14760Is there a reason why the non groundtruth messages were used?
This PR solves this by using the data from the already existing groundtruth variants that are available during simulation. This message is during simulation runs immediately available. From a conceptually standpoint this is also the correct choice. Since the
vehicle_global_position
is filled with the output from the estimator, it is not ground truth data. It is the estimator output which we want to check against some ground truth data.Issues:
In the ground truth information from the simulator is no acceleration information available. This was previously available from the estimator.
It could be that there is a static offset in the global position between groundtruth and the output of the estimator. For the existing checks in the mavsdk tests, this is not a problem, since only groundtruth data is compared to groundtruth data.
Testing:
Visualized message fields through mavlink inspector for ground_truth (plot 1) and estimate (plot) by running iris model in simulation.
Latitude (Attention: offset is visible)
Velocity (Attention: HIL_STATE_QUATERNION's velocitty is in cm/s)
Quaternion q0
Yawspeed
All tests are passing now with speedfactor 1:
Before:
After:
For the non-gps model it is also not comparing 0 against 0 anymore.