|
AutoAPMS
Streamlining behaviors in ROS 2
|
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>
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").
| ModeT | Custom PX4 mode class inheriting px4_ros2::ModeBase. |
Definition at line 132 of file mode_registration.hpp.