55 #include <px4_platform_common/module_params.h> 180 mission_item_s *next_position_mission_item,
bool *has_next_position_item);
243 (ParamFloat<px4::params::MIS_DIST_1WP>) _param_mis_dist_1wp,
244 (ParamFloat<px4::params::MIS_DIST_WPS>) _param_mis_dist_wps,
245 (ParamInt<px4::params::MIS_ALTMODE>) _param_mis_altmode,
246 (ParamInt<px4::params::MIS_MNT_YAW_CTL>) _param_mis_mnt_yaw_ctl
Global position setpoint in WGS84 coordinates.
int32_t index_closest_mission_item() const
Return the index of the closest mission item to the current global position.
enum Mission::@122 MISSION_TYPE_NONE
void copy_position_if_valid(struct mission_item_s *mission_item, struct position_setpoint_s *setpoint)
Copies position from setpoint if valid, otherwise copies current position.
void advance_mission()
Move on to next mission item or switch to loiter.
void generate_waypoint_from_heading(struct position_setpoint_s *setpoint, float yaw)
Project current location with heading to far away location and fill setpoint.
void on_inactive() override
This function is called while the mode is inactive.
API for the uORB lightweight object broker.
uint8_t _mission_execution_mode
the current mode of how the mission is executed,look at mission_result.msg for the definition ...
Mission(Navigator *navigator)
bool _mission_waypoints_changed
enum Mission::work_item_type WORK_ITEM_TYPE_DEFAULT
current type of work to do (sub mission item)
Helper class to use mission items.
void altitude_sp_foh_update()
Updates the altitude sp to follow a foh.
takeoff before moving to waypoint
void set_current_mission_item()
Set the current mission item.
DEFINE_PARAMETERS((ParamFloat< px4::params::MIS_DIST_1WP >) _param_mis_dist_1wp,(ParamFloat< px4::params::MIS_DIST_WPS >) _param_mis_dist_wps,(ParamInt< px4::params::MIS_ALTMODE >) _param_mis_altmode,(ParamInt< px4::params::MIS_MNT_YAW_CTL >) _param_mis_mnt_yaw_ctl) uORB mission_s _mission
< mission subscription
void on_inactivation() override
This function is called one time when mode becomes inactive.
int32_t _current_mission_index
bool need_to_reset_mission(bool active)
Returns true if we need to reset the mission.
float _distance_current_previous
distance from previous to current sp in pos_sp_triplet, only use if current and previous are valid ...
void report_do_jump_mission_changed(int index, int do_jumps_remaining)
Inform about a changed mission item after a DO_JUMP.
void check_mission_valid(bool force)
Check whether a mission is ready to go.
High-resolution timer with callouts and timekeeping.
Provides checks if mission is feasible given the navigation capabilities.
bool do_need_move_to_takeoff()
Returns true if we need to move to waypoint location after vtol takeoff.
void do_abort_landing()
Abort landing.
~Mission() override=default
bool _need_takeoff
if true, then takeoff must be performed before going to the first waypoint (if needed) ...
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
uint16_t _land_start_index
index of DO_LAND_START, INVALID_DO_LAND_START if no planned landing
move to land waypoint before descent
uint16_t get_land_start_index() const
bool get_mission_changed() const
bool get_mission_finished() const
bool set_current_mission_index(uint16_t index)
void reset_mission(struct mission_s &mission)
Reset mission.
void on_activation() override
This function is called one time when mode becomes active, pos_sp_triplet must be initialized here...
void cruising_speed_sp_update()
Update the cruising speed setpoint.
bool _execution_mode_changed
void heading_sp_update()
Updates the heading of the vehicle.
void set_closest_item_as_current()
void set_execution_mode(const uint8_t mode)
Set a new mission mode and handle the switching between the different modes.
bool _land_start_available
bool position_setpoint_equal(const position_setpoint_s *p1, const position_setpoint_s *p2) const
void update_mission()
Update mission topic.
bool get_land_start_available() const
bool find_mission_land_start()
Find and store the index of the landing sequence (DO_LAND_START)
bool do_need_move_to_land()
Returns true if we need to move to waypoint location before starting descent.
Base class for different modes in navigator.
void save_mission_state()
Save current mission state to dataman.
bool read_mission_item(int offset, struct mission_item_s *mission_item)
Read current (offset == 0) or a specific (offset > 0) mission item from the dataman and watch out for...
bool prepare_mission_items(mission_item_s *mission_item, mission_item_s *next_position_mission_item, bool *has_next_position_item)
Read the current and the next mission item.
bool do_need_vertical_takeoff()
Returns true if we need to do a takeoff at the current state.
float calculate_takeoff_altitude(struct mission_item_s *mission_item)
Calculate takeoff height for mission item considering ground clearance.
void set_mission_item_reached()
Set a mission item as reached.
void on_active() override
This function is called while the mode is active.
bool get_mission_waypoints_changed() const
void set_align_mission_item(struct mission_item_s *mission_item, struct mission_item_s *mission_item_next)
Create mission item to align towards next waypoint.
float _min_current_sp_distance_xy
< true if the mission changed since the mission mode was active
void set_mission_items()
Set new mission items.