From 0894cfc0c8d8939ec4795392d3243538f90641c4 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 7 Sep 2023 20:13:30 +1000 Subject: [PATCH] Rover: support preflight calibration via command_int --- Rover/GCS_Mavlink.cpp | 6 +++--- Rover/GCS_Mavlink.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Rover/GCS_Mavlink.cpp b/Rover/GCS_Mavlink.cpp index ae75ca7369..f9a370d3c9 100644 --- a/Rover/GCS_Mavlink.cpp +++ b/Rover/GCS_Mavlink.cpp @@ -610,15 +610,15 @@ bool GCS_MAVLINK_Rover::handle_guided_request(AP_Mission::Mission_Command &cmd) return rover.mode_guided.set_desired_location(cmd.content.location); } -MAV_RESULT GCS_MAVLINK_Rover::_handle_command_preflight_calibration(const mavlink_command_long_t &packet, const mavlink_message_t &msg) +MAV_RESULT GCS_MAVLINK_Rover::_handle_command_preflight_calibration(const mavlink_command_int_t &packet, const mavlink_message_t &msg) { - if (is_equal(packet.param6, 1.0f)) { + if (packet.y == 1) { if (rover.g2.windvane.start_direction_calibration()) { return MAV_RESULT_ACCEPTED; } else { return MAV_RESULT_FAILED; } - } else if (is_equal(packet.param6, 2.0f)) { + } else if (packet.y == 2) { if (rover.g2.windvane.start_speed_calibration()) { return MAV_RESULT_ACCEPTED; } else { diff --git a/Rover/GCS_Mavlink.h b/Rover/GCS_Mavlink.h index 2c22249c0a..f628bfa530 100644 --- a/Rover/GCS_Mavlink.h +++ b/Rover/GCS_Mavlink.h @@ -20,7 +20,7 @@ protected: uint8_t sysid_my_gcs() const override; bool sysid_enforce() const override; - MAV_RESULT _handle_command_preflight_calibration(const mavlink_command_long_t &packet, const mavlink_message_t &msg) override; + MAV_RESULT _handle_command_preflight_calibration(const mavlink_command_int_t &packet, const mavlink_message_t &msg) override; MAV_RESULT handle_command_int_packet(const mavlink_command_int_t &packet, const mavlink_message_t &msg) override; MAV_RESULT handle_command_int_do_reposition(const mavlink_command_int_t &packet); MAV_RESULT handle_command_nav_set_yaw_speed(const mavlink_command_int_t &packet, const mavlink_message_t &msg);