forked from ArduPilot/ardupilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RC_Channel.h
49 lines (32 loc) · 1.06 KB
/
RC_Channel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include <RC_Channel/RC_Channel.h>
#include "Rover.h"
#include "mode.h"
class RC_Channel_Rover : public RC_Channel
{
public:
protected:
void init_aux_function(aux_func_t ch_option, aux_switch_pos_t) override;
void do_aux_function(aux_func_t ch_option, aux_switch_pos_t) override;
// called when the mode switch changes position:
void mode_switch_changed(modeswitch_pos_t new_pos) override;
private:
void do_aux_function_change_mode(Mode &mode,
const aux_switch_pos_t ch_flag);
void add_waypoint_for_current_loc();
void do_aux_function_sailboat_motor_3pos(const aux_switch_pos_t ch_flag);
};
class RC_Channels_Rover : public RC_Channels
{
public:
bool has_valid_input() const override;
RC_Channel_Rover obj_channels[NUM_RC_CHANNELS];
RC_Channel_Rover *channel(const uint8_t chan) override {
if (chan > NUM_RC_CHANNELS) {
return nullptr;
}
return &obj_channels[chan];
}
private:
int8_t flight_mode_channel_number() const override;
};