Base class for a mode.
More...
#include <px4_ros2/components/mode.hpp>
|
using | ModeID = uint8_t |
| Mode ID, corresponds to nav_state.
|
|
|
static constexpr ModeID | kModeIDInvalid = 0xff |
|
static constexpr ModeID | kModeIDPosctl |
|
static constexpr ModeID | kModeIDTakeoff |
|
static constexpr ModeID | kModeIDDescend |
|
static constexpr ModeID | kModeIDLand |
|
static constexpr ModeID | kModeIDRtl |
|
static constexpr ModeID | kModeIDPrecisionLand |
|
static constexpr ModeID | kModeIDLoiter |
|
|
void | setSkipMessageCompatibilityCheck () |
|
void | overrideRegistration (const std::shared_ptr< Registration > ®istration) |
|
◆ checkArmingAndRunConditions()
Report any custom mode requirements. This is called regularly, also while the mode is active.
◆ completed()
void px4_ros2::ModeBase::completed |
( |
Result |
result | ) |
|
Mode completed signal. Call this when the mode is finished. A mode might never call this, but modes like RTL, Land or Takeoff are expected to signal their completion.
- Parameters
-
◆ doRegister()
bool px4_ros2::ModeBase::doRegister |
( |
| ) |
|
Register the mode. Call this once on startup, unless there's an associated executor. This is a blocking method.
- Returns
- true on success
◆ modeRequirements()
Get / modify mode requirements. These are generally automatically set based on selected setpoint types, and are used to prevent arming or trigger failsafes.
◆ onActivate()
virtual void px4_ros2::ModeBase::onActivate |
( |
| ) |
|
|
pure virtual |
Called whenever the mode is activated, also if the vehicle is disarmed
◆ onDeactivate()
virtual void px4_ros2::ModeBase::onDeactivate |
( |
| ) |
|
|
pure virtual |
Called whenever the mode is deactivated, also if the vehicle is disarmed
◆ setSetpointUpdateRate()
void px4_ros2::ModeBase::setSetpointUpdateRate |
( |
float |
rate_hz | ) |
|
Set the update rate when the mode is active. This is set automatically from the configured setpoints, but can be set as needed.
- Parameters
-
rate_hz | set to 0 to disable |
◆ kModeIDDescend
constexpr ModeID px4_ros2::ModeBase::kModeIDDescend |
|
staticconstexpr |
Initial value:=
px4_msgs::msg::VehicleStatus::NAVIGATION_STATE_DESCEND
◆ kModeIDLand
constexpr ModeID px4_ros2::ModeBase::kModeIDLand |
|
staticconstexpr |
Initial value:=
px4_msgs::msg::VehicleStatus::NAVIGATION_STATE_AUTO_LAND
◆ kModeIDLoiter
constexpr ModeID px4_ros2::ModeBase::kModeIDLoiter |
|
staticconstexpr |
Initial value:=
px4_msgs::msg::VehicleStatus::NAVIGATION_STATE_AUTO_LOITER
◆ kModeIDPosctl
constexpr ModeID px4_ros2::ModeBase::kModeIDPosctl |
|
staticconstexpr |
Initial value:=
px4_msgs::msg::VehicleStatus::NAVIGATION_STATE_POSCTL
◆ kModeIDPrecisionLand
constexpr ModeID px4_ros2::ModeBase::kModeIDPrecisionLand |
|
staticconstexpr |
Initial value:=
px4_msgs::msg::VehicleStatus::NAVIGATION_STATE_AUTO_PRECLAND
◆ kModeIDRtl
constexpr ModeID px4_ros2::ModeBase::kModeIDRtl |
|
staticconstexpr |
Initial value:=
px4_msgs::msg::VehicleStatus::NAVIGATION_STATE_AUTO_RTL
◆ kModeIDTakeoff
constexpr ModeID px4_ros2::ModeBase::kModeIDTakeoff |
|
staticconstexpr |
Initial value:=
px4_msgs::msg::VehicleStatus::NAVIGATION_STATE_AUTO_TAKEOFF
The documentation for this class was generated from the following file:
- px4_ros2_cpp/include/px4_ros2/components/mode.hpp