Line data Source code
1 : #include "AP_RCMapper_config.h" 2 : 3 : #if AP_RCMAPPER_ENABLED 4 : 5 : #include <AP_HAL/AP_HAL.h> 6 : #include "AP_RCMapper.h" 7 : 8 : const AP_Param::GroupInfo RCMapper::var_info[] = { 9 : // @Param: ROLL 10 : // @DisplayName: Roll channel 11 : // @Description: Roll channel number. This is useful when you have a RC transmitter that can't change the channel order easily. Roll is normally on channel 1, but you can move it to any channel with this parameter. Reboot is required for changes to take effect. 12 : // @Range: 1 16 13 : // @Increment: 1 14 : // @User: Advanced 15 : // @RebootRequired: True 16 : AP_GROUPINFO("ROLL", 0, RCMapper, _ch_roll, 1), 17 : 18 : // @Param: PITCH 19 : // @DisplayName: Pitch channel 20 : // @Description: Pitch channel number. This is useful when you have a RC transmitter that can't change the channel order easily. Pitch is normally on channel 2, but you can move it to any channel with this parameter. Reboot is required for changes to take effect. 21 : // @Range: 1 16 22 : // @Increment: 1 23 : // @User: Advanced 24 : // @RebootRequired: True 25 : AP_GROUPINFO("PITCH", 1, RCMapper, _ch_pitch, 2), 26 : 27 : // @Param: THROTTLE 28 : // @DisplayName: Throttle channel 29 : // @Description: Throttle channel number. This is useful when you have a RC transmitter that can't change the channel order easily. Throttle is normally on channel 3, but you can move it to any channel with this parameter. Reboot is required for changes to take effect. 30 : // @Range: 1 16 31 : // @Increment: 1 32 : // @User: Advanced 33 : // @RebootRequired: True 34 : AP_GROUPINFO("THROTTLE", 2, RCMapper, _ch_throttle, 3), 35 : 36 : // @Param: YAW 37 : // @DisplayName: Yaw channel 38 : // @Description: Yaw channel number. This is useful when you have a RC transmitter that can't change the channel order easily. Yaw (also known as rudder) is normally on channel 4, but you can move it to any channel with this parameter. Reboot is required for changes to take effect. 39 : // @Range: 1 16 40 : // @Increment: 1 41 : // @User: Advanced 42 : // @RebootRequired: True 43 : AP_GROUPINFO("YAW", 3, RCMapper, _ch_yaw, 4), 44 : 45 : // @Param{Sub}: FORWARD 46 : // @DisplayName: Forward channel 47 : // @Description: Forward channel number. This is useful when you have a RC transmitter that can't change the channel order easily. Forward is normally on channel 5, but you can move it to any channel with this parameter. Reboot is required for changes to take effect. 48 : // @Range: 1 16 49 : // @Increment: 1 50 : // @User: Advanced 51 : // @RebootRequired: True 52 : AP_GROUPINFO_FRAME("FORWARD", 4, RCMapper, _ch_forward, 6, AP_PARAM_FRAME_SUB), 53 : 54 : // @Param{Sub}: LATERAL 55 : // @DisplayName: Lateral channel 56 : // @Description: Lateral channel number. This is useful when you have a RC transmitter that can't change the channel order easily. Lateral is normally on channel 6, but you can move it to any channel with this parameter. Reboot is required for changes to take effect. 57 : // @Range: 1 16 58 : // @Increment: 1 59 : // @User: Advanced 60 : // @RebootRequired: True 61 : AP_GROUPINFO_FRAME("LATERAL", 5, RCMapper, _ch_lateral, 7, AP_PARAM_FRAME_SUB), 62 : 63 : AP_GROUPEND 64 : }; 65 : 66 : // singleton instance 67 : RCMapper *RCMapper::_singleton; 68 : 69 : // object constructor. 70 2061 : RCMapper::RCMapper(void) 71 : { 72 2061 : if (_singleton != nullptr) { 73 0 : AP_HAL::panic("RCMapper must be singleton"); 74 : } 75 2061 : AP_Param::setup_object_defaults(this, var_info); 76 2061 : _singleton = this; 77 2061 : } 78 : 79 313971 : RCMapper *AP::rcmap() { 80 313971 : return RCMapper::get_singleton(); 81 : } 82 : 83 : #endif // AP_RCMAPPER_ENABLED