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