2016-02-17 21:25:45 -04:00
|
|
|
#pragma once
|
2013-03-24 23:47:51 -03:00
|
|
|
|
|
|
|
#include <inttypes.h>
|
2015-08-11 03:28:45 -03:00
|
|
|
#include <AP_Common/AP_Common.h>
|
|
|
|
#include <AP_Param/AP_Param.h>
|
2013-03-24 23:47:51 -03:00
|
|
|
|
2017-08-28 21:40:36 -03:00
|
|
|
class RCMapper {
|
2013-03-24 23:47:51 -03:00
|
|
|
public:
|
2017-12-12 21:06:13 -04:00
|
|
|
RCMapper();
|
2017-08-28 21:40:36 -03:00
|
|
|
|
|
|
|
/* Do not allow copies */
|
2022-09-30 06:50:43 -03:00
|
|
|
CLASS_NO_COPY(RCMapper);
|
2013-03-24 23:47:51 -03:00
|
|
|
|
2019-12-01 11:32:14 -04:00
|
|
|
// get singleton instance
|
|
|
|
static RCMapper *get_singleton()
|
|
|
|
{
|
|
|
|
return _singleton;
|
|
|
|
}
|
|
|
|
|
2013-03-24 23:47:51 -03:00
|
|
|
/// roll - return input channel number for roll / aileron input
|
|
|
|
uint8_t roll() const { return _ch_roll; }
|
|
|
|
|
|
|
|
/// pitch - return input channel number for pitch / elevator input
|
|
|
|
uint8_t pitch() const { return _ch_pitch; }
|
|
|
|
|
|
|
|
/// throttle - return input channel number for throttle input
|
|
|
|
uint8_t throttle() const { return _ch_throttle; }
|
|
|
|
|
|
|
|
/// yaw - return input channel number for yaw / rudder input
|
|
|
|
uint8_t yaw() const { return _ch_yaw; }
|
|
|
|
|
2017-02-07 23:50:57 -04:00
|
|
|
/// forward - return input channel number for forward input
|
|
|
|
uint8_t forward() const { return _ch_forward; }
|
|
|
|
|
|
|
|
/// lateral - return input channel number for lateral input
|
|
|
|
uint8_t lateral() const { return _ch_lateral; }
|
|
|
|
|
2013-03-24 23:47:51 -03:00
|
|
|
static const struct AP_Param::GroupInfo var_info[];
|
|
|
|
|
|
|
|
private:
|
|
|
|
// channel mappings
|
|
|
|
AP_Int8 _ch_roll;
|
|
|
|
AP_Int8 _ch_pitch;
|
|
|
|
AP_Int8 _ch_yaw;
|
|
|
|
AP_Int8 _ch_throttle;
|
2017-02-07 23:50:57 -04:00
|
|
|
AP_Int8 _ch_forward;
|
|
|
|
AP_Int8 _ch_lateral;
|
2019-12-01 11:32:14 -04:00
|
|
|
static RCMapper *_singleton;
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace AP
|
|
|
|
{
|
|
|
|
RCMapper *rcmap();
|
2013-03-24 23:47:51 -03:00
|
|
|
};
|