PX4 ROS 2 Interface Library
Library to interface with PX4 from a companion computer using ROS 2
px4_ros2::ActionInterface Class Referenceabstract

Interface class for an action. More...

#include <px4_ros2/mission/actions/action.hpp>

Inheritance diagram for px4_ros2::ActionInterface:
px4_ros2::default_actions::ChangeSettings px4_ros2::default_actions::Hold px4_ros2::default_actions::Land px4_ros2::default_actions::OnFailure px4_ros2::default_actions::OnResume px4_ros2::default_actions::Rtl px4_ros2::default_actions::Takeoff

Public Member Functions

virtual std::string name () const =0
 
virtual bool canRun (const ActionArguments &arguments, std::vector< std::string > &errors)
 
virtual bool shouldStopAtWaypoint (const ActionArguments &arguments)
 
virtual bool supportsResumeFromLanded ()
 
virtual void run (const std::shared_ptr< ActionHandler > &handler, const ActionArguments &arguments, const std::function< void()> &on_completed)=0
 
virtual void deactivate ()
 

Detailed Description

Interface class for an action.

Member Function Documentation

◆ deactivate()

virtual void px4_ros2::ActionInterface::deactivate ( )
inlinevirtual

This is called when the mission gets deactivated, i.e., the user switches to a different mode, or the mission finished. It can be used to disable continuous actions.

Reimplemented in px4_ros2::default_actions::ChangeSettings, and px4_ros2::default_actions::Hold.

◆ shouldStopAtWaypoint()

virtual bool px4_ros2::ActionInterface::shouldStopAtWaypoint ( const ActionArguments arguments)
inlinevirtual

If this returns true, trajectory navigation stops the vehicle at the previous waypoint.

Reimplemented in px4_ros2::default_actions::ChangeSettings, px4_ros2::default_actions::Hold, px4_ros2::default_actions::Land, and px4_ros2::default_actions::Rtl.

◆ supportsResumeFromLanded()

virtual bool px4_ros2::ActionInterface::supportsResumeFromLanded ( )
inlinevirtual

If the action includes a landing with disarming sequence, this method can be used to return true, so that when activating the mission again, the action is directly called (w/o doing the mission takeoff first)

Returns
true if the action can be resumed from landed state

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