Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina committed Nov 4, 2021
1 parent 8aa63a7 commit 1181aa3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
13 changes: 11 additions & 2 deletions lrauv_ignition_plugins/proto/lrauv_command.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ message LRAUVCommand
// Higher values have the vertical fins
// rotated more clockwise when looking
// from the top (i.e. to starboard)
float elevatorAngle_ = 4;
float elevatorAngle_ = 4; // Angle that the controller believes the
// elevator is currently at. Unit: radians.
// Higher values have the horizontal fins
// rotated more counter-clockwise when
// looking from starboard, which tilts the
// nose downward when moving forward.
float massPosition_ = 5; // Position where the controller believes
// the mass shifter's joint is in. Unit:
// meters. Positive values have the battery
Expand All @@ -57,7 +62,11 @@ message LRAUVCommand
// radians. Higher values rotate the
// vertical fins clockwise when looking
// from the top (i.e. to starboard)
float elevatorAngleAction_ = 10;
float elevatorAngleAction_ = 10; // Target angle for the elevator joint.
// Unit: radians. Higher values rotate
// vertical fins more counter-clockwise
// when looking from starboard, which tilts
// the nose downward when moving forward.
float massPositionAction_ = 11; // Target position for the battery's joint.
// Unit: meters. Positive values move the
// battery forward, tilting the nose
Expand Down
20 changes: 16 additions & 4 deletions lrauv_ignition_plugins/test/test_elevator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ TEST_F(LrauvTestFixture, Elevator)
cmdMsg.set_propomegaaction_(30);

// Rotate elevator counter-clockwise when looking from starboard, which
// causes the vehicle to move down
cmdMsg.set_elevatorangleaction_(0.8);
// causes the vehicle to pitch down
cmdMsg.set_elevatorangleaction_(0.27);

// Neutral buoyancy
cmdMsg.set_buoyancyaction_(0.0005);
cmdMsg.set_dropweightstate_(true);

// Run server until the command is processed and the model reaches a certain
// point vertically
Expand All @@ -54,10 +55,21 @@ TEST_F(LrauvTestFixture, Elevator)
return this->tethysPoses.back().Pos().Z() > targetZ;
});

EXPECT_LT(100, this->iterations);
EXPECT_LT(100, this->tethysPoses.size());
EXPECT_LT(1000, this->iterations);
EXPECT_LT(1000, this->tethysPoses.size());

// Vehicle goes down
EXPECT_GT(targetZ, this->tethysPoses.back().Pos().Z());

for (int i = 0; i < this->tethysPoses.size(); ++i)
{
auto pose = this->tethysPoses[i];

// FIXME(anyone) It goes up a little bit in the beginning
if (i < 1000)
EXPECT_GT(0.2, pose.Pos().Z()) << i << " -- " << pose.Pos().Z();
else
EXPECT_GT(0.0, pose.Pos().Z()) << i << " -- " << pose.Pos().Z();
}
}

0 comments on commit 1181aa3

Please sign in to comment.