2016-05-27 09:59:22 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <GCS_MAVLink/GCS.h>
|
2023-09-07 04:40:19 -03:00
|
|
|
#include <AP_Winch/AP_Winch_config.h>
|
2016-05-27 09:59:22 -03:00
|
|
|
|
2023-08-24 22:46:34 -03:00
|
|
|
#ifndef AC_MAVLINK_SOLO_BUTTON_COMMAND_HANDLING_ENABLED
|
|
|
|
#define AC_MAVLINK_SOLO_BUTTON_COMMAND_HANDLING_ENABLED 1
|
|
|
|
#endif
|
|
|
|
|
2016-05-27 09:59:22 -03:00
|
|
|
class GCS_MAVLINK_Copter : public GCS_MAVLINK
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2019-06-18 07:38:00 -03:00
|
|
|
using GCS_MAVLINK::GCS_MAVLINK;
|
|
|
|
|
2016-05-27 09:59:22 -03:00
|
|
|
protected:
|
|
|
|
|
2016-05-29 20:54:36 -03:00
|
|
|
uint32_t telem_delay() const override;
|
|
|
|
|
2023-09-26 03:25:01 -03:00
|
|
|
MAV_RESULT handle_flight_termination(const mavlink_command_int_t &packet) override;
|
2017-07-07 23:51:10 -03:00
|
|
|
|
2017-07-12 04:21:28 -03:00
|
|
|
uint8_t sysid_my_gcs() const override;
|
2018-12-13 19:12:42 -04:00
|
|
|
bool sysid_enforce() const override;
|
2017-07-12 04:21:28 -03:00
|
|
|
|
2017-08-19 08:23:28 -03:00
|
|
|
bool params_ready() const override;
|
|
|
|
void send_banner() override;
|
|
|
|
|
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;
|
2018-03-17 06:12:57 -03:00
|
|
|
|
2022-02-03 02:29:51 -04:00
|
|
|
void send_attitude_target() override;
|
2018-05-11 08:59:05 -03:00
|
|
|
void send_position_target_global_int() override;
|
2019-03-28 06:42:26 -03:00
|
|
|
void send_position_target_local_ned() override;
|
2018-05-11 08:59:05 -03:00
|
|
|
|
2018-10-13 19:24:43 -03:00
|
|
|
MAV_RESULT handle_command_do_set_roi(const Location &roi_loc) override;
|
2023-09-13 06:01:31 -03:00
|
|
|
MAV_RESULT handle_preflight_reboot(const mavlink_command_int_t &packet, const mavlink_message_t &msg) override;
|
2022-07-15 21:42:08 -03:00
|
|
|
#if HAL_MOUNT_ENABLED
|
2023-08-22 20:42:36 -03:00
|
|
|
MAV_RESULT handle_command_mount(const mavlink_command_int_t &packet, const mavlink_message_t &msg) override;
|
2022-07-15 21:42:08 -03:00
|
|
|
#endif
|
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;
|
2020-06-30 17:48:11 -03:00
|
|
|
MAV_RESULT handle_command_int_do_reposition(const mavlink_command_int_t &packet);
|
2021-11-24 06:46:19 -04:00
|
|
|
MAV_RESULT handle_command_pause_continue(const mavlink_command_int_t &packet);
|
2018-07-03 22:43:51 -03:00
|
|
|
|
2022-07-15 21:42:08 -03:00
|
|
|
#if HAL_MOUNT_ENABLED
|
2019-04-30 07:22:50 -03:00
|
|
|
void handle_mount_message(const mavlink_message_t &msg) override;
|
2022-07-15 21:42:08 -03:00
|
|
|
#endif
|
2018-10-13 19:24:43 -03:00
|
|
|
|
2019-05-31 08:02:12 -03:00
|
|
|
void handle_landing_target(const mavlink_landing_target_t &packet, uint32_t timestamp_ms) override;
|
|
|
|
|
2018-05-29 21:47:08 -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-05-04 21:10:00 -03:00
|
|
|
void send_nav_controller_output() const override;
|
2018-03-28 21:51:26 -03:00
|
|
|
uint64_t capabilities() const override;
|
2018-07-05 21:56:43 -03:00
|
|
|
|
2019-03-14 19:27:34 -03:00
|
|
|
virtual MAV_VTOL_STATE vtol_state() const override { return MAV_VTOL_STATE_MC; };
|
|
|
|
virtual MAV_LANDED_STATE landed_state() const override;
|
2018-04-30 06:50:04 -03:00
|
|
|
|
2022-11-21 23:33:22 -04:00
|
|
|
void handle_manual_control_axes(const mavlink_manual_control_t &packet, const uint32_t tnow) override;
|
|
|
|
|
2016-05-27 09:59:22 -03:00
|
|
|
private:
|
|
|
|
|
2023-05-24 00:39:20 -03:00
|
|
|
// sanity check velocity or acceleration vector components are numbers
|
|
|
|
// (e.g. not NaN) and below 1000. vec argument units are in meters/second or
|
|
|
|
// metres/second/second
|
|
|
|
bool sane_vel_or_acc_vector(const Vector3f &vec) const;
|
|
|
|
|
2023-04-19 03:53:38 -03:00
|
|
|
MISSION_STATE mission_state(const class AP_Mission &mission) const override;
|
|
|
|
|
2019-04-30 07:22:50 -03:00
|
|
|
void handleMessage(const mavlink_message_t &msg) override;
|
|
|
|
void handle_command_ack(const mavlink_message_t &msg) override;
|
2016-05-27 09:59:22 -03:00
|
|
|
bool handle_guided_request(AP_Mission::Mission_Command &cmd) override;
|
|
|
|
bool try_send_message(enum ap_message id) override;
|
|
|
|
|
2016-07-21 09:45:00 -03:00
|
|
|
void packetReceived(const mavlink_status_t &status,
|
2019-04-30 07:22:50 -03:00
|
|
|
const mavlink_message_t &msg) override;
|
2018-03-22 05:50:24 -03:00
|
|
|
|
|
|
|
MAV_MODE base_mode() const override;
|
2019-11-25 22:46:20 -04:00
|
|
|
MAV_STATE vehicle_system_status() const override;
|
2017-11-20 02:30:39 -04:00
|
|
|
|
2020-11-25 00:28:26 -04:00
|
|
|
float vfr_hud_airspeed() const override;
|
2017-11-20 02:30:39 -04:00
|
|
|
int16_t vfr_hud_throttle() const override;
|
2018-11-05 21:04:00 -04:00
|
|
|
float vfr_hud_alt() const override;
|
2017-11-20 02:30:39 -04:00
|
|
|
|
2019-02-28 19:32:26 -04:00
|
|
|
void send_pid_tuning() override;
|
2018-11-05 21:04:00 -04:00
|
|
|
|
2023-10-27 04:26:20 -03:00
|
|
|
#if AP_WINCH_ENABLED
|
2020-07-24 05:40:49 -03:00
|
|
|
void send_winch_status() const override;
|
2023-10-27 04:26:20 -03:00
|
|
|
#endif
|
2020-11-25 00:28:26 -04:00
|
|
|
|
|
|
|
void send_wind() const;
|
2021-07-06 07:30:25 -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
|
2023-08-24 22:46:34 -03:00
|
|
|
|
|
|
|
|
2023-09-20 03:09:23 -03:00
|
|
|
MAV_RESULT handle_MAV_CMD_CONDITION_YAW(const mavlink_command_int_t &packet);
|
2023-09-19 21:09:44 -03:00
|
|
|
MAV_RESULT handle_MAV_CMD_DO_CHANGE_SPEED(const mavlink_command_int_t &packet);
|
2023-09-11 22:01:00 -03:00
|
|
|
MAV_RESULT handle_MAV_CMD_DO_MOTOR_TEST(const mavlink_command_int_t &packet);
|
2023-09-13 05:40:03 -03:00
|
|
|
MAV_RESULT handle_MAV_CMD_DO_PARACHUTE(const mavlink_command_int_t &packet);
|
2023-09-11 22:01:00 -03:00
|
|
|
|
2023-08-24 22:46:34 -03:00
|
|
|
#if AC_MAVLINK_SOLO_BUTTON_COMMAND_HANDLING_ENABLED
|
2023-08-30 21:08:54 -03:00
|
|
|
MAV_RESULT handle_MAV_CMD_SOLO_BTN_FLY_CLICK(const mavlink_command_int_t &packet);
|
|
|
|
MAV_RESULT handle_MAV_CMD_SOLO_BTN_FLY_HOLD(const mavlink_command_int_t &packet);
|
2023-08-24 22:46:34 -03:00
|
|
|
MAV_RESULT handle_MAV_CMD_SOLO_BTN_PAUSE_CLICK(const mavlink_command_int_t &packet);
|
|
|
|
#endif
|
|
|
|
|
2023-11-08 06:31:03 -04:00
|
|
|
#if AP_MAVLINK_COMMAND_LONG_ENABLED
|
2023-10-18 03:30:32 -03:00
|
|
|
bool mav_frame_for_command_long(MAV_FRAME &frame, MAV_CMD packet_command) const override;
|
2023-11-08 06:31:03 -04:00
|
|
|
#endif
|
2023-10-18 03:30:32 -03:00
|
|
|
|
2023-09-19 04:26:22 -03:00
|
|
|
MAV_RESULT handle_MAV_CMD_MISSION_START(const mavlink_command_int_t &packet);
|
2023-10-18 03:30:32 -03:00
|
|
|
MAV_RESULT handle_MAV_CMD_NAV_TAKEOFF(const mavlink_command_int_t &packet);
|
2023-09-19 04:26:22 -03:00
|
|
|
|
2023-09-07 04:40:19 -03:00
|
|
|
#if AP_WINCH_ENABLED
|
|
|
|
MAV_RESULT handle_MAV_CMD_DO_WINCH(const mavlink_command_int_t &packet);
|
|
|
|
#endif
|
|
|
|
|
2016-05-27 09:59:22 -03:00
|
|
|
};
|