60 #ifndef ECL_L1_POS_CONTROLLER_H 61 #define ECL_L1_POS_CONTROLLER_H 63 #include <mathlib/mathlib.h> Adapter / shim layer for system calls needed by ECL.
float nav_bearing()
The current target bearing.
bool circle_mode()
Returns true if following a circle (loiter)
void set_l1_damping(float damping)
Set the L1 damping factor.
float _dt
control loop time in seconds
Definition of geo / math functions to perform geodesic calculations.
float _roll_slew_rate
roll angle setpoint slew rate limit in rad/s
L1 Nonlinear Guidance Logic.
float _K_L1
L1 control gain for _L1_damping.
bool _circle_mode
flag for loiter mode
float switch_distance(float waypoint_switch_radius)
Get the switch distance.
void update_roll_setpoint()
Update roll angle setpoint.
float _target_bearing
the heading setpoint
void navigate_loiter(const matrix::Vector2f &vector_A, const matrix::Vector2f &vector_curr_position, float radius, int8_t loiter_direction, const matrix::Vector2f &ground_speed_vector)
Navigate on an orbit around a loiter waypoint.
void set_roll_slew_rate(float roll_slew_rate)
Set roll angle slew rate.
float crosstrack_error()
Get the current crosstrack error.
float _nav_bearing
bearing to L1 reference point
float target_bearing()
Bearing from aircraft to current target.
float _L1_ratio
L1 ratio for navigation.
constexpr T radians(T degrees)
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
float _L1_distance
L1 lead distance, defined by period and damping.
float nav_lateral_acceleration_demand()
Get lateral acceleration demand.
float _roll_lim_rad
maximum roll angle in radians
void set_l1_period(float period)
Set the L1 period.
void set_dt(float dt)
Set control loop dt.
float bearing_error()
Heading error.
Type wrap_pi(Type x)
Wrap value in range [-π, π)
void navigate_waypoints(const matrix::Vector2f &vector_A, const matrix::Vector2f &vector_B, const matrix::Vector2f &vector_curr_position, const matrix::Vector2f &ground_speed)
Navigate between two waypoints.
void set_l1_roll_limit(float roll_lim_rad)
Set the maximum roll angle output in radians.
float _heading_omega
Normalized frequency.
float _bearing_error
bearing error
float _crosstrack_error
crosstrack error in meters
float get_roll_setpoint()
Get roll angle setpoint for fixed wing.
float _roll_setpoint
current roll angle setpoint in radians
void navigate_level_flight(float current_heading)
Keep the wings level.
bool reached_loiter_target()
Returns true if the loiter waypoint has been reached.
float _L1_damping
L1 damping ratio.
void navigate_heading(float navigation_heading, float current_heading, const matrix::Vector2f &ground_speed)
Navigate on a fixed bearing.
float _L1_period
L1 tracking period in seconds.
matrix::Vector2f get_local_planar_vector(const matrix::Vector2f &origin, const matrix::Vector2f &target) const
Convert a 2D vector from WGS84 to planar coordinates.
float _lateral_accel
Lateral acceleration setpoint in m/s^2.