mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-07-26 16:28:06 +08:00
mavsdk_tests: report speed factor every second
This helps in debugging slow CI.
This commit is contained in:
@@ -44,13 +44,16 @@
|
||||
#include <mavsdk/plugins/telemetry/telemetry.h>
|
||||
#include <mavsdk/plugins/param/param.h>
|
||||
#include "catch2/catch.hpp"
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <thread>
|
||||
|
||||
extern std::string connection_url;
|
||||
extern std::optional<float> speed_factor;
|
||||
|
||||
using namespace mavsdk;
|
||||
using namespace mavsdk::geometry;
|
||||
@@ -81,6 +84,9 @@ public:
|
||||
Gps
|
||||
};
|
||||
|
||||
AutopilotTester();
|
||||
~AutopilotTester();
|
||||
|
||||
void connect(const std::string uri);
|
||||
void wait_until_ready();
|
||||
void wait_until_ready_local_position_only();
|
||||
@@ -131,6 +137,8 @@ private:
|
||||
void wait_for_landed_state(Telemetry::LandedState landed_state, std::chrono::seconds timeout);
|
||||
void wait_for_mission_finished(std::chrono::seconds timeout);
|
||||
|
||||
void report_speed_factor();
|
||||
|
||||
template<typename Rep, typename Period>
|
||||
bool poll_condition_with_timeout(
|
||||
std::function<bool()> fun, std::chrono::duration<Rep, Period> duration)
|
||||
@@ -216,4 +224,7 @@ private:
|
||||
std::unique_ptr<mavsdk::Telemetry> _telemetry{};
|
||||
|
||||
Telemetry::GroundTruth _home{NAN, NAN, NAN};
|
||||
|
||||
std::atomic<bool> _should_exit {false};
|
||||
std::thread _real_time_report_thread {};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user