Browse Source

Set rate when subscribing to velocity, specify units

sbg
Julian Kent 5 years ago committed by Julian Kent
parent
commit
ff4be5d815
  1. 8
      test/mavsdk_tests/autopilot_tester.cpp
  2. 2
      test/mavsdk_tests/autopilot_tester.h

8
test/mavsdk_tests/autopilot_tester.cpp

@ -246,14 +246,16 @@ void AutopilotTester::offboard_goto(const Offboard::PositionNedYaw &target, floa @@ -246,14 +246,16 @@ void AutopilotTester::offboard_goto(const Offboard::PositionNedYaw &target, floa
std::cout << "Target position reached" << std::endl;
}
void AutopilotTester::check_mission_item_speed_above(int item_index, float min_speed)
void AutopilotTester::check_mission_item_speed_above(int item_index, float min_speed_m_s)
{
_telemetry->subscribe_velocity_ned([item_index, min_speed, this](Telemetry::VelocityNed velocity) {
_telemetry->set_rate_velocity_ned(10);
_telemetry->subscribe_velocity_ned([item_index, min_speed_m_s, this](Telemetry::VelocityNed velocity) {
float horizontal = std::hypot(velocity.north_m_s, velocity.east_m_s);
auto progress = _mission->mission_progress();
if (progress.current == item_index) {
CHECK(horizontal > min_speed);
CHECK(horizontal > min_speed_m_s);
}
});
}

2
test/mavsdk_tests/autopilot_tester.h

@ -80,7 +80,7 @@ public: @@ -80,7 +80,7 @@ public:
std::chrono::seconds timeout_duration = std::chrono::seconds(60));
void offboard_land();
void request_ground_truth();
void check_mission_item_speed_above(int item_index, float min_speed);
void check_mission_item_speed_above(int item_index, float min_speed_m_s);
void check_tracks_mission(float corridor_radius_m = 1.0f);

Loading…
Cancel
Save