Basic_Frame_TypeC_2023_Omni
Loading...
Searching...
No Matches
GimbalApp Class Reference
Inheritance diagram for GimbalApp:
ExtendedRTOSApp< GimbalApp >

Public Member Functions

 GimbalApp (IMessageCenter &message_center_ref, IEventCenter &event_center, IDebug &debug_ref, IMotors &motors_ref)
void init ()
void set_initial_state ()
bool calibrate_start_precondition ()
void wait_for_motors ()
bool exit_calibrate_cond ()
void calibrate ()
void loop ()
bool is_imu_calibrated ()
void set_modes (uint8_t modes[3])
void set_board_mode (BoardMode_t mode)
void set_act_mode (BoardActMode_t mode)
void set_motor_mode (GimbalMotorMode_t mode)
void safe_mode_switch ()
void get_motor_feedback ()
void get_imu_headings ()
void process_commands ()
void calc_imu_center ()
void update_imu_angle (float yaw, float pitch)
void update_ecd_angles ()
void update_headings ()
void update_targets ()
void limit_pitch_target ()
void cmd_exec ()
void send_motor_volts ()
void send_rel_angles ()
Public Member Functions inherited from ExtendedRTOSApp< GimbalApp >
void run (const void *argument)

Static Public Member Functions

static float calc_rel_angle (float angle1, float angle2)
static int16_t calc_ecd_rel_angle (int16_t raw_ecd, int16_t center_offset)

Static Public Attributes

static constexpr uint32_t LOOP_PERIOD_MS = GIMBAL_TASK_EXEC_TIME
static constexpr float PITCH_LOWER_LIMIT = -0.1
static constexpr float PITCH_UPPER_LIMIT = 0.4
static constexpr uint32_t IMU_CENTER_TARGET_SAMPLES = 100

Member Function Documentation

◆ calc_rel_angle()

float GimbalApp::calc_rel_angle ( float angle1,
float angle2 )
static

Calculates the smallest relative angle of angle2 relative to angle1.

Assumes angle1 and angle2 are both in radians ([0, 2 * PI] or (-PI, PI). angle1 and angle2 must have the same origin!!!

The resulting angle assumes clockwise is negative and counter-clockwise is positive.


The documentation for this class was generated from the following files:
  • Core/Src/Applications/Gimbal_App.h
  • Core/Src/Applications/Gimbal_App.cpp