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/ArduCopter/RC_Channel_Copter.h
Views: 1798
1
#pragma once
2
3
#include <RC_Channel/RC_Channel.h>
4
#include <AP_Motors/AP_Motors.h>
5
#include "mode.h"
6
7
class RC_Channel_Copter : 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
private:
18
19
void do_aux_function_change_mode(const Mode::Number mode,
20
const AuxSwitchPos ch_flag);
21
void do_aux_function_change_air_mode(const AuxSwitchPos ch_flag);
22
void do_aux_function_change_force_flying(const AuxSwitchPos ch_flag);
23
24
// called when the mode switch changes position:
25
void mode_switch_changed(modeswitch_pos_t new_pos) override;
26
27
};
28
29
class RC_Channels_Copter : public RC_Channels
30
{
31
public:
32
33
bool has_valid_input() const override;
34
bool in_rc_failsafe() const override;
35
36
RC_Channel *get_arming_channel(void) const override;
37
38
RC_Channel_Copter obj_channels[NUM_RC_CHANNELS];
39
RC_Channel_Copter *channel(const uint8_t chan) override {
40
if (chan >= NUM_RC_CHANNELS) {
41
return nullptr;
42
}
43
return &obj_channels[chan];
44
}
45
46
// returns true if throttle arming checks should be run
47
bool arming_check_throttle() const override;
48
49
protected:
50
51
int8_t flight_mode_channel_number() const override;
52
53
};
54
55