PX4 Firmware
PX4 Autopilot Software http://px4.io
navigator.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Copyright (c) 2013-2017 PX4 Development Team. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * 3. Neither the name PX4 nor the names of its contributors may be
16  * used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  ****************************************************************************/
33 /**
34  * @file navigator.h
35  * Helper class to access missions
36  * @author Julian Oes <julian@oes.ch>
37  * @author Anton Babushkin <anton.babushkin@me.com>
38  * @author Thomas Gubler <thomasgubler@gmail.com>
39  * @author Lorenz Meier <lorenz@px4.io>
40  */
41 
42 #pragma once
43 
44 #include "datalinkloss.h"
45 #include "enginefailure.h"
46 #include "follow_target.h"
47 #include "geofence.h"
48 #include "gpsfailure.h"
49 #include "land.h"
50 #include "precland.h"
51 #include "loiter.h"
52 #include "mission.h"
53 #include "navigator_mode.h"
54 #include "rcloss.h"
55 #include "rtl.h"
56 #include "takeoff.h"
57 
58 #include "navigation.h"
59 
60 #include <lib/perf/perf_counter.h>
61 #include <px4_platform_common/module.h>
62 #include <px4_platform_common/module_params.h>
64 #include <uORB/Subscription.hpp>
67 #include <uORB/topics/mission.h>
81 #include <uORB/uORB.h>
82 
83 /**
84  * Number of navigation modes that need on_active/on_inactive calls
85  */
86 #define NAVIGATOR_MODE_ARRAY_SIZE 11
87 
88 
89 class Navigator : public ModuleBase<Navigator>, public ModuleParams
90 {
91 public:
92  Navigator();
93  ~Navigator() override;
94 
95  Navigator(const Navigator &) = delete;
96  Navigator operator=(const Navigator &) = delete;
97 
98  /** @see ModuleBase */
99  static int task_spawn(int argc, char *argv[]);
100 
101  /** @see ModuleBase */
102  static Navigator *instantiate(int argc, char *argv[]);
103 
104  /** @see ModuleBase */
105  static int custom_command(int argc, char *argv[]);
106 
107  /** @see ModuleBase */
108  static int print_usage(const char *reason = nullptr);
109 
110  /** @see ModuleBase::run() */
111  void run() override;
112 
113  /** @see ModuleBase::print_status() */
114  int print_status() override;
115 
116  /**
117  * Load fence from file
118  */
119  void load_fence_from_file(const char *filename);
120 
122 
123  /**
124  * Generate an artificial traffic indication
125  *
126  * @param distance Horizontal distance to this vehicle
127  * @param direction Direction in earth frame from this vehicle in radians
128  * @param traffic_heading Travel direction of the traffic in earth frame in radians
129  * @param altitude_diff Altitude difference, positive is up
130  * @param hor_velocity Horizontal velocity of traffic, in m/s
131  * @param ver_velocity Vertical velocity of traffic, in m/s
132  */
133  void fake_traffic(const char *callsign, float distance, float direction, float traffic_heading, float altitude_diff,
134  float hor_velocity, float ver_velocity);
135 
136  /**
137  * Check nearby traffic for potential collisions
138  */
139  void check_traffic();
140 
141  /**
142  * Setters
143  */
144  void set_can_loiter_at_sp(bool can_loiter) { _can_loiter_at_sp = can_loiter; }
147 
148  /**
149  * Getters
150  */
159  struct vehicle_status_s *get_vstatus() { return &_vstatus; }
160  PrecLand *get_precland() { return &_precland; } /**< allow others, e.g. Mission, to use the precision land block */
161 
162  const vehicle_roi_s &get_vroi() { return _vroi; }
163  void reset_vroi() { _vroi = {}; }
164 
167 
169 
171  float get_loiter_radius() { return _param_nav_loiter_rad.get(); }
172 
173  /**
174  * Returns the default acceptance radius defined by the parameter
175  */
177 
178  /**
179  * Get the acceptance radius
180  *
181  * @return the distance at which the next waypoint should be used
182  */
183  float get_acceptance_radius();
184 
185  /**
186  * Get the default altitude acceptance radius (i.e. from parameters)
187  *
188  * @return the distance from the target altitude before considering the waypoint reached
189  */
191 
192  /**
193  * Get the altitude acceptance radius
194  *
195  * @return the distance from the target altitude before considering the waypoint reached
196  */
198 
199  /**
200  * Get the cruising speed
201  *
202  * @return the desired cruising speed for this mission
203  */
204  float get_cruising_speed();
205 
206  /**
207  * Set the cruising speed
208  *
209  * Passing a negative value or leaving the parameter away will reset the cruising speed
210  * to its default value.
211  *
212  * For VTOL: sets cruising speed for current mode only (multirotor or fixed-wing).
213  *
214  */
215  void set_cruising_speed(float speed = -1.0f);
216 
217  /**
218  * Reset cruising speed to default values
219  *
220  * For VTOL: resets both cruising speeds.
221  */
222  void reset_cruising_speed();
223 
224 
225  /**
226  * Set triplets to invalid
227  */
228  void reset_triplets();
229 
230  /**
231  * Get the target throttle
232  *
233  * @return the desired throttle for this mission
234  */
235  float get_cruising_throttle();
236 
237  /**
238  * Set the target throttle
239  */
240  void set_cruising_throttle(float throttle = -1.0f) { _mission_throttle = throttle; }
241 
242  /**
243  * Get the acceptance radius given the mission item preset radius
244  *
245  * @param mission_item_radius the radius to use in case the controller-derived radius is smaller
246  *
247  * @return the distance at which the next waypoint should be used
248  */
249  float get_acceptance_radius(float mission_item_radius);
250 
251  /**
252  * Get the yaw acceptance given the current mission item
253  *
254  * @param mission_item_yaw the yaw to use in case the controller-derived radius is finite
255  *
256  * @return the yaw at which the next waypoint should be used or NaN if the yaw at a waypoint
257  * should be ignored
258  */
259  float get_yaw_acceptance(float mission_item_yaw);
260 
262 
264 
265  void set_mission_failure(const char *reason);
266 
267  // MISSION
268  bool is_planned_mission() const { return _navigation_mode == &_mission; }
269  bool on_mission_landing() { return _mission.landing(); }
276 
277  // RTL
279  int rtl_type() { return _rtl.rtl_type(); }
280  bool in_rtl_state() const { return _vstatus.nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_RTL; }
281 
282  bool abort_landing();
283 
284  // Param access
285  float get_loiter_min_alt() const { return _param_mis_ltrmin_alt.get(); }
286  float get_takeoff_min_alt() const { return _param_mis_takeoff_alt.get(); }
287  bool get_takeoff_required() const { return _param_mis_takeoff_req.get(); }
288  float get_yaw_timeout() const { return _param_mis_yaw_tmt.get(); }
289  float get_yaw_threshold() const { return math::radians(_param_mis_yaw_err.get()); }
290 
293 
294  bool force_vtol();
295 
296 private:
298  (ParamFloat<px4::params::NAV_LOITER_RAD>) _param_nav_loiter_rad, /**< loiter radius for fixedwing */
299  (ParamFloat<px4::params::NAV_ACC_RAD>) _param_nav_acc_rad, /**< acceptance for takeoff */
300  (ParamFloat<px4::params::NAV_FW_ALT_RAD>)
301  _param_nav_fw_alt_rad, /**< acceptance radius for fixedwing altitude */
302  (ParamFloat<px4::params::NAV_FW_ALTL_RAD>)
303  _param_nav_fw_altl_rad, /**< acceptance radius for fixedwing altitude before landing*/
304  (ParamFloat<px4::params::NAV_MC_ALT_RAD>)
305  _param_nav_mc_alt_rad, /**< acceptance radius for multicopter altitude */
306  (ParamInt<px4::params::NAV_FORCE_VT>) _param_nav_force_vt, /**< acceptance radius for multicopter altitude */
307  (ParamInt<px4::params::NAV_TRAFF_AVOID>) _param_nav_traff_avoid, /**< avoiding other aircraft is enabled */
308 
309  // non-navigator parameters
310  // Mission (MIS_*)
311  (ParamFloat<px4::params::MIS_LTRMIN_ALT>) _param_mis_ltrmin_alt,
312  (ParamFloat<px4::params::MIS_TAKEOFF_ALT>) _param_mis_takeoff_alt,
313  (ParamBool<px4::params::MIS_TAKEOFF_REQ>) _param_mis_takeoff_req,
314  (ParamFloat<px4::params::MIS_YAW_TMT>) _param_mis_yaw_tmt,
315  (ParamFloat<px4::params::MIS_YAW_ERR>) _param_mis_yaw_err
316  )
317 
318  int _local_pos_sub{-1}; /**< local position subscription */
319  int _vehicle_status_sub{-1}; /**< local position subscription */
320 
321  uORB::Subscription _global_pos_sub{ORB_ID(vehicle_global_position)}; /**< global position subscription */
322  uORB::Subscription _gps_pos_sub{ORB_ID(vehicle_gps_position)}; /**< gps position subscription */
323  uORB::Subscription _home_pos_sub{ORB_ID(home_position)}; /**< home position subscription */
324  uORB::Subscription _land_detected_sub{ORB_ID(vehicle_land_detected)}; /**< vehicle land detected subscription */
325  uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)}; /**< param update subscription */
326  uORB::Subscription _pos_ctrl_landing_status_sub{ORB_ID(position_controller_landing_status)}; /**< position controller landing status subscription */
327  uORB::Subscription _traffic_sub{ORB_ID(transponder_report)}; /**< traffic subscription */
328  uORB::Subscription _vehicle_command_sub{ORB_ID(vehicle_command)}; /**< vehicle commands (onboard and offboard) */
329 
331 
336 
337  orb_advert_t _mavlink_log_pub{nullptr}; /**< the uORB advert to send messages over mavlink */
338 
341 
342  // Subscriptions
343  home_position_s _home_pos{}; /**< home position for RTL */
345  vehicle_global_position_s _global_pos{}; /**< global vehicle position */
346  vehicle_gps_position_s _gps_pos{}; /**< gps position */
347  vehicle_land_detected_s _land_detected{}; /**< vehicle land_detected */
348  vehicle_local_position_s _local_pos{}; /**< local vehicle position */
349  vehicle_status_s _vstatus{}; /**< vehicle status */
350 
351  uint8_t _previous_nav_state{}; /**< nav_state of the previous iteration*/
352 
353  // Publications
355  position_setpoint_triplet_s _pos_sp_triplet{}; /**< triplet of position setpoints */
356  position_setpoint_triplet_s _reposition_triplet{}; /**< triplet for non-mission direct position command */
357  position_setpoint_triplet_s _takeoff_triplet{}; /**< triplet for non-mission direct takeoff command */
358  vehicle_roi_s _vroi{}; /**< vehicle ROI */
359 
360  perf_counter_t _loop_perf; /**< loop performance counter */
361 
362  Geofence _geofence; /**< class that handles the geofence */
363  bool _geofence_violation_warning_sent{false}; /**< prevents spaming to mavlink */
364 
365  bool _can_loiter_at_sp{false}; /**< flags if current position SP can be used to loiter */
366  bool _pos_sp_triplet_updated{false}; /**< flags if position SP triplet needs to be published */
367  bool _pos_sp_triplet_published_invalid_once{false}; /**< flags if position SP triplet has been published once to UORB */
368  bool _mission_result_updated{false}; /**< flags if mission result has seen an update */
369 
370  NavigatorMode *_navigation_mode{nullptr}; /**< abstract pointer to current navigation mode class */
371  Mission _mission; /**< class that handles the missions */
372  Loiter _loiter; /**< class that handles loiter */
373  Takeoff _takeoff; /**< class for handling takeoff commands */
374  Land _land; /**< class for handling land commands */
375  PrecLand _precland; /**< class for handling precision land commands */
376  RTL _rtl; /**< class that handles RTL */
377  RCLoss _rcLoss; /**< class that handles RTL according to OBC rules (rc loss mode) */
378  DataLinkLoss _dataLinkLoss; /**< class that handles the OBC datalink loss mode */
379  EngineFailure _engineFailure; /**< class that handles the engine failure mode (FW only!) */
380  GpsFailure _gpsFailure; /**< class that handles the OBC gpsfailure loss mode */
382 
384 
389 
392  float _mission_throttle{-1.0f};
393 
394  // update subscriptions
395  void params_update();
396 
397  /**
398  * Publish a new position setpoint triplet for position controllers
399  */
401 
402  /**
403  * Publish the mission result so commander and mavlink know what is going on
404  */
405  void publish_mission_result();
406 
407  void publish_vehicle_command_ack(const vehicle_command_s &cmd, uint8_t result);
408 };
bool land_start()
Definition: mission.cpp:429
position_setpoint_triplet_s _pos_sp_triplet
triplet of position setpoints
Definition: navigator.h:355
#define PARAM_INVALID
Handle returned when a parameter cannot be found.
Definition: param.h:103
geofence_result_s _geofence_result
Definition: navigator.h:354
uORB::Subscription _home_pos_sub
home position subscription
Definition: navigator.h:323
uORB::SubscriptionData< position_controller_status_s > _position_controller_status_sub
Definition: navigator.h:330
bool home_position_valid()
Definition: navigator.h:166
uORB::PublicationQueued< vehicle_command_s > _vehicle_cmd_pub
Definition: navigator.h:340
void run() override
uORB::Subscription _vehicle_command_sub
vehicle commands (onboard and offboard)
Definition: navigator.h:328
void publish_position_setpoint_triplet()
Publish a new position setpoint triplet for position controllers.
Land _land
class for handling land commands
Definition: navigator.h:374
orb_advert_t _mavlink_log_pub
the uORB advert to send messages over mavlink
Definition: navigator.h:337
float get_default_altitude_acceptance_radius()
Get the default altitude acceptance radius (i.e.
vehicle_gps_position_s _gps_pos
gps position
Definition: navigator.h:346
uint64_t timestamp
Definition: home_position.h:53
float _mission_throttle
Definition: navigator.h:392
Helper class to do precision landing with a landing target.
bool get_mission_start_land_available()
Definition: navigator.h:271
NavigatorMode * _navigation_mode_array[NAVIGATOR_MODE_ARRAY_SIZE]
array of navigation modes
Definition: navigator.h:383
float get_acceptance_radius()
Get the acceptance radius.
API for the uORB lightweight object broker.
bool is_planned_mission() const
Definition: navigator.h:268
Helper class to loiter.
vehicle_local_position_s _local_pos
local vehicle position
Definition: navigator.h:348
float get_loiter_min_alt() const
Definition: navigator.h:285
Helper class to land at the current position.
static int custom_command(int argc, char *argv[])
float get_vtol_back_trans_deceleration() const
Definition: navigator.h:291
bool _geofence_violation_warning_sent
prevents spaming to mavlink
Definition: navigator.h:363
vehicle_global_position_s _global_pos
global vehicle position
Definition: navigator.h:345
void increment_mission_instance_count()
Definition: navigator.h:263
float get_cruising_throttle()
Get the target throttle.
uORB::Subscription _global_pos_sub
global position subscription
Definition: navigator.h:321
bool abort_landing()
param_t _handle_back_trans_dec_mss
Definition: navigator.h:385
struct home_position_s * get_home_position()
Getters.
Definition: navigator.h:151
int print_status() override
double get_mission_landing_lon()
Definition: navigator.h:274
NavigatorMode * _navigation_mode
abstract pointer to current navigation mode class
Definition: navigator.h:370
Navigator operator=(const Navigator &)=delete
struct position_setpoint_triplet_s * get_takeoff_triplet()
Definition: navigator.h:155
bool _pos_sp_triplet_updated
flags if position SP triplet needs to be published
Definition: navigator.h:366
float _param_reverse_delay
Definition: navigator.h:388
uORB::Subscription _pos_ctrl_landing_status_sub
position controller landing status subscription
Definition: navigator.h:326
struct vehicle_land_detected_s * get_land_detected()
Definition: navigator.h:157
home_position_s _home_pos
home position for RTL
Definition: navigator.h:343
float get_yaw_timeout() const
Definition: navigator.h:288
Helper class for Data Link Loss Mode acording to the OBC rules.
bool get_can_loiter_at_sp()
Definition: navigator.h:170
vehicle_roi_s _vroi
vehicle ROI
Definition: navigator.h:358
mission_result_s _mission_result
Definition: navigator.h:344
GpsFailure _gpsFailure
class that handles the OBC gpsfailure loss mode
Definition: navigator.h:380
Geofence _geofence
class that handles the geofence
Definition: navigator.h:362
vehicle_land_detected_s _land_detected
vehicle land_detected
Definition: navigator.h:347
double get_landing_lat()
Definition: mission.h:94
perf_counter_t _loop_perf
loop performance counter
Definition: navigator.h:360
bool mission_landing_required()
Definition: navigator.h:278
Provides functions for handling the geofence.
double get_mission_landing_lat()
Definition: navigator.h:273
bool get_takeoff_required() const
Definition: navigator.h:287
int _vehicle_status_sub
local position subscription
Definition: navigator.h:319
Geofence & get_geofence()
Definition: navigator.h:168
uORB::Publication< mission_result_s > _mission_result_pub
Definition: navigator.h:333
const vehicle_roi_s & get_vroi()
Definition: navigator.h:162
void reset_cruising_speed()
Reset cruising speed to default values.
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
Definition: uORB.h:87
Definition: loiter.h:48
uint16_t get_land_start_index() const
Definition: mission.h:89
void check_traffic()
Check nearby traffic for potential collisions.
void publish_vehicle_command_ack(const vehicle_command_s &cmd, uint8_t result)
Header common to all counters.
void reset_triplets()
Set triplets to invalid.
bool _mission_result_updated
flags if mission result has seen an update
Definition: navigator.h:368
int rtl_type()
Definition: navigator.h:279
float get_landing_alt()
Definition: mission.h:96
PrecLand _precland
class for handling precision land commands
Definition: navigator.h:375
struct vehicle_global_position_s * get_global_position()
Definition: navigator.h:156
uORB::Publication< vehicle_roi_s > _vehicle_roi_pub
Definition: navigator.h:335
float get_cruising_speed()
Get the cruising speed.
uORB::Subscription _gps_pos_sub
gps position subscription
Definition: navigator.h:322
uint32_t instance_count
constexpr T radians(T degrees)
Definition: Limits.hpp:85
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
Definition: integration.cpp:8
bool in_rtl_state() const
Definition: navigator.h:280
Helper class for RC Loss Mode acording to the OBC rules.
double get_landing_lon()
Definition: mission.h:95
uint8_t _previous_nav_state
nav_state of the previous iteration
Definition: navigator.h:351
static int print_usage(const char *reason=nullptr)
EngineFailure _engineFailure
class that handles the engine failure mode (FW only!)
Definition: navigator.h:379
static Navigator * instantiate(int argc, char *argv[])
vehicle_status_s _vstatus
vehicle status
Definition: navigator.h:349
Definition: rtl.h:53
void params_update()
PrecLand * get_precland()
allow others, e.g.
Definition: navigator.h:160
bool home_alt_valid()
Definition: navigator.h:165
Helper class for a fixedwing engine failure mode.
__BEGIN_DECLS typedef void * orb_advert_t
ORB topic advertiser handle.
Definition: uORB.h:134
RCLoss _rcLoss
class that handles RTL according to OBC rules (rc loss mode)
Definition: navigator.h:377
void reset_vroi()
Definition: navigator.h:163
bool get_land_start_available() const
Definition: mission.h:90
Mission _mission
class that handles the missions
Definition: navigator.h:371
position_setpoint_triplet_s _takeoff_triplet
triplet for non-mission direct takeoff command
Definition: navigator.h:357
FollowTarget _follow_target
Definition: navigator.h:381
uORB::Subscription _parameter_update_sub
param update subscription
Definition: navigator.h:325
Helper class to take off.
uORB::Subscription _traffic_sub
traffic subscription
Definition: navigator.h:327
struct position_setpoint_triplet_s * get_position_setpoint_triplet()
Definition: navigator.h:153
uORB::PublicationQueued< vehicle_command_ack_s > _vehicle_cmd_ack_pub
Definition: navigator.h:339
DataLinkLoss _dataLinkLoss
class that handles the OBC datalink loss mode
Definition: navigator.h:378
param_t _handle_reverse_delay
Definition: navigator.h:386
struct mission_result_s * get_mission_result()
Definition: navigator.h:152
float _mission_cruising_speed_fw
Definition: navigator.h:391
void set_cruising_throttle(float throttle=-1.0f)
Set the target throttle.
Definition: navigator.h:240
static int task_spawn(int argc, char *argv[])
Helper class for RTL.
bool start_mission_landing()
Definition: navigator.h:270
Helper class for Data Link Loss Mode according to the OBC rules.
void load_fence_from_file(const char *filename)
Load fence from file.
void publish_vehicle_cmd(vehicle_command_s *vcmd)
float get_loiter_radius()
Definition: navigator.h:171
Takeoff _takeoff
class for handling takeoff commands
Definition: navigator.h:373
float get_default_acceptance_radius()
Returns the default acceptance radius defined by the parameter.
float get_yaw_acceptance(float mission_item_yaw)
Get the yaw acceptance given the current mission item.
~Navigator() override
DEFINE_PARAMETERS((ParamFloat< px4::params::NAV_LOITER_RAD >) _param_nav_loiter_rad,(ParamFloat< px4::params::NAV_ACC_RAD >) _param_nav_acc_rad,(ParamFloat< px4::params::NAV_FW_ALT_RAD >) _param_nav_fw_alt_rad,(ParamFloat< px4::params::NAV_FW_ALTL_RAD >) _param_nav_fw_altl_rad,(ParamFloat< px4::params::NAV_MC_ALT_RAD >) _param_nav_mc_alt_rad,(ParamInt< px4::params::NAV_FORCE_VT >) _param_nav_force_vt,(ParamInt< px4::params::NAV_TRAFF_AVOID >) _param_nav_traff_avoid,(ParamFloat< px4::params::MIS_LTRMIN_ALT >) _param_mis_ltrmin_alt,(ParamFloat< px4::params::MIS_TAKEOFF_ALT >) _param_mis_takeoff_alt,(ParamBool< px4::params::MIS_TAKEOFF_REQ >) _param_mis_takeoff_req,(ParamFloat< px4::params::MIS_YAW_TMT >) _param_mis_yaw_tmt,(ParamFloat< px4::params::MIS_YAW_ERR >) _param_mis_yaw_err) int _local_pos_sub
Definition: navigator.h:297
RTL _rtl
class that handles RTL
Definition: navigator.h:376
struct position_setpoint_triplet_s * get_reposition_triplet()
Definition: navigator.h:154
bool on_mission_landing()
Definition: navigator.h:269
bool _pos_sp_triplet_published_invalid_once
flags if position SP triplet has been published once to UORB
Definition: navigator.h:367
orb_advert_t * get_mavlink_log_pub()
Definition: navigator.h:261
uORB::Subscription _land_detected_sub
vehicle land detected subscription
Definition: navigator.h:324
float get_mission_landing_alt()
Definition: navigator.h:275
struct vehicle_status_s * get_vstatus()
Definition: navigator.h:159
bool landing()
Definition: mission.cpp:446
void set_mission_result_updated()
Definition: navigator.h:146
float get_takeoff_min_alt() const
Definition: navigator.h:286
uORB::Publication< geofence_result_s > _geofence_result_pub
Definition: navigator.h:332
Definition: land.h:46
float _param_back_trans_dec_mss
Definition: navigator.h:387
Loiter _loiter
class that handles loiter
Definition: navigator.h:372
float _mission_cruising_speed_mc
Definition: navigator.h:390
int get_mission_landing_index()
Definition: navigator.h:272
Definition: rcloss.h:49
int rtl_type() const
Definition: rtl.cpp:171
void set_can_loiter_at_sp(bool can_loiter)
Setters.
Definition: navigator.h:144
void set_mission_failure(const char *reason)
void set_position_setpoint_triplet_updated()
Definition: navigator.h:145
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.
void publish_mission_result()
Publish the mission result so commander and mavlink know what is going on.
bool _can_loiter_at_sp
flags if current position SP can be used to loiter
Definition: navigator.h:365
position_setpoint_triplet_s _reposition_triplet
triplet for non-mission direct position command
Definition: navigator.h:356
float get_altitude_acceptance_radius()
Get the altitude acceptance radius.
float get_yaw_threshold() const
Definition: navigator.h:289
uORB::Publication< position_setpoint_triplet_s > _pos_sp_triplet_pub
Definition: navigator.h:334
uint32_t param_t
Parameter handle.
Definition: param.h:98
struct vehicle_local_position_s * get_local_position()
Definition: navigator.h:158
float get_vtol_reverse_delay() const
Definition: navigator.h:292
void set_cruising_speed(float speed=-1.0f)
Set the cruising speed.
Performance measuring tools.