2018-05-07 23:35:08 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <RC_Channel/RC_Channel.h>
|
|
|
|
#include "Rover.h"
|
|
|
|
#include "mode.h"
|
|
|
|
|
|
|
|
class RC_Channel_Rover : public RC_Channel
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2020-06-02 23:21:51 -03:00
|
|
|
void init_aux_function(aux_func_t ch_option, AuxSwitchPos) override;
|
2021-02-24 05:48:16 -04:00
|
|
|
bool do_aux_function(aux_func_t ch_option, AuxSwitchPos) override;
|
2018-05-07 23:35:08 -03:00
|
|
|
|
|
|
|
// 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,
|
2020-06-02 23:21:51 -03:00
|
|
|
const AuxSwitchPos ch_flag);
|
2018-05-07 23:35:08 -03:00
|
|
|
|
2018-08-16 23:39:30 -03:00
|
|
|
void add_waypoint_for_current_loc();
|
2019-05-27 11:28:08 -03:00
|
|
|
|
2020-06-02 23:21:51 -03:00
|
|
|
void do_aux_function_sailboat_motor_3pos(const AuxSwitchPos ch_flag);
|
2018-05-07 23:35:08 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
class RC_Channels_Rover : public RC_Channels
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2023-06-22 20:10:42 -03:00
|
|
|
bool in_rc_failsafe() const override;
|
2018-08-01 07:39:27 -03:00
|
|
|
bool has_valid_input() const override;
|
|
|
|
|
2020-04-02 17:44:54 -03:00
|
|
|
RC_Channel *get_arming_channel(void) const override;
|
|
|
|
|
2018-05-07 23:35:08 -03:00
|
|
|
RC_Channel_Rover obj_channels[NUM_RC_CHANNELS];
|
2018-08-01 07:39:27 -03:00
|
|
|
|
2018-05-07 23:35:08 -03:00
|
|
|
RC_Channel_Rover *channel(const uint8_t chan) override {
|
2019-12-19 02:37:07 -04:00
|
|
|
if (chan >= NUM_RC_CHANNELS) {
|
2018-05-07 23:35:08 -03:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return &obj_channels[chan];
|
|
|
|
}
|
|
|
|
|
2018-08-01 07:39:27 -03:00
|
|
|
private:
|
|
|
|
|
|
|
|
int8_t flight_mode_channel_number() const override;
|
2018-05-07 23:35:08 -03:00
|
|
|
};
|