Line data Source code
1 : #pragma once 2 : 3 : #include <GCS_MAVLink/GCS.h> 4 : 5 : #include "defines.h" 6 : 7 : class GCS_MAVLINK_Rover : public GCS_MAVLINK 8 : { 9 : public: 10 : 11 : using GCS_MAVLINK::GCS_MAVLINK; 12 : 13 : protected: 14 : 15 : MAV_RESULT _handle_command_preflight_calibration(const mavlink_command_int_t &packet, const mavlink_message_t &msg) override; 16 : MAV_RESULT handle_command_int_packet(const mavlink_command_int_t &packet, const mavlink_message_t &msg) override; 17 : MAV_RESULT handle_command_int_do_reposition(const mavlink_command_int_t &packet); 18 : 19 : bool get_target_location(Location &loc) const override; 20 : 21 : uint64_t capabilities() const override; 22 : 23 : void send_nav_controller_output() const override; 24 : void send_pid_tuning() override; 25 : 26 : #if HAL_LOGGING_ENABLED 27 0 : uint32_t log_radio_bit() const override { return MASK_LOG_PM; } 28 : #endif 29 : 30 : // Send the mode with the given index (not mode number!) return the total number of modes 31 : // Index starts at 1 32 : uint8_t send_available_mode(uint8_t index) const override; 33 : 34 : private: 35 : 36 : void handle_message(const mavlink_message_t &msg) override; 37 : bool handle_guided_request(AP_Mission::Mission_Command &cmd) override; 38 : bool try_send_message(enum ap_message id) override; 39 : 40 : void handle_manual_control_axes(const mavlink_manual_control_t &packet, const uint32_t tnow) override; 41 : void handle_set_attitude_target(const mavlink_message_t &msg); 42 : void handle_set_position_target_local_ned(const mavlink_message_t &msg); 43 : void handle_set_position_target_global_int(const mavlink_message_t &msg); 44 : void handle_radio(const mavlink_message_t &msg); 45 : void handle_landing_target(const mavlink_landing_target_t &msg, uint32_t timestamp_ms) override; 46 : 47 : // if we receive a message where the user has not masked out 48 : // acceleration from the input packet we send a curt message 49 : // informing them: 50 : void send_acc_ignore_must_be_set_message(const char *msgname); 51 : uint8_t base_mode() const override; 52 : MAV_STATE vehicle_system_status() const override; 53 : 54 : int16_t vfr_hud_throttle() const override; 55 : 56 : #if AP_MAVLINK_MSG_RANGEFINDER_SENDING_ENABLED 57 : void send_rangefinder() const override; 58 : #endif // AP_MAVLINK_MSG_RANGEFINDER_SENDING_ENABLED 59 : 60 : #if AP_RANGEFINDER_ENABLED 61 : // send WATER_DEPTH - metres and temperature 62 : void send_water_depth(); 63 : // state variable for the last rangefinder we sent a WATER_DEPTH 64 : // message for. We cycle through the rangefinder backends to 65 : // limit the amount of telemetry bandwidth we consume. 66 : uint8_t last_WATER_DEPTH_index; 67 : #endif 68 : 69 : #if HAL_HIGH_LATENCY2_ENABLED 70 : uint8_t high_latency_tgt_heading() const override; 71 : uint16_t high_latency_tgt_dist_dam() const override; 72 : uint8_t high_latency_tgt_airspeed() const override; 73 : uint8_t high_latency_wind_speed() const override; 74 : uint8_t high_latency_wind_direction() const override; 75 : #endif // HAL_HIGH_LATENCY2_ENABLED 76 : };