mavsdk_tests: prevent missing updates

It seems like we are often missing updates from topics like flight mode
or in air state, both topics that are sent out infrequenctly e.g. at 1
Hz. Therefore, instead of polling for that data we should probably
subscribe to the updates and that way get notified of each an every
update.

For instance this should prevent the case where we miss the mode change
from mission to descend and back to mission once landed and disarmed.
This commit is contained in:
Julian Oes
2021-02-10 13:33:28 +01:00
committed by Daniel Agar
parent 3d9cde885d
commit 176d932f23
2 changed files with 64 additions and 93 deletions

View File

@@ -126,6 +126,9 @@ private:
bool ground_truth_horizontal_position_far_from(const Telemetry::GroundTruth &target_pos, float min_distance_m);
bool estimated_position_close_to(const Offboard::PositionNedYaw &target_pos, float acceptance_radius_m);
bool estimated_horizontal_position_close_to(const Offboard::PositionNedYaw &target_pos, float acceptance_radius_m);
void start_and_wait_for_first_mission_item();
void wait_for_flight_mode(Telemetry::FlightMode flight_mode, std::chrono::seconds timeout);
void wait_for_landed_state(Telemetry::LandedState landed_state, std::chrono::seconds timeout);
std::chrono::milliseconds adjust_to_lockstep_speed(std::chrono::milliseconds duration_ms);