2016-05-27 09:53:19 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <GCS_MAVLink/GCS.h>
|
2019-04-04 07:44:18 -03:00
|
|
|
#include <AP_Logger/AP_Logger.h>
|
2022-10-17 05:36:02 -03:00
|
|
|
#include <AP_Airspeed/AP_Airspeed_config.h>
|
2023-10-18 03:30:32 -03:00
|
|
|
#include "quadplane.h"
|
2016-05-27 09:53:19 -03:00
|
|
|
|
|
|
|
class GCS_MAVLINK_Plane : public GCS_MAVLINK
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2019-06-18 07:37:53 -03:00
|
|
|
using GCS_MAVLINK::GCS_MAVLINK;
|
|
|
|
|
2023-06-01 20:14:36 -03:00
|
|
|
uint8_t sysid_my_gcs() const override;
|
|
|
|
|
2016-05-27 09:53:19 -03:00
|
|
|
protected:
|
|
|
|
|
2016-05-29 21:08:39 -03:00
|
|
|
uint32_t telem_delay() const override;
|
|
|
|
|
2023-03-16 03:14:28 -03:00
|
|
|
#if AP_MAVLINK_MISSION_SET_CURRENT_ENABLED
|
2019-04-30 07:22:51 -03:00
|
|
|
void handle_mission_set_current(AP_Mission &mission, const mavlink_message_t &msg) override;
|
2023-03-16 03:14:28 -03:00
|
|
|
#endif
|
2017-07-08 00:12:52 -03:00
|
|
|
|
2018-12-13 19:12:52 -04:00
|
|
|
bool sysid_enforce() const override;
|
2017-07-12 04:41:28 -03:00
|
|
|
|
2023-09-07 07:13:30 -03:00
|
|
|
MAV_RESULT handle_command_preflight_calibration(const mavlink_command_int_t &packet, const mavlink_message_t &msg) override;
|
2023-08-17 04:53:02 -03:00
|
|
|
MAV_RESULT handle_command_int_packet(const mavlink_command_int_t &packet, const mavlink_message_t &msg) override;
|
2023-11-14 04:22:14 -04:00
|
|
|
MAV_RESULT handle_command_do_set_mission_current(const mavlink_command_int_t &packet) override;
|
2018-03-17 06:26:03 -03:00
|
|
|
|
2018-05-11 08:56:26 -03:00
|
|
|
void send_position_target_global_int() override;
|
|
|
|
|
2019-11-24 18:24:02 -04:00
|
|
|
void send_aoa_ssa();
|
2018-05-02 03:51:32 -03:00
|
|
|
void send_attitude() const override;
|
2023-10-13 05:40:09 -03:00
|
|
|
void send_attitude_target() override;
|
2019-11-24 18:28:33 -04:00
|
|
|
void send_wind() const;
|
2018-05-02 03:51:32 -03:00
|
|
|
|
2018-05-21 09:35:28 -03:00
|
|
|
bool persist_streamrates() const override { return true; }
|
|
|
|
|
2018-05-29 20:47:50 -03:00
|
|
|
bool set_home_to_current_location(bool lock) override WARN_IF_UNUSED;
|
|
|
|
bool set_home(const Location& loc, bool lock) override WARN_IF_UNUSED;
|
2018-03-28 22:03:57 -03:00
|
|
|
uint64_t capabilities() const override;
|
2018-07-05 22:12:54 -03:00
|
|
|
|
2018-05-04 21:10:31 -03:00
|
|
|
void send_nav_controller_output() const override;
|
2019-02-28 19:33:00 -04:00
|
|
|
void send_pid_tuning() override;
|
2018-05-04 21:10:31 -03:00
|
|
|
|
2022-11-21 23:35:46 -04:00
|
|
|
void handle_manual_control_axes(const mavlink_manual_control_t &packet, const uint32_t tnow) override;
|
2024-03-04 18:32:24 -04:00
|
|
|
void handle_landing_target(const mavlink_landing_target_t &packet, uint32_t timestamp_ms) override;
|
2022-11-21 23:35:46 -04:00
|
|
|
|
2016-05-27 09:53:19 -03:00
|
|
|
private:
|
|
|
|
|
2023-07-13 21:58:09 -03:00
|
|
|
void send_pid_info(const struct AP_PIDInfo *pid_info, const uint8_t axis, const float achieved);
|
2019-02-28 19:33:00 -04:00
|
|
|
|
2024-01-23 02:41:49 -04:00
|
|
|
void handle_message(const mavlink_message_t &msg) override;
|
2016-05-27 09:53:19 -03:00
|
|
|
bool handle_guided_request(AP_Mission::Mission_Command &cmd) override;
|
|
|
|
void handle_change_alt_request(AP_Mission::Mission_Command &cmd) override;
|
2019-08-05 05:47:44 -03:00
|
|
|
MAV_RESULT handle_command_int_do_reposition(const mavlink_command_int_t &packet);
|
2020-05-16 01:02:01 -03:00
|
|
|
MAV_RESULT handle_command_int_guided_slew_commands(const mavlink_command_int_t &packet);
|
2023-09-20 06:04:24 -03:00
|
|
|
MAV_RESULT handle_MAV_CMD_DO_AUTOTUNE_ENABLE(const mavlink_command_int_t &packet);
|
2023-08-29 18:41:10 -03:00
|
|
|
MAV_RESULT handle_command_DO_CHANGE_SPEED(const mavlink_command_int_t &packet);
|
2023-09-13 20:53:58 -03:00
|
|
|
MAV_RESULT handle_MAV_CMD_DO_MOTOR_TEST(const mavlink_command_int_t &packet);
|
2023-09-19 05:37:08 -03:00
|
|
|
MAV_RESULT handle_MAV_CMD_DO_PARACHUTE(const mavlink_command_int_t &packet);
|
2023-09-11 23:46:10 -03:00
|
|
|
MAV_RESULT handle_command_DO_VTOL_TRANSITION(const mavlink_command_int_t &packet);
|
2019-08-05 05:47:44 -03:00
|
|
|
|
2023-10-18 03:30:32 -03:00
|
|
|
#if HAL_QUADPLANE_ENABLED
|
2023-11-08 06:31:03 -04:00
|
|
|
#if AP_MAVLINK_COMMAND_LONG_ENABLED
|
2023-10-18 03:30:32 -03:00
|
|
|
void convert_MAV_CMD_NAV_TAKEOFF_to_COMMAND_INT(const mavlink_command_long_t &in, mavlink_command_int_t &out);
|
|
|
|
void convert_COMMAND_LONG_to_COMMAND_INT(const mavlink_command_long_t &in, mavlink_command_int_t &out, MAV_FRAME frame = MAV_FRAME_GLOBAL_RELATIVE_ALT) override;
|
2023-11-08 06:31:03 -04:00
|
|
|
#endif
|
2023-10-18 03:30:32 -03:00
|
|
|
MAV_RESULT handle_command_MAV_CMD_NAV_TAKEOFF(const mavlink_command_int_t &packet);
|
|
|
|
#endif
|
|
|
|
|
2016-05-27 09:53:19 -03:00
|
|
|
bool try_send_message(enum ap_message id) override;
|
2019-04-30 07:22:51 -03:00
|
|
|
void packetReceived(const mavlink_status_t &status, const mavlink_message_t &msg) override;
|
2016-05-27 09:53:19 -03:00
|
|
|
|
2018-03-22 06:16:35 -03:00
|
|
|
MAV_MODE base_mode() const override;
|
2019-11-25 22:46:28 -04:00
|
|
|
MAV_STATE vehicle_system_status() const override;
|
2018-05-02 07:40:30 -03:00
|
|
|
|
|
|
|
uint8_t radio_in_rssi() const;
|
2018-01-28 18:59:58 -04:00
|
|
|
|
|
|
|
float vfr_hud_airspeed() const override;
|
|
|
|
int16_t vfr_hud_throttle() const override;
|
|
|
|
float vfr_hud_climbrate() const override;
|
2021-07-06 07:30:59 -03:00
|
|
|
|
|
|
|
#if HAL_HIGH_LATENCY2_ENABLED
|
|
|
|
int16_t high_latency_target_altitude() const override;
|
|
|
|
uint8_t high_latency_tgt_heading() const override;
|
|
|
|
uint16_t high_latency_tgt_dist() const override;
|
|
|
|
uint8_t high_latency_tgt_airspeed() const override;
|
|
|
|
uint8_t high_latency_wind_speed() const override;
|
|
|
|
uint8_t high_latency_wind_direction() const override;
|
|
|
|
#endif // HAL_HIGH_LATENCY2_ENABLED
|
2018-05-23 06:32:35 -03:00
|
|
|
|
2022-10-17 05:36:02 -03:00
|
|
|
#if AP_AIRSPEED_HYGROMETER_ENABLE
|
|
|
|
void send_hygrometer();
|
|
|
|
uint8_t last_hygrometer_send_idx;
|
|
|
|
#endif
|
|
|
|
|
2018-05-23 06:32:35 -03:00
|
|
|
MAV_VTOL_STATE vtol_state() const override;
|
|
|
|
MAV_LANDED_STATE landed_state() const override;
|
|
|
|
|
2016-05-27 09:53:19 -03:00
|
|
|
};
|