APM:Libraries
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
AP_Mission Class Reference

Object managing Mission. More...

#include <AP_Mission.h>

Collaboration diagram for AP_Mission:
[legend]

Classes

struct  Altitude_Wait
 
struct  Cam_Trigg_Distance
 
struct  Change_Speed_Command
 
struct  Conditional_Delay_Command
 
struct  Conditional_Distance_Command
 
union  Content
 
struct  Digicam_Configure
 
struct  Digicam_Control
 
struct  Do_Engine_Control
 
struct  Do_VTOL_Transition
 
struct  Gripper_Command
 
struct  Guided_Limits_Command
 
struct  Jump_Command
 
struct  jump_tracking_struct
 
struct  Mission_Command
 
struct  Mission_Flags
 
struct  Mount_Control
 
struct  Navigation_Delay_Command
 
struct  Repeat_Relay_Command
 
struct  Repeat_Servo_Command
 
struct  Set_Relay_Command
 
struct  Set_Servo_Command
 
struct  Set_Yaw_Speed
 
struct  Winch_Command
 
struct  Yaw_Command
 

Public Types

enum  mission_state { MISSION_STOPPED =0, MISSION_RUNNING =1, MISSION_COMPLETE =2 }
 

Public Member Functions

 FUNCTOR_TYPEDEF (mission_cmd_fn_t, bool, const Mission_Command &)
 
 FUNCTOR_TYPEDEF (mission_complete_fn_t, void)
 
 AP_Mission (AP_AHRS &ahrs, mission_cmd_fn_t cmd_start_fn, mission_cmd_fn_t cmd_verify_fn, mission_complete_fn_t mission_complete_fn)
 
 AP_Mission (const AP_Mission &other)=delete
 
AP_Missionoperator= (const AP_Mission &)=delete
 
void init ()
 init - initialises this library including checks the version in eeprom matches this library More...
 
mission_state state () const
 status - returns the status of the mission (i.e. Mission_Started, Mission_Complete, Mission_Stopped More...
 
uint16_t num_commands () const
 
uint16_t num_commands_max () const
 num_commands_max - returns maximum number of commands that can be stored More...
 
void start ()
 
void stop ()
 stop - stops mission execution. subsequent calls to update() will have no effect until the mission is started or resumed More...
 
void resume ()
 
void start_or_resume ()
 start_or_resume - if MIS_AUTORESTART=0 this will call resume(), otherwise it will call start() More...
 
bool starts_with_takeoff_cmd ()
 check mission starts with a takeoff command More...
 
void reset ()
 reset - reset mission to the first command More...
 
bool clear ()
 
void truncate (uint16_t index)
 truncate - truncate any mission items beyond given index More...
 
void update ()
 
bool add_cmd (Mission_Command &cmd)
 
bool replace_cmd (uint16_t index, Mission_Command &cmd)
 
const Mission_Commandget_current_nav_cmd () const
 get_current_nav_cmd - returns the current "navigation" command More...
 
uint16_t get_current_nav_index () const
 
uint16_t get_prev_nav_cmd_id () const
 
uint16_t get_prev_nav_cmd_index () const
 
uint16_t get_prev_nav_cmd_with_wp_index () const
 
bool get_next_nav_cmd (uint16_t start_index, Mission_Command &cmd)
 
int32_t get_next_ground_course_cd (int32_t default_angle)
 
const Mission_Commandget_current_do_cmd () const
 get_current_do_cmd - returns active "do" command More...
 
bool set_current_cmd (uint16_t index)
 
bool read_cmd_from_storage (uint16_t index, Mission_Command &cmd) const
 
bool write_cmd_to_storage (uint16_t index, Mission_Command &cmd)
 
void write_home_to_storage ()
 
uint32_t last_change_time_ms (void) const
 
uint16_t get_landing_sequence_start ()
 
bool jump_to_landing_sequence (void)
 

Static Public Member Functions

static bool is_nav_cmd (const Mission_Command &cmd)
 is_nav_cmd - returns true if the command's id is a "navigation" command, false if "do" or "conditional" command More...
 
static MAV_MISSION_RESULT mavlink_to_mission_cmd (const mavlink_mission_item_t &packet, AP_Mission::Mission_Command &cmd)
 
static MAV_MISSION_RESULT mavlink_int_to_mission_cmd (const mavlink_mission_item_int_t &packet, AP_Mission::Mission_Command &cmd)
 
static MAV_MISSION_RESULT mavlink_cmd_long_to_mission_cmd (const mavlink_command_long_t &packet, AP_Mission::Mission_Command &cmd)
 
static bool mission_cmd_to_mavlink (const AP_Mission::Mission_Command &cmd, mavlink_mission_item_t &packet)
 
static bool mission_cmd_to_mavlink_int (const AP_Mission::Mission_Command &cmd, mavlink_mission_item_int_t &packet)
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Private Member Functions

void complete ()
 complete - mission is marked complete and clean-up performed including calling the mission_complete_fn More...
 
bool advance_current_nav_cmd ()
 
void advance_current_do_cmd ()
 
bool get_next_cmd (uint16_t start_index, Mission_Command &cmd, bool increment_jump_num_times_if_found)
 
bool get_next_do_cmd (uint16_t start_index, Mission_Command &cmd)
 
void init_jump_tracking ()
 
int16_t get_jump_times_run (const Mission_Command &cmd)
 get_jump_times_run - returns number of times the jump command has been run More...
 
void increment_jump_times_run (Mission_Command &cmd)
 increment_jump_times_run - increments the recorded number of times the jump command has been run More...
 
void check_eeprom_version ()
 

Static Private Member Functions

static MAV_MISSION_RESULT sanity_check_params (const mavlink_mission_item_int_t &packet)
 sanity checks that the masked fields are not NaN's or infinite More...
 

Private Attributes

struct AP_Mission::Mission_Flags _flags
 
const AP_AHRS_ahrs
 
AP_Int16 _cmd_total
 
AP_Int8 _restart
 
AP_Int16 _options
 
mission_cmd_fn_t _cmd_start_fn
 
mission_cmd_fn_t _cmd_verify_fn
 
mission_complete_fn_t _mission_complete_fn
 
struct Mission_Command _nav_cmd
 
struct Mission_Command _do_cmd
 
uint16_t _prev_nav_cmd_id
 
uint16_t _prev_nav_cmd_index
 
uint16_t _prev_nav_cmd_wp_index
 
struct AP_Mission::jump_tracking_struct _jump_tracking [AP_MISSION_MAX_NUM_DO_JUMP_COMMANDS]
 
uint32_t _last_change_time_ms
 

Static Private Attributes

static StorageAccess _storage
 

Detailed Description

Object managing Mission.

Definition at line 45 of file AP_Mission.h.

Member Enumeration Documentation

◆ mission_state

Enumerator
MISSION_STOPPED 
MISSION_RUNNING 
MISSION_COMPLETE 

Definition at line 312 of file AP_Mission.h.

Constructor & Destructor Documentation

◆ AP_Mission() [1/2]

AP_Mission::AP_Mission ( AP_AHRS ahrs,
mission_cmd_fn_t  cmd_start_fn,
mission_cmd_fn_t  cmd_verify_fn,
mission_complete_fn_t  mission_complete_fn 
)
inline

Definition at line 284 of file AP_Mission.h.

Here is the call graph for this function:

◆ AP_Mission() [2/2]

AP_Mission::AP_Mission ( const AP_Mission other)
delete

Member Function Documentation

◆ add_cmd()

bool AP_Mission::add_cmd ( Mission_Command cmd)

public command methodsadd_cmd - adds a command to the end of the command list and writes to storage returns true if successfully added, false on failure cmd.index is updated with it's new position in the mission

Definition at line 254 of file AP_Mission.cpp.

Referenced by GCS_MAVLINK::handle_mission_item(), MissionTest::init_mission(), MissionTest::init_mission_endless_loop(), MissionTest::init_mission_ends_with_do_commands(), MissionTest::init_mission_ends_with_jump_command(), MissionTest::init_mission_jump_to_nonnav(), MissionTest::init_mission_no_nav_commands(), MissionTest::init_mission_starts_with_do_commands(), num_commands(), MissionTest::run_max_cmd_test(), MissionTest::run_replace_cmd_test(), MissionTest::run_resume_test(), MissionTest::run_set_current_cmd_test(), and MissionTest::run_set_current_cmd_while_stopped_test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ advance_current_do_cmd()

void AP_Mission::advance_current_do_cmd ( )
private

advance_current_do_cmd - moves current do command forward accounts for do-jump commands returns true if successfully advanced (can it ever be unsuccessful?)

advance_current_do_cmd - moves current do command forward accounts for do-jump commands

Definition at line 1462 of file AP_Mission.cpp.

Referenced by update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ advance_current_nav_cmd()

bool AP_Mission::advance_current_nav_cmd ( )
private

advance_current_nav_cmd - moves current nav command forward do command will also be loaded accounts for do-jump commands

Definition at line 1381 of file AP_Mission.cpp.

Referenced by start(), and update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_eeprom_version()

void AP_Mission::check_eeprom_version ( )
private

check_eeprom_version - checks version of missions stored in eeprom matches this library command list will be cleared if they do not match

Definition at line 1669 of file AP_Mission.cpp.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

bool AP_Mission::clear ( void  )

clear - clears out mission returns true if mission was running so it could not be cleared

Definition at line 175 of file AP_Mission.cpp.

Referenced by check_eeprom_version(), GCS_MAVLINK::handle_mission_clear_all(), init(), MissionTest::init_mission(), MissionTest::init_mission_endless_loop(), MissionTest::init_mission_ends_with_do_commands(), MissionTest::init_mission_ends_with_jump_command(), MissionTest::init_mission_jump_to_nonnav(), MissionTest::init_mission_no_nav_commands(), MissionTest::init_mission_starts_with_do_commands(), and num_commands().

Here is the caller graph for this function:

◆ complete()

void AP_Mission::complete ( )
private

complete - mission is marked complete and clean-up performed including calling the mission_complete_fn

private methods

Definition at line 1368 of file AP_Mission.cpp.

Referenced by set_current_cmd(), start(), and update().

Here is the caller graph for this function:

◆ FUNCTOR_TYPEDEF() [1/2]

AP_Mission::FUNCTOR_TYPEDEF ( mission_cmd_fn_t  ,
bool  ,
const Mission_Command  
)

◆ FUNCTOR_TYPEDEF() [2/2]

AP_Mission::FUNCTOR_TYPEDEF ( mission_complete_fn_t  ,
void   
)

◆ get_current_do_cmd()

const Mission_Command& AP_Mission::get_current_do_cmd ( ) const
inline

get_current_do_cmd - returns active "do" command

Definition at line 418 of file AP_Mission.h.

Here is the call graph for this function:

◆ get_current_nav_cmd()

const Mission_Command& AP_Mission::get_current_nav_cmd ( ) const
inline

get_current_nav_cmd - returns the current "navigation" command

Definition at line 384 of file AP_Mission.h.

Referenced by AP_AdvancedFailsafe::check(), GCS_MAVLINK::handle_mission_request(), and AP_Landing::restart_landing_sequence().

Here is the caller graph for this function:

◆ get_current_nav_index()

uint16_t AP_Mission::get_current_nav_index ( ) const
inline

get_current_nav_index - returns the current "navigation" command index Note that this will return 0 if there is no command. This is used in MAVLink reporting of the mission command

Definition at line 389 of file AP_Mission.h.

Referenced by AP_Landing::restart_landing_sequence(), and GCS_MAVLINK::try_send_mission_message().

Here is the caller graph for this function:

◆ get_jump_times_run()

int16_t AP_Mission::get_jump_times_run ( const Mission_Command cmd)
private

get_jump_times_run - returns number of times the jump command has been run

get_jump_times_run - returns number of times the jump command has been run return is signed to be consistent with do-jump cmd's repeat count which can be -1 (to signify to repeat forever)

Definition at line 1615 of file AP_Mission.cpp.

Referenced by get_next_cmd().

Here is the caller graph for this function:

◆ get_landing_sequence_start()

uint16_t AP_Mission::get_landing_sequence_start ( )

Definition at line 1693 of file AP_Mission.cpp.

Referenced by jump_to_landing_sequence(), last_change_time_ms(), and AP_Landing::restart_landing_sequence().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_next_cmd()

bool AP_Mission::get_next_cmd ( uint16_t  start_index,
Mission_Command cmd,
bool  increment_jump_num_times_if_found 
)
private

get_next_cmd - gets next command found at or after start_index returns true if found, false if not found (i.e. mission complete) accounts for do_jump commands increment_jump_num_times_if_found should be set to true if advancing the active navigation command

Definition at line 1504 of file AP_Mission.cpp.

Referenced by advance_current_nav_cmd(), get_next_do_cmd(), get_next_nav_cmd(), and set_current_cmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_next_do_cmd()

bool AP_Mission::get_next_do_cmd ( uint16_t  start_index,
Mission_Command cmd 
)
private

get_next_do_cmd - gets next "do" or "conditional" command after start_index returns true if found, false if not found stops and returns false if it hits another navigation command before it finds the first do or conditional command accounts for do_jump commands but never increments the jump's num_times_run (get_next_nav_cmd is responsible for this)

get_next_do_cmd - gets next "do" or "conditional" command after start_index returns true if found, false if not found stops and returns false if it hits another navigation command before it finds the first do or conditional command accounts for do_jump commands but never increments the jump's num_times_run (advance_current_nav_cmd is responsible for this)

Definition at line 1578 of file AP_Mission.cpp.

Referenced by advance_current_do_cmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_next_ground_course_cd()

int32_t AP_Mission::get_next_ground_course_cd ( int32_t  default_angle)

get the ground course of the next navigation leg in centidegrees from 0 36000. Return default_angle if next navigation leg cannot be determined

Definition at line 321 of file AP_Mission.cpp.

Referenced by get_prev_nav_cmd_with_wp_index().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_next_nav_cmd()

bool AP_Mission::get_next_nav_cmd ( uint16_t  start_index,
Mission_Command cmd 
)

get_next_nav_cmd - gets next "navigation" command found at or after start_index returns true if found, false if not found (i.e. reached end of mission command list) accounts for do_jump commands

get_next_nav_cmd - gets next "navigation" command found at or after start_index returns true if found, false if not found (i.e. reached end of mission command list) accounts for do_jump commands but never increments the jump's num_times_run (advance_current_nav_cmd is responsible for this)

Definition at line 293 of file AP_Mission.cpp.

Referenced by get_next_ground_course_cd(), get_prev_nav_cmd_with_wp_index(), and starts_with_takeoff_cmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_prev_nav_cmd_id()

uint16_t AP_Mission::get_prev_nav_cmd_id ( ) const
inline

get_prev_nav_cmd_id - returns the previous "navigation" command id if there was no previous nav command it returns AP_MISSION_CMD_ID_NONE we do not return the entire command to save on RAM

Definition at line 395 of file AP_Mission.h.

Referenced by AP_Landing::type_slope_verify_land().

Here is the caller graph for this function:

◆ get_prev_nav_cmd_index()

uint16_t AP_Mission::get_prev_nav_cmd_index ( ) const
inline

get_prev_nav_cmd_index - returns the previous "navigation" commands index (i.e. position in the mission command list) if there was no previous nav command it returns AP_MISSION_CMD_INDEX_NONE we do not return the entire command to save on RAM

Definition at line 400 of file AP_Mission.h.

◆ get_prev_nav_cmd_with_wp_index()

uint16_t AP_Mission::get_prev_nav_cmd_with_wp_index ( ) const
inline

get_prev_nav_cmd_with_wp_index - returns the previous "navigation" commands index that contains a waypoint (i.e. position in the mission command list) if there was no previous nav command it returns AP_MISSION_CMD_INDEX_NONE we do not return the entire command to save on RAM

Definition at line 405 of file AP_Mission.h.

Referenced by AP_Landing::restart_landing_sequence().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ increment_jump_times_run()

void AP_Mission::increment_jump_times_run ( Mission_Command cmd)
private

increment_jump_times_run - increments the recorded number of times the jump command has been run

Definition at line 1641 of file AP_Mission.cpp.

Referenced by get_next_cmd().

Here is the caller graph for this function:

◆ init()

void AP_Mission::init ( void  )

init - initialises this library including checks the version in eeprom matches this library

public mission methods

Definition at line 45 of file AP_Mission.cpp.

Here is the call graph for this function:

◆ init_jump_tracking()

void AP_Mission::init_jump_tracking ( )
private

jump handling methods

Definition at line 1606 of file AP_Mission.cpp.

Referenced by reset(), and set_current_cmd().

Here is the caller graph for this function:

◆ is_nav_cmd()

bool AP_Mission::is_nav_cmd ( const Mission_Command cmd)
static

is_nav_cmd - returns true if the command's id is a "navigation" command, false if "do" or "conditional" command

Definition at line 284 of file AP_Mission.cpp.

Referenced by advance_current_nav_cmd(), get_next_do_cmd(), get_next_nav_cmd(), num_commands(), MissionTest::print_mission(), set_current_cmd(), MissionTest::start_cmd(), and MissionTest::verify_cmd().

Here is the caller graph for this function:

◆ jump_to_landing_sequence()

bool AP_Mission::jump_to_landing_sequence ( void  )

Definition at line 1727 of file AP_Mission.cpp.

Referenced by last_change_time_ms().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ last_change_time_ms()

uint32_t AP_Mission::last_change_time_ms ( void  ) const
inline

Definition at line 451 of file AP_Mission.h.

Here is the call graph for this function:

◆ mavlink_cmd_long_to_mission_cmd()

MAV_MISSION_RESULT AP_Mission::mavlink_cmd_long_to_mission_cmd ( const mavlink_command_long_t &  packet,
AP_Mission::Mission_Command cmd 
)
static

Definition at line 1019 of file AP_Mission.cpp.

Referenced by get_current_do_cmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mavlink_int_to_mission_cmd()

MAV_MISSION_RESULT AP_Mission::mavlink_int_to_mission_cmd ( const mavlink_mission_item_int_t &  packet,
AP_Mission::Mission_Command cmd 
)
static

Definition at line 577 of file AP_Mission.cpp.

Referenced by get_current_do_cmd(), GCS_MAVLINK::handle_mission_item(), and mavlink_to_mission_cmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mavlink_to_mission_cmd()

MAV_MISSION_RESULT AP_Mission::mavlink_to_mission_cmd ( const mavlink_mission_item_t &  packet,
AP_Mission::Mission_Command cmd 
)
static

Definition at line 922 of file AP_Mission.cpp.

Referenced by get_current_do_cmd(), GCS_MAVLINK::handle_mission_item(), and mavlink_cmd_long_to_mission_cmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mission_cmd_to_mavlink()

bool AP_Mission::mission_cmd_to_mavlink ( const AP_Mission::Mission_Command cmd,
mavlink_mission_item_t &  packet 
)
static

Definition at line 973 of file AP_Mission.cpp.

Referenced by get_current_do_cmd(), GCS_MAVLINK::handle_mission_request(), and DataFlash_Backend::Log_Write_Mission_Cmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mission_cmd_to_mavlink_int()

bool AP_Mission::mission_cmd_to_mavlink_int ( const AP_Mission::Mission_Command cmd,
mavlink_mission_item_int_t &  packet 
)
static

Definition at line 1037 of file AP_Mission.cpp.

Referenced by get_current_do_cmd(), GCS_MAVLINK::handle_mission_request(), and mission_cmd_to_mavlink().

Here is the caller graph for this function:

◆ num_commands()

uint16_t AP_Mission::num_commands ( ) const
inline

num_commands - returns total number of commands in the mission this number includes offset 0, the home location

Definition at line 330 of file AP_Mission.h.

Referenced by get_landing_sequence_start(), GCS_MAVLINK::handle_mission_item(), GCS_MAVLINK::handle_mission_request(), GCS_MAVLINK::handle_mission_request_list(), GCS_MAVLINK::handle_mission_write_partial_list(), DataFlash_Backend::Log_Write_Mission_Cmd(), MissionTest::print_mission(), and MissionTest::run_max_cmd_test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ num_commands_max()

uint16_t AP_Mission::num_commands_max ( void  ) const

num_commands_max - returns maximum number of commands that can be stored

Definition at line 1684 of file AP_Mission.cpp.

Referenced by GCS_MAVLINK::handle_mission_count(), num_commands(), MissionTest::run_max_cmd_test(), MissionTest::setup(), and write_cmd_to_storage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

AP_Mission& AP_Mission::operator= ( const AP_Mission )
delete

Referenced by AP_Mission().

Here is the caller graph for this function:

◆ read_cmd_from_storage()

bool AP_Mission::read_cmd_from_storage ( uint16_t  index,
Mission_Command cmd 
) const

load_cmd_from_storage - load command from storage true is return if successful

Definition at line 453 of file AP_Mission.cpp.

Referenced by get_current_do_cmd(), get_landing_sequence_start(), get_next_cmd(), GCS_MAVLINK::handle_mission_request(), MissionTest::print_mission(), AP_Landing::restart_landing_sequence(), resume(), and MissionTest::run_max_cmd_test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ replace_cmd()

bool AP_Mission::replace_cmd ( uint16_t  index,
Mission_Command cmd 
)

replace_cmd - replaces the command at position 'index' in the command list with the provided cmd replacing the current active command will have no effect until the command is restarted returns true if successfully replaced, false on failure

Definition at line 272 of file AP_Mission.cpp.

Referenced by GCS_MAVLINK::handle_mission_item(), num_commands(), and MissionTest::run_replace_cmd_test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void AP_Mission::reset ( )

reset - reset mission to the first command

Definition at line 160 of file AP_Mission.cpp.

Referenced by num_commands(), and start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resume()

void AP_Mission::resume ( )

resume - continues the mission execution from where we last left off previous running commands will be re-initialised

resume - continues the mission execution from where we last left off previous running commands will be re-initialized

Definition at line 86 of file AP_Mission.cpp.

Referenced by jump_to_landing_sequence(), num_commands(), MissionTest::run_resume_test(), MissionTest::run_set_current_cmd_while_stopped_test(), start_or_resume(), and AP_Landing::verify_abort_landing().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sanity_check_params()

MAV_MISSION_RESULT AP_Mission::sanity_check_params ( const mavlink_mission_item_int_t &  packet)
staticprivate

sanity checks that the masked fields are not NaN's or infinite

Definition at line 533 of file AP_Mission.cpp.

Referenced by mavlink_int_to_mission_cmd().

Here is the caller graph for this function:

◆ set_current_cmd()

bool AP_Mission::set_current_cmd ( uint16_t  index)

Definition at line 339 of file AP_Mission.cpp.

Referenced by AP_AdvancedFailsafe::check(), get_current_do_cmd(), GCS_MAVLINK::handle_mission_set_current(), jump_to_landing_sequence(), AP_Landing::restart_landing_sequence(), MissionTest::run_set_current_cmd_test(), and MissionTest::run_set_current_cmd_while_stopped_test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start()

void AP_Mission::start ( void  )

start - resets current commands to point to the beginning of the mission To-Do: should we validate the mission first and return true/false?

Definition at line 65 of file AP_Mission.cpp.

Referenced by num_commands(), resume(), MissionTest::run_mission_test(), MissionTest::run_replace_cmd_test(), MissionTest::run_resume_test(), MissionTest::run_set_current_cmd_test(), MissionTest::run_set_current_cmd_while_stopped_test(), and start_or_resume().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start_or_resume()

void AP_Mission::start_or_resume ( )

start_or_resume - if MIS_AUTORESTART=0 this will call resume(), otherwise it will call start()

Definition at line 150 of file AP_Mission.cpp.

Referenced by num_commands().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ starts_with_takeoff_cmd()

bool AP_Mission::starts_with_takeoff_cmd ( )

check mission starts with a takeoff command

Definition at line 132 of file AP_Mission.cpp.

Referenced by num_commands().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ state()

mission_state AP_Mission::state ( ) const
inline

status - returns the status of the mission (i.e. Mission_Started, Mission_Complete, Mission_Stopped

Definition at line 326 of file AP_Mission.h.

Referenced by jump_to_landing_sequence(), and MissionTest::run_set_current_cmd_while_stopped_test().

Here is the caller graph for this function:

◆ stop()

void AP_Mission::stop ( )

stop - stops mission execution. subsequent calls to update() will have no effect until the mission is started or resumed

Definition at line 79 of file AP_Mission.cpp.

Referenced by num_commands(), MissionTest::run_resume_test(), MissionTest::run_set_current_cmd_while_stopped_test(), and AP_Landing::verify_abort_landing().

Here is the caller graph for this function:

◆ truncate()

void AP_Mission::truncate ( uint16_t  index)

truncate - truncate any mission items beyond given index

trucate - truncate any mission items beyond index

Definition at line 197 of file AP_Mission.cpp.

Referenced by GCS_MAVLINK::handle_mission_count(), and num_commands().

Here is the caller graph for this function:

◆ update()

void AP_Mission::update ( void  )

update - ensures the command queues are loaded with the next command and calls main programs command_init and command_verify functions to progress the mission should be called at 10hz or higher

Definition at line 206 of file AP_Mission.cpp.

Referenced by num_commands(), MissionTest::run_mission_test(), MissionTest::run_replace_cmd_test(), MissionTest::run_resume_test(), MissionTest::run_set_current_cmd_test(), and MissionTest::run_set_current_cmd_while_stopped_test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_cmd_to_storage()

bool AP_Mission::write_cmd_to_storage ( uint16_t  index,
Mission_Command cmd 
)

write_cmd_to_storage - write a command to storage cmd.index is used to calculate the storage location true is returned if successful

write_cmd_to_storage - write a command to storage index is used to calculate the storage location true is returned if successful

Definition at line 494 of file AP_Mission.cpp.

Referenced by add_cmd(), get_current_do_cmd(), replace_cmd(), and write_home_to_storage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_home_to_storage()

void AP_Mission::write_home_to_storage ( )

write_home_to_storage - writes the special purpose cmd 0 (home) to storage home is taken directly from ahrs

Definition at line 525 of file AP_Mission.cpp.

Referenced by get_current_do_cmd().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _ahrs

const AP_AHRS& AP_Mission::_ahrs
private

◆ _cmd_start_fn

mission_cmd_fn_t AP_Mission::_cmd_start_fn
private

◆ _cmd_total

AP_Int16 AP_Mission::_cmd_total
private

◆ _cmd_verify_fn

mission_cmd_fn_t AP_Mission::_cmd_verify_fn
private

Definition at line 536 of file AP_Mission.h.

Referenced by update().

◆ _do_cmd

struct Mission_Command AP_Mission::_do_cmd
private

◆ _flags

struct AP_Mission::Mission_Flags AP_Mission::_flags
private

◆ _jump_tracking

struct AP_Mission::jump_tracking_struct AP_Mission::_jump_tracking[AP_MISSION_MAX_NUM_DO_JUMP_COMMANDS]
private

◆ _last_change_time_ms

uint32_t AP_Mission::_last_change_time_ms
private

Definition at line 553 of file AP_Mission.h.

Referenced by init(), last_change_time_ms(), and write_cmd_to_storage().

◆ _mission_complete_fn

mission_complete_fn_t AP_Mission::_mission_complete_fn
private

Definition at line 537 of file AP_Mission.h.

Referenced by complete().

◆ _nav_cmd

struct Mission_Command AP_Mission::_nav_cmd
private

◆ _options

AP_Int16 AP_Mission::_options
private

Definition at line 532 of file AP_Mission.h.

Referenced by init().

◆ _prev_nav_cmd_id

uint16_t AP_Mission::_prev_nav_cmd_id
private

Definition at line 542 of file AP_Mission.h.

Referenced by advance_current_nav_cmd(), get_prev_nav_cmd_id(), reset(), and set_current_cmd().

◆ _prev_nav_cmd_index

uint16_t AP_Mission::_prev_nav_cmd_index
private

◆ _prev_nav_cmd_wp_index

uint16_t AP_Mission::_prev_nav_cmd_wp_index
private

◆ _restart

AP_Int8 AP_Mission::_restart
private

Definition at line 531 of file AP_Mission.h.

Referenced by start_or_resume(), and starts_with_takeoff_cmd().

◆ _storage

StorageAccess AP_Mission::_storage
staticprivate

◆ var_info

const AP_Param::GroupInfo AP_Mission::var_info
static
Initial value:

Definition at line 464 of file AP_Mission.h.

Referenced by AP_Mission().


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