Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Terrain fusion aid selection fix #837

Merged
merged 4 commits into from Jun 5, 2020
Merged

Terrain fusion aid selection fix #837

merged 4 commits into from Jun 5, 2020

Conversation

bresch
Copy link
Member

@bresch bresch commented Jun 3, 2020

I tried to split the fixes properly in different commits.

Summary of the fixes:

Due to the sensor_simulator update rate fix, a lot of unit tests are now failing (because EKF prediction step runs slower) and I'm currently fixing them. edit: fixed in #838

@bresch bresch self-assigned this Jun 3, 2020
@bresch bresch force-pushed the pr-terrain-mask branch 2 times, most recently from e632ecc to 37e4bb7 Compare June 3, 2020 14:01
@bresch bresch marked this pull request as ready for review June 3, 2020 14:01
@bresch
Copy link
Member Author

bresch commented Jun 3, 2020

I fixed all the unit tests and placed the modifications in the commit that breaks them: 99f2e33

@bresch bresch marked this pull request as draft June 3, 2020 14:03
@bresch
Copy link
Member Author

bresch commented Jun 3, 2020

This PR started to have too many changes so I pulled the sensor_simulator bugfix in #838

@bresch
Copy link
Member Author

bresch commented Jun 3, 2020

Extracted the aid bitmask feedback to #839

Copy link
Contributor

@kamilritz kamilritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks a lot for the fixes too. I really thought I got the signs for the flow right.

@bresch bresch changed the title Terrain fusion aid selection and feedback + unit test fix Terrain fusion aid selection fix Jun 3, 2020
@bresch bresch marked this pull request as ready for review June 4, 2020 07:45
@bresch bresch requested a review from kamilritz June 4, 2020 07:47
Copy link
Contributor

@kamilritz kamilritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, nice work. I am happy that you also start to use the test frame work regularly.

EKF/terrain_estimator.cpp Outdated Show resolved Hide resolved
test/sensor_simulator/flow.cpp Outdated Show resolved Hide resolved
test/sensor_simulator/gps.cpp Outdated Show resolved Hide resolved
test/sensor_simulator/gps.cpp Outdated Show resolved Hide resolved
test/sensor_simulator/gps.h Outdated Show resolved Hide resolved
test/sensor_simulator/gps.cpp Show resolved Hide resolved
@@ -89,8 +89,8 @@ TEST_F(EkfFlowTest, resetToFlowVelocityInAir)
const Vector2f simulated_horz_velocity(0.5f, -0.2f);
flowSample flow_sample = _sensor_simulator._flow.dataAtRest();
flow_sample.flow_xy_rad =
Vector2f(- simulated_horz_velocity(1) * flow_sample.dt / estimated_distance_to_ground,
simulated_horz_velocity(0) * flow_sample.dt / estimated_distance_to_ground);
Vector2f( simulated_horz_velocity(1) * flow_sample.dt / estimated_distance_to_ground,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why this was passing the test before even tough I got the signs wrong.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because the test was just for the reset counter. There is still a bug in the flow reset that always initializes with zero. The value isn't important.

EXPECT_TRUE(_ekf_wrapper.isIntendingTerrainFlowFusion());

const float estimated_distance_to_ground = _ekf->getTerrainVertPos();
EXPECT_NEAR(estimated_distance_to_ground, flow_height, 0.5f);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have an idea why the error is here higher?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is because the range finder fusion is stronger than the optical flow one. If we let it run more, it will converge to the true value.

@bresch
Copy link
Member Author

bresch commented Jun 4, 2020

@kamilritz Thanks for the review, I'll make the required modifications

@bresch
Copy link
Member Author

bresch commented Jun 5, 2020

@kamilritz Updated, please could you review again?

Copy link
Contributor

@kamilritz kamilritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating.

Copy link
Contributor

@jkflying jkflying left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, really happy to see more of the system being able to be tested automatically.

When we track down why the HAGL estimation is weird during fast attitude changes this will be really helpful!

@bresch bresch merged commit 8f533cb into master Jun 5, 2020
@bresch bresch deleted the pr-terrain-mask branch June 5, 2020 18:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants