forked from Archive/PX4-Autopilot
autopilot_tester: for mission end timeout check take speed factor into account
And increase the (simulation time) timeouts. Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
parent
c5f226761e
commit
2f5c32e500
|
@ -271,9 +271,16 @@ void AutopilotTester::execute_mission()
|
|||
REQUIRE(poll_condition_with_timeout(
|
||||
[this]() { return _mission->start_mission() == Mission::Result::Success; }, std::chrono::seconds(3)));
|
||||
|
||||
// TODO: Adapt time limit based on mission size, flight speed, sim speed factor, etc.
|
||||
float speed_factor = 1.0f;
|
||||
|
||||
wait_for_mission_finished(std::chrono::seconds(90));
|
||||
if (_info != nullptr) {
|
||||
speed_factor = _info->get_speed_factor().second;
|
||||
}
|
||||
|
||||
const float mission_finish_waiting_time_in_simulation_s = 500.f;
|
||||
float mission_finish_waiting_time_in_real_s = mission_finish_waiting_time_in_simulation_s / speed_factor;
|
||||
|
||||
wait_for_mission_finished(std::chrono::seconds(static_cast<int>(mission_finish_waiting_time_in_real_s)));
|
||||
}
|
||||
|
||||
void AutopilotTester::execute_mission_and_lose_gps()
|
||||
|
@ -388,9 +395,16 @@ void AutopilotTester::execute_mission_raw()
|
|||
{
|
||||
REQUIRE(_mission->start_mission() == Mission::Result::Success);
|
||||
|
||||
// TODO: Adapt time limit based on mission size, flight speed, sim speed factor, etc.
|
||||
float speed_factor = 1.0f;
|
||||
|
||||
wait_for_mission_raw_finished(std::chrono::seconds(120));
|
||||
if (_info != nullptr) {
|
||||
speed_factor = _info->get_speed_factor().second;
|
||||
}
|
||||
|
||||
const float waiting_time_simulation_time_s = 300.f; // currently this is tuned for the VTOL wind test
|
||||
float waiting_time_absolute_s = waiting_time_simulation_time_s / speed_factor;
|
||||
|
||||
wait_for_mission_raw_finished(std::chrono::seconds(static_cast<int>(waiting_time_absolute_s)));
|
||||
}
|
||||
|
||||
void AutopilotTester::execute_rtl()
|
||||
|
|
Loading…
Reference in New Issue