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/ArduPlane/RC_Channel_Plane.h
Views: 1798
1
#pragma once
2
3
#include <RC_Channel/RC_Channel.h>
4
5
class RC_Channel_Plane : public RC_Channel
6
{
7
8
public:
9
10
protected:
11
12
void init_aux_function(AUX_FUNC ch_option,
13
AuxSwitchPos ch_flag) override;
14
bool do_aux_function(const AuxFuncTrigger &trigger) override;
15
16
// called when the mode switch changes position:
17
void mode_switch_changed(modeswitch_pos_t new_pos) override;
18
19
private:
20
21
void do_aux_function_change_mode(Mode::Number number,
22
AuxSwitchPos ch_flag);
23
24
#if HAL_QUADPLANE_ENABLED
25
void do_aux_function_q_assist_state(AuxSwitchPos ch_flag);
26
#endif
27
28
void do_aux_function_crow_mode(AuxSwitchPos ch_flag);
29
30
void do_aux_function_soaring_3pos(AuxSwitchPos ch_flag);
31
32
void do_aux_function_flare(AuxSwitchPos ch_flag);
33
};
34
35
class RC_Channels_Plane : public RC_Channels
36
{
37
public:
38
39
RC_Channel_Plane obj_channels[NUM_RC_CHANNELS];
40
RC_Channel_Plane *channel(const uint8_t chan) override {
41
if (chan >= NUM_RC_CHANNELS) {
42
return nullptr;
43
}
44
return &obj_channels[chan];
45
}
46
47
bool in_rc_failsafe() const override;
48
bool has_valid_input() const override;
49
50
RC_Channel *get_arming_channel(void) const override;
51
52
void read_mode_switch() override;
53
54
protected:
55
56
// note that these callbacks are not presently used on Plane:
57
int8_t flight_mode_channel_number() const override;
58
59
};
60
61