|
Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Autopilot static implementation. More...
Go to the source code of this file.
Macros | |
| #define | AP_MODE_KILL 0 |
| Static autopilot modes. | |
| #define | AP_MODE_FAILSAFE 1 |
| #define | AP_MODE_HOME 2 |
| #define | AP_MODE_RATE_DIRECT 3 |
| #define | AP_MODE_ATTITUDE_DIRECT 4 |
| #define | AP_MODE_RATE_RC_CLIMB 5 |
| #define | AP_MODE_ATTITUDE_RC_CLIMB 6 |
| #define | AP_MODE_ATTITUDE_CLIMB 7 |
| #define | AP_MODE_RATE_Z_HOLD 8 |
| #define | AP_MODE_ATTITUDE_Z_HOLD 9 |
| #define | AP_MODE_HOVER_DIRECT 10 |
| #define | AP_MODE_HOVER_CLIMB 11 |
| #define | AP_MODE_HOVER_Z_HOLD 12 |
| #define | AP_MODE_NAV 13 |
| #define | AP_MODE_RC_DIRECT 14 |
| #define | AP_MODE_CARE_FREE_DIRECT 15 |
| #define | AP_MODE_FORWARD 16 |
| #define | AP_MODE_GUIDED 19 |
| #define | MODE_MANUAL AP_MODE_ATTITUDE_DIRECT |
| Default RC mode. | |
| #define | MODE_AUTO1 AP_MODE_HOVER_Z_HOLD |
| #define | MODE_AUTO2 AP_MODE_NAV |
Functions | |
| void | autopilot_static_init (void) |
| Specific function for static AP. | |
| void | autopilot_static_periodic (void) |
| void | autopilot_static_on_rc_frame (void) |
| Function to be called when a message from FBW is available. | |
| void | autopilot_static_set_mode (uint8_t new_autopilot_mode) |
| void | autopilot_static_SetModeHandler (float new_autopilot_mode) |
| AP mode setting handler. | |
| void | autopilot_static_set_motors_on (bool motors_on) |
Autopilot static implementation.
Definition in file autopilot_static.h.
| #define AP_MODE_ATTITUDE_CLIMB 7 |
Definition at line 42 of file autopilot_static.h.
Referenced by autopilot_static_set_mode(), and mavlink_send_heartbeat().
| #define AP_MODE_ATTITUDE_DIRECT 4 |
Definition at line 39 of file autopilot_static.h.
Referenced by autopilot_static_set_mode(), mavlink_send_heartbeat(), and wedgebug_periodic().
| #define AP_MODE_ATTITUDE_RC_CLIMB 6 |
Definition at line 41 of file autopilot_static.h.
Referenced by autopilot_static_set_mode(), and mavlink_send_heartbeat().
| #define AP_MODE_ATTITUDE_Z_HOLD 9 |
Definition at line 44 of file autopilot_static.h.
Referenced by autopilot_static_set_mode(), mavlink_send_heartbeat(), and wedgebug_periodic().
| #define AP_MODE_CARE_FREE_DIRECT 15 |
Definition at line 50 of file autopilot_static.h.
Referenced by autopilot_static_set_mode(), and mavlink_send_heartbeat().
| #define AP_MODE_FAILSAFE 1 |
Definition at line 36 of file autopilot_static.h.
Referenced by autopilot_arming_check_motors_on(), autopilot_arming_set(), autopilot_event(), autopilot_failsafe_checks(), autopilot_static_on_rc_frame(), autopilot_static_periodic(), autopilot_static_set_mode(), autopilot_static_SetModeHandler(), nav_set_failsafe(), rotwing_state_periodic(), and throttle_curve_run().
| #define AP_MODE_FORWARD 16 |
Definition at line 51 of file autopilot_static.h.
Referenced by autopilot_static_set_mode().
| #define AP_MODE_GUIDED 19 |
Definition at line 52 of file autopilot_static.h.
Referenced by autopilot_failsafe_checks(), autopilot_static_set_mode(), autopilot_static_SetModeHandler(), mavlink_common_message_handler(), mavlink_send_heartbeat(), and wedgebug_periodic().
| #define AP_MODE_HOME 2 |
Definition at line 37 of file autopilot_static.h.
| #define AP_MODE_HOVER_CLIMB 11 |
Definition at line 46 of file autopilot_static.h.
Referenced by autopilot_static_set_mode(), and mavlink_send_heartbeat().
| #define AP_MODE_HOVER_DIRECT 10 |
Definition at line 45 of file autopilot_static.h.
Referenced by autopilot_static_set_mode(), and mavlink_send_heartbeat().
| #define AP_MODE_HOVER_Z_HOLD 12 |
Definition at line 47 of file autopilot_static.h.
Referenced by autopilot_static_set_mode(), and mavlink_send_heartbeat().
| #define AP_MODE_KILL 0 |
Static autopilot modes.
Definition at line 35 of file autopilot_static.h.
Referenced by autopilot_arming_check_motors_on(), autopilot_arming_check_motors_on(), autopilot_arming_check_motors_on(), autopilot_arming_set(), autopilot_failsafe_checks(), autopilot_generated_set_motors_on(), autopilot_static_init(), autopilot_static_on_rc_frame(), autopilot_static_periodic(), autopilot_static_set_mode(), autopilot_static_set_motors_on(), autopilot_static_SetModeHandler(), and check_parachute_trigger().
| #define AP_MODE_NAV 13 |
Definition at line 48 of file autopilot_static.h.
Referenced by autopilot_failsafe_checks(), autopilot_static_on_rc_frame(), autopilot_static_periodic(), autopilot_static_set_mode(), autopilot_static_SetModeHandler(), guidance_module_run(), mavlink_common_message_handler(), mavlink_send_heartbeat(), NavKillThrottle(), NavResurrect(), rotwing_state_choose_state_by_dist(), throttle_curve_run(), and wedgebug_periodic().
| #define AP_MODE_RATE_DIRECT 3 |
Definition at line 38 of file autopilot_static.h.
Referenced by autopilot_static_set_mode(), check_parachute_arming(), and mavlink_send_heartbeat().
| #define AP_MODE_RATE_RC_CLIMB 5 |
Definition at line 40 of file autopilot_static.h.
Referenced by autopilot_static_set_mode(), and mavlink_send_heartbeat().
| #define AP_MODE_RATE_Z_HOLD 8 |
Definition at line 43 of file autopilot_static.h.
Referenced by autopilot_static_set_mode(), and mavlink_send_heartbeat().
| #define AP_MODE_RC_DIRECT 14 |
Definition at line 49 of file autopilot_static.h.
Referenced by autopilot_static_set_mode(), and mavlink_send_heartbeat().
| #define MODE_AUTO1 AP_MODE_HOVER_Z_HOLD |
Definition at line 61 of file autopilot_static.h.
Referenced by ap_mode_of_3way_switch().
| #define MODE_AUTO2 AP_MODE_NAV |
Definition at line 64 of file autopilot_static.h.
Referenced by ap_mode_of_3way_switch(), autopilot_firmware_init(), and autopilot_init().
| #define MODE_MANUAL AP_MODE_ATTITUDE_DIRECT |
Default RC mode.
Definition at line 58 of file autopilot_static.h.
Referenced by ap_mode_of_3way_switch(), autopilot_arming_check_motors_on(), autopilot_arming_check_motors_on(), autopilot_arming_check_valid(), autopilot_arming_set(), and autopilot_static_on_rc_frame().
|
extern |
Specific function for static AP.
Specific function for static AP.
Static autopilot functions.
Definition at line 81 of file autopilot_static.c.
References ABI_BROADCAST, AP_MODE_AUTO2, AP_MODE_KILL, autopilot, autopilot_arming_init(), autopilot_static_set_mode(), lateral_mode, LATERAL_MODE_MANUAL, and MODE_STARTUP.
Referenced by autopilot_init().
|
extern |
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_FAILSAFE, AP_MODE_HOME, AP_MODE_KILL, AP_MODE_MANUAL, AP_MODE_NAV, ap_mode_of_3way_switch(), autopilot, autopilot_arming_check_motors_on(), autopilot_get_mode(), autopilot_static_set_mode(), commands, FLOAT_OF_PPRZ, GpsIsLost, h_ctl_pitch_setpoint, h_ctl_roll_setpoint, kill_switch_is_on(), MODE_MANUAL, nav, radio_control, radio_control_get(), RADIO_PITCH, RADIO_ROLL, RADIO_THROTTLE, RADIO_YAW, UNLOCKED_HOME_MODE, and v_ctl_throttle_setpoint.
Referenced by autopilot_on_rc_frame().
|
extern |
Definition at line 93 of file autopilot_static.c.
References AP_MODE_FAILSAFE, AP_MODE_HOME, AP_MODE_KILL, AP_MODE_NAV, autopilot, autopilot_in_flight(), autopilot_static_set_mode(), commands, commands_failsafe, compute_dist2_to_home(), datalink_lost(), FAILSAFE_MODE_TOO_FAR_FROM_HOME, guidance_h, GUIDANCE_H_MODE_NONE, guidance_h_run(), guidance_v_run(), higher_than_max_altitude(), nav, nav_home(), nav_periodic_task(), NAV_PRESCALER, SetRotorcraftCommands, stabilization, stabilization_get_failsafe_sp(), stabilization_run(), th_sp_from_thrust_i(), THRUST_AXIS_Z, and thrust_sp.
Referenced by autopilot_periodic().
|
extern |
Definition at line 140 of file autopilot_static.c.
References AP_MODE_ATTITUDE_CLIMB, AP_MODE_ATTITUDE_DIRECT, AP_MODE_ATTITUDE_RC_CLIMB, AP_MODE_ATTITUDE_Z_HOLD, AP_MODE_CARE_FREE_DIRECT, AP_MODE_FAILSAFE, AP_MODE_FORWARD, AP_MODE_GUIDED, AP_MODE_HOME, AP_MODE_HOVER_CLIMB, AP_MODE_HOVER_DIRECT, AP_MODE_HOVER_Z_HOLD, AP_MODE_KILL, AP_MODE_NAV, AP_MODE_RATE_DIRECT, AP_MODE_RATE_RC_CLIMB, AP_MODE_RATE_Z_HOLD, AP_MODE_RC_DIRECT, autopilot, autopilot_set_in_flight(), autopilot_set_motors_on(), FAILSAFE_DESCENT_SPEED, guidance_h_mode_changed(), GUIDANCE_H_MODE_GUIDED, GUIDANCE_H_MODE_HOVER, GUIDANCE_H_MODE_NAV, GUIDANCE_H_MODE_NONE, guidance_v_mode_changed(), GUIDANCE_V_MODE_CLIMB, GUIDANCE_V_MODE_GUIDED, GUIDANCE_V_MODE_HOVER, GUIDANCE_V_MODE_KILL, GUIDANCE_V_MODE_NAV, GUIDANCE_V_MODE_RC_CLIMB, GUIDANCE_V_MODE_RC_DIRECT, guidance_v_set_vz(), stabilization, STABILIZATION_ATT_SUBMODE_CARE_FREE, STABILIZATION_ATT_SUBMODE_FORWARD, STABILIZATION_ATT_SUBMODE_HEADING, STABILIZATION_MODE_ATTITUDE, stabilization_mode_changed(), STABILIZATION_MODE_DIRECT, STABILIZATION_MODE_NONE, and STABILIZATION_MODE_RATE.
Referenced by autopilot_set_mode(), autopilot_static_init(), autopilot_static_on_rc_frame(), autopilot_static_periodic(), autopilot_static_SetModeHandler(), and autopilot_static_SetModeHandler().
|
extern |
Definition at line 152 of file autopilot_static.c.
References AP_MODE_KILL, autopilot, and autopilot_arming_set().
Referenced by autopilot_force_motors_on().
|
extern |
AP mode setting handler.
Checks RC status before calling autopilot_static_set_mode function
Definition at line 147 of file autopilot_static.c.
References AP_MODE_FAILSAFE, AP_MODE_GUIDED, AP_MODE_HOME, AP_MODE_KILL, AP_MODE_NAV, autopilot_static_set_mode(), mode, radio_control, and RC_OK.
Referenced by autopilot_SetModeHandler().