Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
autopilot_static.c File Reference

Static autopilot implementation. More...

+ Include dependency graph for autopilot_static.c:

Go to the source code of this file.

Macros

#define FAILSAFE_MODE_TOO_FAR_FROM_HOME   AP_MODE_FAILSAFE
 Mode that is set when the plane is really too far from home. More...
 
#define MODE_STARTUP   AP_MODE_KILL
 
#define UNLOCKED_HOME_MODE   TRUE
 
#define NAV_PRESCALER   (PERIODIC_FREQUENCY / NAV_FREQ)
 

Functions

void autopilot_static_init (void)
 Static autopilot functions. More...
 
void autopilot_static_periodic (void)
 
void autopilot_static_SetModeHandler (float mode)
 AP mode setting handler. More...
 
void autopilot_static_set_mode (uint8_t new_autopilot_mode)
 
void autopilot_static_set_motors_on (bool motors_on)
 
void autopilot_static_on_rc_frame (void)
 Function to be called when a message from FBW is available. More...
 

Detailed Description

Static autopilot implementation.

Definition in file autopilot_static.c.

Macro Definition Documentation

#define FAILSAFE_MODE_TOO_FAR_FROM_HOME   AP_MODE_FAILSAFE

Mode that is set when the plane is really too far from home.

Definition at line 79 of file autopilot_static.c.

Referenced by autopilot_static_periodic().

#define MODE_STARTUP   AP_MODE_KILL

Definition at line 84 of file autopilot_static.c.

Referenced by autopilot_static_init(), and autopilot_static_set_mode().

#define NAV_PRESCALER   (PERIODIC_FREQUENCY / NAV_FREQ)

Definition at line 121 of file autopilot_static.c.

Referenced by autopilot_static_periodic().

#define UNLOCKED_HOME_MODE   TRUE

Definition at line 90 of file autopilot_static.c.

Referenced by autopilot_static_on_rc_frame(), and pprz_mode_update().

Function Documentation

void autopilot_static_init ( void  )

Static autopilot functions.

Specific function for static AP.

Static autopilot functions.

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

Definition at line 105 of file autopilot_static.c.

References ABI_BROADCAST, AP_MODE_AUTO2, AP_MODE_KILL, autopilot, autopilot_arming_init(), autopilot_static_set_mode(), gps_lost, lateral_mode, LATERAL_MODE_MANUAL, pprz_autopilot::mode, and MODE_STARTUP.

+ Here is the call graph for this function:

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 339 of file autopilot_static.c.

References ap_ahrs_is_aligned(), AP_ARMING_STATUS_AHRS_NOT_ALLIGNED, ap_electrical, AP_MODE_AUTO1, AP_MODE_AUTO2, AP_MODE_FAILSAFE, AP_MODE_GPS_OUT_OF_ORDER, AP_MODE_HOME, AP_MODE_KILL, AP_MODE_MANUAL, AP_MODE_NAV, ap_mode_of_3way_switch(), pprz_autopilot::arming_status, autopilot, autopilot_arming_check_motors_on(), autopilot_get_mode(), autopilot_in_flight(), autopilot_send_mode(), autopilot_set_kill_throttle(), autopilot_set_mode(), autopilot_static_set_mode(), commands, copy_from_to_fbw(), datalink_lost(), fbw_state, pprz_autopilot::flight_time, FLOAT_OF_PPRZ, GpsIsLost, guidance_h_read_rc(), guidance_v_read_rc(), h_ctl_pitch_setpoint, h_ctl_roll_setpoint, higher_than_max_altitude(), kill_switch_is_on(), pprz_autopilot::kill_throttle, pprz_autopilot::launch, mcu1_ppm_cpt, mcu1_status_update(), MIN_PPRZ, pprz_autopilot::mode, MODE_MANUAL, pprz_autopilot::motors_on, pprz_mode_update(), PPRZ_MUTEX_LOCK, PPRZ_MUTEX_UNLOCK, radio_control, RADIO_KILL_SWITCH, RADIO_PITCH, RADIO_ROLL, RADIO_THROTTLE, RADIO_YAW, RC_LOST_MODE, rc_settings(), THROTTLE_THRESHOLD_TAKEOFF, too_far_from_home, UNLOCKED_HOME_MODE, v_ctl_throttle_setpoint, and RadioControl::values.

+ Here is the call graph for this function:

void autopilot_static_set_motors_on ( bool  motors_on)

Definition at line 329 of file autopilot_static.c.

References ap_ahrs_is_aligned(), AP_MODE_KILL, autopilot, autopilot_arming_set(), pprz_autopilot::mode, and pprz_autopilot::motors_on.

+ Here is the call graph for this function:

void autopilot_static_SetModeHandler ( float  mode)

AP mode setting handler.

Checks RC status before calling autopilot_static_set_mode function

Definition at line 187 of file autopilot_static.c.

References AP_MODE_FAILSAFE, AP_MODE_FLIP, AP_MODE_GUIDED, AP_MODE_HOME, AP_MODE_KILL, AP_MODE_MODULE, AP_MODE_NAV, autopilot_static_set_mode(), radio_control, RC_OK, and RadioControl::status.

+ Here is the call graph for this function: