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

Refactor Test Fixture to support different worlds #160

Merged
merged 3 commits into from
Mar 2, 2022

Conversation

arjo129
Copy link
Member

@arjo129 arjo129 commented Feb 28, 2022

Currently, the LrauvTestFixture allows us to only load BuoyantTethys.sdf. This PR refactors the test fixture. It creates two test classes:

  • LrauvTestFixtureBase - An abstract base class which contains all the common functionality.
  • LrauvTestFixture - Inherits from LrauvTestFixtureBase and loads the buoyant_tethys.sdf.

Currently, the `LrauvTestFixture` allows us to only load `BuoyantTethys.sdf`. This PR refactors the test fixture. It creates two test classes:
* `LrauvTestFixtureBase` - An abstract base class which contains all the common functionality.
* `LrauvTestFixture` - Inherits from `LrauvTestFixtureBase` and loads the `buoyant_tethys.sdf`.

Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
@arjo129 arjo129 self-assigned this Feb 28, 2022
arjo129 added a commit that referenced this pull request Feb 28, 2022
Depends on #160

This PR adds a surface at z=0 to the default `buoyant_tethy.sdf`.  Most things work as expected. I had to move the MassShifter test deeper underwater as the vehicle would not pitch enough at the surface (kind of expected I guess?). I moved the mass shifter test deeper under water.

Signed-off-by: Arjo Chakravarty <[email protected]>
arjo129 added a commit that referenced this pull request Feb 28, 2022
Depends on #161, #160

This PR validates the behaviour of the dropweight with the surface of the water. It modifies the drop weight test such that the vehicle is started at a 10m depth and we monitor its rise. The test makes sure that we do not exceed a height of 0.5m (this tolerance is required to account for the oscillations introduces by the transition).

Signed-off-by: Arjo Chakravarty <[email protected]>
// Documentation inherited
protected: void SetUp() override
// Setup the specified world.
// \param[in] _worldName Name of the world to load.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// \param[in] _worldName Name of the world to load.
/// \param[in] _worldName Name of the world to load.

/// \brief Loads the default "buyant_tethys.sdf" world.
class LrauvTestFixture : public LrauvTestFixtureBase
{
/// Documentation inherited
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Documentation inherited
// Documentation inherited

So, within the Ignition codebase, we leave "Documentation inherited" comments to explain that we're not adding documentation on purpose. When it's not added, the documentation is taken from the base class. But if the comment is added with three ///, then that actually overrides the base class' doc block and writes "Documentation inherited" as the documentation.

Not important here since we're not generating docs for these classes, but I thought I should mention

Signed-off-by: Arjo Chakravarty <[email protected]>
@arjo129 arjo129 merged commit e48b561 into main Mar 2, 2022
@arjo129 arjo129 deleted the arjo/refactor/flexible_test_world branch March 2, 2022 01:29
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