Skip to content

Commit

Permalink
Update proto and fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasVautherin committed Feb 1, 2022
1 parent 408ef24 commit 736f22c
Show file tree
Hide file tree
Showing 16 changed files with 92 additions and 56 deletions.
2 changes: 1 addition & 1 deletion proto
8 changes: 5 additions & 3 deletions src/integration_tests/action_hover_sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ void takeoff_and_hover_at_altitude(float altitude_m)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

auto action = std::make_shared<Action>(*system);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ TEST_F(SitlTest, ActionTransitionSync_standard_vtol)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

// We need to takeoff first, otherwise we can't actually transition
float altitude_m = 10.0f;
Expand Down
16 changes: 10 additions & 6 deletions src/integration_tests/follow_me.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ TEST_F(SitlTest, FollowMeOneLocation)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

Action::Result action_ret = action->arm();
ASSERT_EQ(Action::Result::Success, action_ret);
Expand Down Expand Up @@ -125,9 +127,11 @@ TEST_F(SitlTest, FollowMeMultiLocationWithConfig)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

Action::Result action_ret = action->arm();
ASSERT_EQ(Action::Result::Success, action_ret);
Expand Down
8 changes: 5 additions & 3 deletions src/integration_tests/geofence_inclusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ TEST_F(SitlTest, GeofenceInclusion)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

LogInfo() << "System ready, let's start";

Expand Down
16 changes: 10 additions & 6 deletions src/integration_tests/gimbal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,11 @@ TEST(SitlTestGimbal, GimbalTakeoffAndMove)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

Action::Result action_result = action->arm();
EXPECT_EQ(action_result, Action::Result::Success);
Expand Down Expand Up @@ -260,9 +262,11 @@ TEST(SitlTestGimbal, GimbalROIOffboard)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

const Telemetry::Position& position = telemetry->position();

Expand Down
8 changes: 5 additions & 3 deletions src/integration_tests/mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ void test_mission(
{
LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

LogInfo() << "System ready";
LogInfo() << "Creating and uploading mission";
Expand Down
8 changes: 5 additions & 3 deletions src/integration_tests/mission_change_speed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ TEST_F(SitlTest, MissionChangeSpeed)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

LogInfo() << "System ready, let's start";

Expand Down
8 changes: 5 additions & 3 deletions src/integration_tests/mission_raw_import_and_fly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ TEST_F(SitlTest, MissionRawImportAndFly)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[&telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry.health_all_ok(); }, std::chrono::seconds(10)));
[&telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry.health_all_ok();
},
std::chrono::seconds(10)));

ASSERT_EQ(action.arm(), Action::Result::Success);

Expand Down
8 changes: 5 additions & 3 deletions src/integration_tests/mission_rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ void do_mission_with_rtl(float mission_altitude_m, float return_altitude_m)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

LogInfo() << "Setting RTL return altitude to " << return_altitude_m;
action->set_return_to_launch_altitude(return_altitude_m);
Expand Down
10 changes: 6 additions & 4 deletions src/integration_tests/mission_set_current.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ TEST_F(SitlTest, MissionSetCurrent)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));

[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

LogInfo() << "System ready, let's start";

Mission::MissionPlan mission_plan{};
Expand Down
8 changes: 5 additions & 3 deletions src/integration_tests/offboard_acceleration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ TEST_F(SitlTest, OffboardAccelerationNED)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

Action::Result action_ret = action->arm();
ASSERT_EQ(Action::Result::Success, action_ret);
Expand Down
8 changes: 5 additions & 3 deletions src/integration_tests/offboard_position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ TEST_F(SitlTest, OffboardPositionNED)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

Action::Result action_ret = action->arm();
ASSERT_EQ(Action::Result::Success, action_ret);
Expand Down
16 changes: 10 additions & 6 deletions src/integration_tests/offboard_velocity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ TEST_F(SitlTest, OffboardVelocityNED)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

Action::Result action_ret = action->arm();
ASSERT_EQ(Action::Result::Success, action_ret);
Expand Down Expand Up @@ -149,9 +151,11 @@ TEST_F(SitlTest, OffboardVelocityBody)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

Action::Result action_ret = action->arm();
ASSERT_EQ(Action::Result::Success, action_ret);
Expand Down
8 changes: 5 additions & 3 deletions src/integration_tests/telemetry_gps_origin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ TEST(SitlTestDisabled, TelemetryGpsOrigin)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[&telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry.health_all_ok(); }, std::chrono::seconds(10)));
[&telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry.health_all_ok();
},
std::chrono::seconds(10)));

std::this_thread::sleep_for(std::chrono::seconds(1));

Expand Down
8 changes: 5 additions & 3 deletions src/integration_tests/telemetry_modes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ TEST(SitlTestDisabled, TelemetryFlightModes)

LogInfo() << "Waiting for system to be ready";
ASSERT_TRUE(poll_condition_with_timeout(
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok(); }, std::chrono::seconds(10)));
[telemetry]() {
LogInfo() << "Waiting for system to be ready";
return telemetry->health_all_ok();
},
std::chrono::seconds(10)));

EXPECT_EQ(action->arm(), Action::Result::Success);

Expand Down

0 comments on commit 736f22c

Please sign in to comment.