Firmware
Public Member Functions | Static Public Member Functions | List of all members
Navigator Class Reference
Inheritance diagram for Navigator:
ModuleParams ListNode< ModuleParams *>

Public Member Functions

 Navigator (const Navigator &)=delete
 
Navigator operator= (const Navigator &)=delete
 
void run () override
 
int print_status () override
 
void load_fence_from_file (const char *filename)
 Load fence from file.
 
void publish_geofence_result ()
 Publish the geofence result.
 
void publish_vehicle_cmd (vehicle_command_s *vcmd)
 
void fake_traffic (const char *callsign, float distance, float direction, float traffic_heading, float altitude_diff, float hor_velocity, float ver_velocity)
 Generate an artificial traffic indication. More...
 
void check_traffic ()
 Check nearby traffic for potential collisions.
 
void set_can_loiter_at_sp (bool can_loiter)
 Setters.
 
void set_position_setpoint_triplet_updated ()
 
void set_mission_result_updated ()
 
struct home_position_s * get_home_position ()
 Getters.
 
struct mission_result_s * get_mission_result ()
 
struct position_setpoint_triplet_s * get_position_setpoint_triplet ()
 
struct position_setpoint_triplet_s * get_reposition_triplet ()
 
struct position_setpoint_triplet_s * get_takeoff_triplet ()
 
struct vehicle_global_position_s * get_global_position ()
 
struct vehicle_land_detected_s * get_land_detected ()
 
struct vehicle_local_position_s * get_local_position ()
 
struct vehicle_status_s * get_vstatus ()
 
PrecLandget_precland ()
 allow others, e.g. More...
 
const vehicle_roi_s & get_vroi ()
 
void reset_vroi ()
 
bool home_alt_valid ()
 
bool home_position_valid ()
 
int get_mission_sub ()
 
Geofenceget_geofence ()
 
bool get_can_loiter_at_sp ()
 
float get_loiter_radius ()
 
float get_default_acceptance_radius ()
 Returns the default acceptance radius defined by the parameter.
 
float get_acceptance_radius ()
 Get the acceptance radius. More...
 
float get_default_altitude_acceptance_radius ()
 Get the default altitude acceptance radius (i.e. More...
 
float get_altitude_acceptance_radius ()
 Get the altitude acceptance radius. More...
 
float get_cruising_speed ()
 Get the cruising speed. More...
 
void set_cruising_speed (float speed=-1.0f)
 Set the cruising speed. More...
 
void reset_cruising_speed ()
 Reset cruising speed to default values. More...
 
void reset_triplets ()
 Set triplets to invalid.
 
float get_cruising_throttle ()
 Get the target throttle. More...
 
void set_cruising_throttle (float throttle=-1.0f)
 Set the target throttle.
 
float get_acceptance_radius (float mission_item_radius)
 Get the acceptance radius given the mission item preset radius. More...
 
float get_yaw_acceptance (float mission_item_yaw)
 Get the yaw acceptance given the current mission item. More...
 
orb_advert_tget_mavlink_log_pub ()
 
void increment_mission_instance_count ()
 
void set_mission_failure (const char *reason)
 
bool is_planned_mission () const
 
bool on_mission_landing ()
 
bool start_mission_landing ()
 
bool mission_start_land_available ()
 
bool mission_landing_required ()
 
int rtl_type ()
 
bool in_rtl_state () const
 
bool abort_landing ()
 
float get_loiter_min_alt () const
 
float get_takeoff_min_alt () const
 
bool get_takeoff_required () const
 
float get_yaw_timeout () const
 
float get_yaw_threshold () const
 
float get_vtol_back_trans_deceleration () const
 
float get_vtol_reverse_delay () const
 
bool force_vtol ()
 
- Public Member Functions inherited from ModuleParams
 ModuleParams (ModuleParams *parent)
 
void setParent (ModuleParams *parent)
 Sets the parent module. More...
 
 ModuleParams (const ModuleParams &)=delete
 
ModuleParamsoperator= (const ModuleParams &)=delete
 
 ModuleParams (ModuleParams &&)=delete
 
ModuleParamsoperator= (ModuleParams &&)=delete
 
- Public Member Functions inherited from ListNode< ModuleParams *>
void setSibling (ModuleParams * sibling)
 
const ModuleParamsgetSibling () const
 

Static Public Member Functions

static int task_spawn (int argc, char *argv[])
 
static Navigatorinstantiate (int argc, char *argv[])
 
static int custom_command (int argc, char *argv[])
 
static int print_usage (const char *reason=nullptr)
 

Additional Inherited Members

- Protected Member Functions inherited from ModuleParams
virtual void updateParams ()
 Call this method whenever the module gets a parameter change notification. More...
 
virtual void updateParamsImpl ()
 The implementation for this is generated with the macro DEFINE_PARAMETERS()
 
- Protected Attributes inherited from ListNode< ModuleParams *>
ModuleParams_sibling
 

Member Function Documentation

§ custom_command()

int Navigator::custom_command ( int  argc,
char *  argv[] 
)
static
See also
ModuleBase

§ fake_traffic()

void Navigator::fake_traffic ( const char *  callsign,
float  distance,
float  direction,
float  traffic_heading,
float  altitude_diff,
float  hor_velocity,
float  ver_velocity 
)

Generate an artificial traffic indication.

Creates a fake traffic measurement with supplied parameters.

Parameters
distanceHorizontal distance to this vehicle
directionDirection in earth frame from this vehicle in radians
traffic_headingTravel direction of the traffic in earth frame in radians
altitude_diffAltitude difference, positive is up
hor_velocityHorizontal velocity of traffic, in m/s
ver_velocityVertical velocity of traffic, in m/s

§ get_acceptance_radius() [1/2]

float Navigator::get_acceptance_radius ( )

Get the acceptance radius.

Returns
the distance at which the next waypoint should be used

§ get_acceptance_radius() [2/2]

float Navigator::get_acceptance_radius ( float  mission_item_radius)

Get the acceptance radius given the mission item preset radius.

Parameters
mission_item_radiusthe radius to use in case the controller-derived radius is smaller
Returns
the distance at which the next waypoint should be used

§ get_altitude_acceptance_radius()

float Navigator::get_altitude_acceptance_radius ( )

Get the altitude acceptance radius.

Returns
the distance from the target altitude before considering the waypoint reached

§ get_cruising_speed()

float Navigator::get_cruising_speed ( )

Get the cruising speed.

Returns
the desired cruising speed for this mission

§ get_cruising_throttle()

float Navigator::get_cruising_throttle ( )

Get the target throttle.

Returns
the desired throttle for this mission

§ get_default_altitude_acceptance_radius()

float Navigator::get_default_altitude_acceptance_radius ( )

Get the default altitude acceptance radius (i.e.

from parameters)

Returns
the distance from the target altitude before considering the waypoint reached

§ get_precland()

PrecLand* Navigator::get_precland ( )
inline

allow others, e.g.

Mission, to use the precision land block

§ get_yaw_acceptance()

float Navigator::get_yaw_acceptance ( float  mission_item_yaw)

Get the yaw acceptance given the current mission item.

Parameters
mission_item_yawthe yaw to use in case the controller-derived radius is finite
Returns
the yaw at which the next waypoint should be used or NaN if the yaw at a waypoint should be ignored

§ instantiate()

Navigator * Navigator::instantiate ( int  argc,
char *  argv[] 
)
static
See also
ModuleBase

§ print_status()

int Navigator::print_status ( )
override
See also
ModuleBase::print_status()

§ print_usage()

int Navigator::print_usage ( const char *  reason = nullptr)
static
See also
ModuleBase

§ reset_cruising_speed()

void Navigator::reset_cruising_speed ( )

Reset cruising speed to default values.

For VTOL: resets both cruising speeds.

§ run()

void Navigator::run ( )
override
See also
ModuleBase::run()

§ set_cruising_speed()

void Navigator::set_cruising_speed ( float  speed = -1.0f)

Set the cruising speed.

Passing a negative value or leaving the parameter away will reset the cruising speed to its default value.

For VTOL: sets cruising speed for current mode only (multirotor or fixed-wing).

§ task_spawn()

int Navigator::task_spawn ( int  argc,
char *  argv[] 
)
static
See also
ModuleBase

The documentation for this class was generated from the following files: