mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Set rate when subscribing to velocity, specify units
This commit is contained in:
parent
e6c5771c59
commit
ff4be5d815
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -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…
x
Reference in New Issue
Block a user