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/RC_Channel_Rover.h
Views: 1798
1
#pragma once
2
3
#include <RC_Channel/RC_Channel.h>
4
#include "Rover.h"
5
#include "mode.h"
6
7
class RC_Channel_Rover : public RC_Channel
8
{
9
10
public:
11
12
protected:
13
14
void init_aux_function(AUX_FUNC ch_option, AuxSwitchPos) override;
15
bool do_aux_function(const AuxFuncTrigger &trigger) override;
16
17
// called when the mode switch changes position:
18
void mode_switch_changed(modeswitch_pos_t new_pos) override;
19
20
private:
21
22
void do_aux_function_change_mode(Mode &mode,
23
const AuxSwitchPos ch_flag);
24
25
void add_waypoint_for_current_loc();
26
27
void do_aux_function_sailboat_motor_3pos(const AuxSwitchPos ch_flag);
28
};
29
30
class RC_Channels_Rover : public RC_Channels
31
{
32
33
public:
34
35
bool in_rc_failsafe() const override;
36
bool has_valid_input() const override;
37
38
RC_Channel *get_arming_channel(void) const override;
39
40
RC_Channel_Rover obj_channels[NUM_RC_CHANNELS];
41
42
RC_Channel_Rover *channel(const uint8_t chan) override {
43
if (chan >= NUM_RC_CHANNELS) {
44
return nullptr;
45
}
46
return &obj_channels[chan];
47
}
48
49
private:
50
51
int8_t flight_mode_channel_number() const override;
52
};
53
54