22 #ifndef ROVER_GUIDANCE_STEERING_H
23 #define ROVER_GUIDANCE_STEERING_H
34 #include "generated/airframe.h"
37 #ifndef SERVO_MOTOR_THROTTLE_IDX
38 #error "Steering rover firmware requires the servo MOTOR_THROTTLE"
41 #ifndef SERVO_MOTOR_STEERING_IDX
42 #error "Steering rover firmware requires the servo MOTOR_STEERING"
45 #ifndef COMMAND_THROTTLE
46 #error "Steering rover firmware requires the command COMMAND_THROTTLE"
49 #ifndef COMMAND_STEERING
50 #error "Steering rover firmware requires the command COMMAND_STEERING"
60 #define MAX_DELTA 15.0
63 #define MIN_DELTA MAX_DELTA
71 #define MAX_CMD_SHUT 0
74 #define MIN_CMD_SHUT 0
79 #define MAX_SPEED 999.0
86 #ifndef DRIVE_SHAFT_DISTANCE
87 #define DRIVE_SHAFT_DISTANCE 0.25
88 #warning "Construction variable DRIVE_SHAFT_DISTANCE for steering wheel rover not defined"
92 #ifndef SR_MEASURED_KF
93 #define SR_MEASURED_KF 10
94 #warning "Construction constant SR_MEASURED_KF for steering wheel rover not defined"
128 #define BoundDelta(delta) (delta < -MIN_DELTA ? -MIN_DELTA : \
129 (delta > MAX_DELTA ? MAX_DELTA : \
133 #define BoundSpeed(speed) (speed < MIN_SPEED ? MIN_SPEED : \
134 (speed > MAX_SPEED ? MAX_SPEED : \
138 #define BoundThrottle(throttle) TRIM_PPRZ((int)throttle)
141 #define GetCmdFromDelta(delta) (delta >= 0 ? -delta/MAX_DELTA * (MAX_PPRZ - (int)MAX_CMD_SHUT) : \
142 -delta/MIN_DELTA * (MAX_PPRZ - (int)MIN_CMD_SHUT))
145 #define GetCmdFromThrottle(throttle) (autopilot_throttle_killed() ? 0 : TRIM_PPRZ((int)throttle))
148 #define SetAPThrottleFromCommands(void) { \
149 autopilot.throttle = commands[COMMAND_THROTTLE]; \
void rover_guidance_steering_kill(void)
rover_ctrl guidance_control
Mandatory dependencies header.
void rover_guidance_steering_speed_ctrl(void)
void rover_guidance_steering_init(void)
Steering rover guidance EXT FUNCTIONS.
void rover_guidance_steering_pid_reset(void)
PID RESET function.
void rover_guidance_steering_heading_ctrl(float omega)
CTRL functions.
Steering rover guidance STRUCTURES.