CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Rover/GCS_MAVLink_Rover.h
Views: 1798
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
uint32_t telem_delay() const override;
21
22
uint8_t sysid_my_gcs() const override;
23
bool sysid_enforce() const override;
24
25
MAV_RESULT _handle_command_preflight_calibration(const mavlink_command_int_t &packet, const mavlink_message_t &msg) override;
26
MAV_RESULT handle_command_int_packet(const mavlink_command_int_t &packet, const mavlink_message_t &msg) override;
27
MAV_RESULT handle_command_int_do_reposition(const mavlink_command_int_t &packet);
28
MAV_RESULT handle_command_nav_set_yaw_speed(const mavlink_command_int_t &packet, const mavlink_message_t &msg);
29
30
void send_position_target_global_int() override;
31
32
uint64_t capabilities() const override;
33
34
void send_nav_controller_output() const override;
35
void send_pid_tuning() override;
36
37
#if HAL_LOGGING_ENABLED
38
uint32_t log_radio_bit() const override { return MASK_LOG_PM; }
39
#endif
40
41
// Send the mode with the given index (not mode number!) return the total number of modes
42
// Index starts at 1
43
uint8_t send_available_mode(uint8_t index) const override;
44
45
private:
46
47
void handle_message(const mavlink_message_t &msg) override;
48
bool handle_guided_request(AP_Mission::Mission_Command &cmd) override;
49
bool try_send_message(enum ap_message id) override;
50
51
void handle_manual_control_axes(const mavlink_manual_control_t &packet, const uint32_t tnow) override;
52
void handle_set_attitude_target(const mavlink_message_t &msg);
53
void handle_set_position_target_local_ned(const mavlink_message_t &msg);
54
void handle_set_position_target_global_int(const mavlink_message_t &msg);
55
void handle_radio(const mavlink_message_t &msg);
56
void handle_landing_target(const mavlink_landing_target_t &msg, uint32_t timestamp_ms) override;
57
58
void send_servo_out();
59
60
void packetReceived(const mavlink_status_t &status, const mavlink_message_t &msg) override;
61
62
MAV_MODE base_mode() const override;
63
MAV_STATE vehicle_system_status() const override;
64
65
int16_t vfr_hud_throttle() const override;
66
67
#if AP_RANGEFINDER_ENABLED
68
void send_rangefinder() const override;
69
70
// send WATER_DEPTH - metres and temperature
71
void send_water_depth();
72
// state variable for the last rangefinder we sent a WATER_DEPTH
73
// message for. We cycle through the rangefinder backends to
74
// limit the amount of telemetry bandwidth we consume.
75
uint8_t last_WATER_DEPTH_index;
76
#endif
77
78
#if HAL_HIGH_LATENCY2_ENABLED
79
uint8_t high_latency_tgt_heading() const override;
80
uint16_t high_latency_tgt_dist() const override;
81
uint8_t high_latency_tgt_airspeed() const override;
82
uint8_t high_latency_wind_speed() const override;
83
uint8_t high_latency_wind_direction() const override;
84
#endif // HAL_HIGH_LATENCY2_ENABLED
85
};
86
87