65 ModuleParams(navigator)
82 _follow_offset = _param_nav_ft_dst.get() < 1.0F ? 1.0F : _param_nav_ft_dst.get();
100 bool _radius_entered =
false;
101 bool _radius_exited =
false;
102 bool updated =
false;
225 &target_motion_with_offset.lat, &target_motion_with_offset.lon);
239 switch (_follow_target_state) {
243 if (_radius_entered) {
262 if (_radius_exited) {
329 pos_sp_triplet->
current.
type = position_setpoint_s::SETPOINT_TYPE_FOLLOW_TARGET;
384 if (min_clearance > 8.0
f) {
constexpr _Tp constrain(_Tp val, _Tp min_val, _Tp max_val)
Global position setpoint in WGS84 coordinates.
static constexpr int INTERPOLATION_PNTS
Helper class to access missions.
static constexpr float FF_K
float get_acceptance_radius()
Get the acceptance radius.
API for the uORB lightweight object broker.
Definition of geo / math functions to perform geodesic calculations.
float altitude
altitude in meters (AMSL)
matrix::Vector3f _target_position_offset
uint16_t autocontinue
true if next waypoint should follow after this one
float acceptance_radius
default radius in which the mission is accepted as reached in meters
bool target_velocity_valid()
struct position_setpoint_s next
void set_follow_target_item(struct mission_item_s *item, float min_clearance, follow_target_s &target, float yaw)
Set follow_target item.
struct home_position_s * get_home_position()
Getters.
void on_active() override
This function is called while the mode is active.
FollowTarget(Navigator *navigator)
Limiting / constrain helper functions.
uint16_t origin
how the mission item was generated
struct position_setpoint_s previous
struct vehicle_land_detected_s * get_land_detected()
int _follow_target_position
double lon
longitude in degrees
matrix::Vector3f _step_vel
void on_inactive() override
This function is called while the mode is inactive.
uORB::Subscription _follow_target_sub
bool target_position_valid()
struct position_setpoint_s current
int map_projection_reproject(const struct map_projection_reference_s *ref, float x, float y, double *lat, double *lon)
Transforms a point in the local azimuthal equidistant plane to the geographic coordinate system using...
struct vehicle_global_position_s * get_global_position()
mission_item_s _mission_item
uint16_t nav_cmd
navigation command
constexpr T radians(T degrees)
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
void mission_apply_limitation(mission_item_s &item)
General function used to adjust the mission item based on vehicle specific limitations.
follow_target_s _current_target_motion
Simple error/warning functions, heavily inspired by the BSD functions of the same names...
float get_bearing_to_next_waypoint(double lat_now, double lon_now, double lat_next, double lon_next)
Returns the bearing to the next waypoint in radians.
void reset_mission_item_reached()
Reset all reached flags.
void reset_target_validity()
float time_inside
time that the MAV should stay inside the radius before advancing in seconds
bool updated()
Check if there is a new update.
void update_position_sp(bool velocity_valid, bool position_valid, float yaw_rate)
static constexpr int TARGET_TIMEOUT_MS
Type wrap_pi(Type x)
Wrap value in range [-π, π)
matrix::Vector3f _current_vel
struct position_setpoint_triplet_s * get_position_setpoint_triplet()
matrix::Vector3f _target_distance
Vector3 normalized() const
void on_activation() override
This function is called one time when mode becomes active, pos_sp_triplet must be initialized here...
static constexpr int TARGET_ACCEPTANCE_RADIUS_M
uint64_t _last_update_time
int map_projection_project(const struct map_projection_reference_s *ref, double lat, double lon, float *x, float *y)
bool mission_item_to_position_setpoint(const mission_item_s &item, position_setpoint_s *sp)
Convert a mission item to a position setpoint.
bool is_mission_item_reached()
Check if mission item has been reached.
float get_loiter_radius()
matrix::Vector3f _target_position_delta
matrix::Vector3f _est_target_vel
int map_projection_init(struct map_projection_reference_s *ref, double lat_0, double lon_0)
Initializes the map transformation given by the argument and sets the timestamp to now...
static constexpr float _follow_position_matricies[4][9]
bool copy(void *dst)
Copy the struct.
float yaw
in radians NED -PI..+PI, NAN means don't change yaw
float loiter_radius
loiter radius in meters, 0 for a VTOL to hover, negative for counter-clockwise
void set_position_setpoint_triplet_updated()
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).
follow_target_s _previous_target_motion
uint16_t altitude_is_relative
true if altitude is relative from start point
double lat
latitude in degrees