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

Make integration tests pass #187

Closed
wants to merge 1 commit into from
Closed

Conversation

hidmic
Copy link
Collaborator

@hidmic hidmic commented Apr 5, 2022

Precisely what the title says. This patch, coupled with some configuration changes for the LRAUV executable to avoid a go-to-surface behavior at the end of each test, makes integration tests pass.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic requested review from arjo129 and chapulina April 5, 2022 20:21
@hidmic
Copy link
Collaborator Author

hidmic commented Apr 5, 2022

FWIW I'm not convinced we should do this. I think we should fix hydrodynamics and tune control loops until the vehicle behaves in a physically sound way, but I'm not going to get in the way if we think it's best to move forward with it as-is.

Copy link
Member

@arjo129 arjo129 left a comment

Choose a reason for hiding this comment

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

I agree with you. These are not really OK. I think for PitchMass we should not test at the surface which is what LrauvTestFixture does we should instead use LrauvTestFixtureAtDepth

@@ -101,16 +86,19 @@ TEST_F(LrauvTestFixture, DepthVBS)
}
}

// Vehicle's final pose should be near the 10m mark
EXPECT_NEAR(tethysPoses.back().Pos().Z(), -10, 1e-1);
// FIXME(hidmic): hydrodynamic damping forces induce
Copy link
Member

Choose a reason for hiding this comment

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

As I mentioned we should not fix this as it will require re-parameterization. I'm hoping adding the cross terms will make this go away.

@@ -88,19 +88,19 @@ TEST_F(LrauvTestFixture, PitchDepthVBS)
for (const auto pose: this->tethysPoses)
{
// Vehicle should dive down.
EXPECT_LT(pose.Pos().Z(), 0.1);
EXPECT_LE(pose.Pos().Z(), 0.5);
Copy link
Member

@arjo129 arjo129 Apr 6, 2022

Choose a reason for hiding this comment

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

This makes sense as there is minor oscillation at the surface but we really should test this at depth.

Copy link
Collaborator Author

@hidmic hidmic Apr 6, 2022

Choose a reason for hiding this comment

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

It's not the oscillation, but the fluid density changing at z = 0.5m (i.e. so going to surface means floating up to z = 0.5m). I was meaning to ask, should the interface be at -0.5m instead?

@@ -89,19 +89,27 @@ TEST_F(LrauvTestFixture, PitchMass)
// Euler.Z = yaw
for(auto pose: this->tethysPoses)
{
// Max Pitch 20 degrees. Allow 5 degrees error for oscillations.
// Min Pitch -5 degrees. Again allow 5 degrees error for oscillation.
// FIXME(hidmic): when surfacing, the vehicle oscillates
Copy link
Member

Choose a reason for hiding this comment

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

I think the problem here is we are testing at the surface which makes behaviors hard to define and will into oscillations. Rather than tweaking this parameter, we should not derive from LrauvTestFixture but have the test derive from LrauvTestFixtureAtDepth. I thought I had done this but its not clearly the case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

On a second inspection, we still get an initial oscillation about pitch = 0 if running the test at a depth (which requires it to be neutrally buoyant) as soon as the LRAUV controller is engaged. I'll check for spurious mass shifter commands.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll check for spurious mass shifter commands.

Indeed. I can see mass shift and vertical fin commands coming through. I can't find anything in mission definitions. A sanity check on startup?

@arjo129
Copy link
Member

arjo129 commented Apr 6, 2022 via email

@hidmic
Copy link
Collaborator Author

hidmic commented Apr 6, 2022

Hmm I wonder if the default behviour ben set is commanding it to go to the
surface first.

It is. We can disable it for tests though (I dropped it from the default behavior, we can drop it from the startup behavior too).

@arjo129
Copy link
Member

arjo129 commented Apr 6, 2022

That might cause a bit of disturbance at the start for pitch-mass I think.

@hidmic
Copy link
Collaborator Author

hidmic commented Apr 21, 2022

Superseded by #189, #192 and its offspring.

@hidmic hidmic closed this Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants