52 #include "physical_constants.h"
56 #include "pathdesired.h"
57 #include "positionactual.h"
58 #include "vtolpathfollowersettings.h"
59 #include "vtolpathfollowerstatus.h"
123 static void hold_position(
float north,
float east,
float down);
183 .timeout = 8 *
MILLI,
200 .timeout = 10 *
MILLI,
257 if (interval > 0xf0000000) {
370 VtolPathFollowerStatusFSM_StateSet((uint8_t *) &
curr_state);
457 case PATHDESIRED_MODE_LAND:
458 for (uint8_t
i = 0;
i < 3;
i++)
461 case PATHDESIRED_MODE_HOLDPOSITION:
462 case PATHDESIRED_MODE_ENDPOINT:
463 for (uint8_t
i = 0;
i < 3;
i++)
496 float att_adj[2] = { 0, 0 };
497 float hold_pos[3] = {
500 vtol_hold_position_ned[2]
534 descent_rate) == 0) {
551 PositionActualDownGet(&cur_down);
622 PositionActualData positionActual;
623 PositionActualGet(&positionActual);
625 hold_position(positionActual.North, positionActual.East, positionActual.Down);
637 PositionActualData positionActual;
638 PositionActualGet(&positionActual);
640 float down = positionActual.Down;
642 float min_rise, rth_alt;
644 VtolPathFollowerSettingsReturnToHomeMinRiseGet(&min_rise);
645 VtolPathFollowerSettingsReturnToHomeAltitudeGet(&rth_alt);
654 hold_position(positionActual.North, positionActual.East, down);
665 VtolPathFollowerSettingsReturnToHomeAltitudeGet(&rth_alt);
678 PositionActualData positionActual;
679 PositionActualGet(&positionActual);
692 VtolPathFollowerSettingsReturnToHomeAltitudeGet(&rth_alt);
694 if (positionActual.Down > -rth_alt) {
701 float rth_vel = 3.0f;
702 VtolPathFollowerSettingsReturnToHomeVelGet(&rth_vel);
static const float RTH_ALT_ERROR
The altitude to come within for RTH */.
static void go_enable_hold_here(void)
uint32_t PIOS_Thread_Systime(void)
int32_t vtol_follower_fsm_update()
static const struct vtol_fsm_transition fsm_land_home[FSM_STATE_NUM_STATES]
int32_t vtol_follower_fsm_activate_goal(enum vtol_goals new_goal)
int32_t vtol_follower_control_attitude(float dT, const float *att_adj)
static void go_enable_pause_home_10s(void)
static enum vtol_fsm_state curr_state
The current state within the goal fsm.
enum vtol_fsm_state next_state[FSM_EVENT_NUM_EVENTS]
int32_t vtol_follower_control_endpoint(const float *hold_pos_ned)
static bool vtol_fsm_process_event(enum vtol_fsm_event event)
float fractional_progress
static const struct vtol_fsm_transition fsm_follow_path[FSM_STATE_NUM_STATES]
static void go_enable_rise_here(void)
static int32_t vtol_fsm_static()
static void vtol_fsm_inject_event(enum vtol_fsm_event event)
static int32_t do_loiter(void)
int32_t vtol_follower_control_land(const float *hold_pos_ned, bool *landed)
static int32_t do_land(void)
static void hold_position(float north, float east, float down)
static uint32_t vtol_fsm_timer_expiration
Specifies a time since startup in ms that the timeout fires.
vtol_fsm_event
Events that can be be injected into the FSM and trigger state changes.
static const struct vtol_fsm_transition fsm_hold_position[FSM_STATE_NUM_STATES]
static void go_enable_fly_path(void)
static const struct vtol_fsm_transition * current_goal
The currently selected goal FSM.
static PathDesiredData vtol_fsm_path_desired
The configured path desired. Uses the PathDesired structure.
static int32_t do_slow_altitude_change(float descent_rate)
Includes for the internal methods.
static float vtol_hold_position_ned[3]
The setpoint for position hold relative to home in m.
bool vtol_follower_control_loiter(float dT, float *hold_pos, float *att_adj, float *alt_adj)
static void vtol_fsm_process_auto()
static void vtol_fsm_fsm_init(const struct vtol_fsm_transition *goal)
static int32_t do_ph_climb(void)
static int vtol_fsm_enter_state(enum vtol_fsm_state state)
static void vtol_fsm_timer_set(int32_t ms)
Header for Coordinate conversions library in coordinate_conversions.c.
static int32_t do_path(void)
static void go_enable_land_home(void)
static int32_t do_hold(void)
static int32_t do_requested_path(void)
int32_t vtol_follower_control_path(const PathDesiredData *pathDesired, struct path_status *progress)
static bool vtol_fsm_timer_expired()
Includes PiOS and core architecture components.
static void go_enable_fly_home(void)
static const float RTH_CLIMB_SPEED
Climb at 1m/s.
int32_t vtol_follower_control_altrate(const float *hold_pos_ned, float alt_adj)