32 #define PITCH_LOOKUP_LENGTH 7
33 #define YAW_LOOKUP_LENGTH 7
35 #define THROTTLE_LOOKUP_LENGTH 12
68 static inline int16_t rc_command_throttle(
struct rc_command *
self) {
return self->throttle; }
71 static inline uint8_t rc_command_tpa(
struct rc_command *
self){
return self->tpa; }
#define THROTTLE_LOOKUP_LENGTH
compile time configuration of the throttle lookup table
Definition: rc_command.h:36
int16_t tpa
Throttle PID Addjustment. TODO: this really does not belong in this class.
Definition: rc_command.h:43
#define YAW_LOOKUP_LENGTH
compile time configuration of the yaw lookup table
Definition: rc_command.h:34
void rc_command_set_rate_config(struct rc_command *self, const struct rate_profile *rates)
Updates internal variables to use new rates and also recalculates the lookup tables if the supplied p...
Definition: rc_command.c:166
struct rx * rx
Definition: rc_command.h:52
int16_t pitch
Definition: rc_command.h:40
void rc_command_update(struct rc_command *self)
Updates current rc rates from the current rc values. Inputs are in range [1000;2000] and should corre...
Definition: rc_command.c:117
#define PITCH_LOOKUP_LENGTH
compile time configuration of the pitch/roll lookup table
Definition: rc_command.h:32
int16_t lookup_yaw[YAW_LOOKUP_LENGTH]
lookup table for expo & RC rate YAW
Definition: rc_command.h:49
int16_t lookup_throttle[THROTTLE_LOOKUP_LENGTH]
lookup table for expo & mid THROTTLE
Definition: rc_command.h:50
RC commands state. Inputs are raw commands in range [1000-2000]. Outputs are RC commands in range [-5...
Definition: rc_command.h:39
int16_t throttle
Definition: rc_command.h:40
int16_t roll
Definition: rc_command.h:40
uint8_t rates[3]
Definition: rate_profile.h:32
int16_t yaw
Definition: rc_command.h:40
Definition: rate_profile.h:26
int16_t lookup_roll_pitch[PITCH_LOOKUP_LENGTH]
lookup table for expo & RC rate PITCH+ROLL
Definition: rc_command.h:48
void rc_command_init(struct rc_command *self, struct rx *rx)
Initializes the curves with default linear ranges.
Definition: rc_command.c:98
const struct rate_profile * config
current rate config
Definition: rc_command.h:46
int16_t rc_command_axis(struct rc_command *self, uint8_t stick)
Get current stick value in range [-500;500], stick is only ROLL, PITCH, YAw.
Definition: rc_command.c:155