Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
autopilot_static.c File Reference
+ Include dependency graph for autopilot_static.c:

Go to the source code of this file.

Macros

#define RC_LOST_MODE   AP_MODE_HOME
 mode to enter when RC is lost in AP_MODE_MANUAL or AP_MODE_AUTO1 More...
 

Functions

static uint8_t pprz_mode_update (void)
 Update paparazzi mode from RC. More...
 
void autopilot_static_init (void)
 Static autopilot API. More...
 
void autopilot_static_periodic (void)
 
void autopilot_static_on_rc_frame (void)
 Function to be called when a message from FBW is available. More...
 
void autopilot_static_set_mode (uint8_t new_autopilot_mode)
 
void autopilot_static_SetModeHandler (float new_autopilot_mode)
 
void autopilot_static_set_motors_on (bool motors_on)
 
void navigation_task (void)
 Compute desired_course. More...
 
void autopilot_failsafe_checks (void)
 Failsafe checks. More...
 
void attitude_loop (void)
 

Macro Definition Documentation

◆ RC_LOST_MODE

#define RC_LOST_MODE   AP_MODE_HOME

mode to enter when RC is lost in AP_MODE_MANUAL or AP_MODE_AUTO1

Definition at line 50 of file autopilot_static.c.

Function Documentation

◆ attitude_loop()

◆ autopilot_failsafe_checks()

void autopilot_failsafe_checks ( void  )

Failsafe checks.

Autopilot periodic failsafe checks.

Checks order:

  • mode from RC
  • RC lost (if MANUAL or AUTO1)
  • RC kill switch (any case)
  • launch detect from RC
  • GPS lost (if AUTO2 or HOME)
  • too far from HOME (if not HOME or not GPS_OUT_OF_ORDER)

send mode if changed at the end

Definition at line 216 of file autopilot_static.c.

References AP_MODE_AUTO1, AP_MODE_AUTO2, AP_MODE_GPS_OUT_OF_ORDER, AP_MODE_HOME, AP_MODE_MANUAL, autopilot, autopilot_get_mode(), autopilot_send_mode(), autopilot_set_kill_throttle(), autopilot_set_mode(), datalink_lost(), pprz_autopilot::flight_time, gps, higher_than_max_altitude(), GpsState::last_3dfix_time, pprz_autopilot::launch, MIN_PPRZ, sys_time::nb_sec, pprz_mode_update(), radio_control, radio_control_get(), RADIO_KILL_SWITCH, RADIO_THROTTLE, RadioControlIsLost, RC_LOST_MODE, rc_settings(), THROTTLE_THRESHOLD_TAKEOFF, too_far_from_home, and RadioControl::values.

+ Here is the call graph for this function:

◆ autopilot_static_init()

void autopilot_static_init ( void  )

Static autopilot API.

Specific function for static AP.

Static autopilot functions.

Todo:
, properly implement or remove
Todo:
: properly implement/fix a triggered attitude loop

Definition at line 81 of file autopilot_static.c.

References ABI_BROADCAST, AP_MODE_AUTO2, autopilot, lateral_mode, LATERAL_MODE_MANUAL, and pprz_autopilot::mode.

Referenced by autopilot_init().

+ Here is the caller graph for this function:

◆ autopilot_static_on_rc_frame()

void autopilot_static_on_rc_frame ( void  )

Function to be called when a message from FBW is available.

In AUTO1 mode, compute roll setpoint and pitch setpoint from RADIO_ROLL and RADIO_PITCH

Roll is bounded between [-AUTO1_MAX_ROLL;AUTO1_MAX_ROLL]

Pitch is bounded between [-AUTO1_MAX_PITCH;AUTO1_MAX_PITCH]

Else asynchronously set by h_ctl_course_loop()

In AUTO1, throttle comes from RADIO_THROTTLE In MANUAL, the value is copied to get it in the telemetry

else asynchronously set by v_ctl_climb_loop();

Definition at line 100 of file autopilot_static.c.

References AP_MODE_AUTO1, AP_MODE_MANUAL, autopilot, autopilot_get_mode(), commands, FLOAT_OF_PPRZ, h_ctl_pitch_setpoint, h_ctl_roll_setpoint, radio_control, radio_control_get(), RADIO_PITCH, RADIO_ROLL, RADIO_THROTTLE, RADIO_YAW, pprz_autopilot::throttle, v_ctl_throttle_setpoint, and RadioControl::values.

Referenced by autopilot_on_rc_frame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ autopilot_static_periodic()

void autopilot_static_periodic ( void  )

Definition at line 93 of file autopilot_static.c.

Referenced by autopilot_periodic().

+ Here is the caller graph for this function:

◆ autopilot_static_set_mode()

void autopilot_static_set_mode ( uint8_t  new_autopilot_mode)

◆ autopilot_static_set_motors_on()

void autopilot_static_set_motors_on ( bool  motors_on)

Definition at line 152 of file autopilot_static.c.

References autopilot, and pprz_autopilot::motors_on.

Referenced by autopilot_force_motors_on().

+ Here is the caller graph for this function:

◆ autopilot_static_SetModeHandler()

void autopilot_static_SetModeHandler ( float  new_autopilot_mode)

Definition at line 147 of file autopilot_static.c.

References autopilot_static_set_mode().

Referenced by autopilot_SetModeHandler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ navigation_task()

void navigation_task ( void  )

◆ pprz_mode_update()

static uint8_t pprz_mode_update ( void  )
inlinestatic

Update paparazzi mode from RC.

Definition at line 362 of file autopilot_static.c.

References AP_MODE_AUTO1, AP_MODE_AUTO2, AP_MODE_GPS_OUT_OF_ORDER, AP_MODE_HOME, AP_MODE_MANUAL, AP_MODE_OF_PULSE, autopilot_get_mode(), autopilot_set_mode(), b, radio_control_get(), RADIO_MODE, THRESHOLD2, and UNLOCKED_HOME_MODE.

Referenced by autopilot_failsafe_checks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: