AutoAPMS
Streamlining behaviors in ROS 2
Loading...
Searching...
No Matches
ModeRegistrationFactory< ModeT > Class Template Reference

Composable ROS 2 component that registers a custom PX4 mode and announces its dynamically assigned nav_state. More...

#include <auto_apms_px4/mode_registration.hpp>

Detailed Description

template<class ModeT>
class auto_apms_px4::ModeRegistrationFactory< ModeT >

Composable ROS 2 component that registers a custom PX4 mode and announces its dynamically assigned nav_state.

Use this to bring up a custom mode (a px4_ros2::ModeBase subclass constructible from (rclcpp::Node &, px4_ros2::ModeBase::Settings)) that is meant to be activated declaratively from a behavior tree via the SendCmdSetNavState node - as opposed to ModeProxyActionFactory, which drives a mode through a ROS 2 action.

On construction it instantiates the mode and delegates the registration sequence (wait for FMU, register, announce) to a ModeRegistrationHandler. Multiple factories can be composed into a single process through rclcpp_components; each announces its own mode on the shared registered_modes topic.

How the factory is deployed is up to the user. Within auto_apms_px4 we stick to rclcpp_components: derive a component class with an explicit MyComponent(const rclcpp::NodeOptions &) constructor that forwards the mode name, apply RCLCPP_COMPONENTS_REGISTER_NODE(MyComponent) and register it in CMake with rclcpp_components_register_nodes(<target> "MyComponent").

Template Parameters
ModeTCustom PX4 mode class inheriting px4_ros2::ModeBase.

Definition at line 132 of file mode_registration.hpp.


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