Nav2 Navigation Stack - humble
humble
ROS 2 Navigation Stack
|
A lifecycle node wrapper to enable common Nav2 needs such as manipulating parameters. More...
#include <nav2_util/include/nav2_util/lifecycle_node.hpp>
Classes | |
struct | floating_point_range |
struct | integer_range |
Public Member Functions | |
LifecycleNode (const std::string &node_name, const std::string &ns="", const rclcpp::NodeOptions &options=rclcpp::NodeOptions()) | |
A lifecycle node constructor. More... | |
void | add_parameter (const std::string &name, const rclcpp::ParameterValue &default_value, const std::string &description="", const std::string &additional_constraints="", bool read_only=false) |
Declare a parameter that has no integer or floating point range constraints. More... | |
void | add_parameter (const std::string &name, const rclcpp::ParameterValue &default_value, const floating_point_range fp_range, const std::string &description="", const std::string &additional_constraints="", bool read_only=false) |
Declare a parameter that has a floating point range constraint. More... | |
void | add_parameter (const std::string &name, const rclcpp::ParameterValue &default_value, const integer_range int_range, const std::string &description="", const std::string &additional_constraints="", bool read_only=false) |
Declare a parameter that has an integer range constraint. More... | |
std::shared_ptr< nav2_util::LifecycleNode > | shared_from_this () |
Get a shared pointer of this. | |
nav2_util::CallbackReturn | on_error (const rclcpp_lifecycle::State &) |
Abstracted on_error state transition callback, since unimplemented as of 2020 in the managed ROS2 node state machine. More... | |
virtual void | on_rcl_preshutdown () |
Perform preshutdown activities before our Context is shutdown. Note that this is related to our Context's shutdown sequence, not the lifecycle node state machine. | |
void | createBond () |
Create bond connection to lifecycle manager. | |
void | destroyBond () |
Destroy bond connection to lifecycle manager. | |
Protected Member Functions | |
void | printLifecycleNodeNotification () |
Print notifications for lifecycle node. | |
void | register_rcl_preshutdown_callback () |
void | runCleanups () |
Protected Attributes | |
std::unique_ptr< rclcpp::PreShutdownCallbackHandle > | rcl_preshutdown_cb_handle_ {nullptr} |
std::unique_ptr< bond::Bond > | bond_ {nullptr} |
A lifecycle node wrapper to enable common Nav2 needs such as manipulating parameters.
Definition at line 37 of file lifecycle_node.hpp.
nav2_util::LifecycleNode::LifecycleNode | ( | const std::string & | node_name, |
const std::string & | ns = "" , |
||
const rclcpp::NodeOptions & | options = rclcpp::NodeOptions() |
||
) |
A lifecycle node constructor.
node_name | Name for the node |
namespace | Namespace for the node, if any |
options | Node options |
Definition at line 26 of file lifecycle_node.cpp.
References printLifecycleNodeNotification(), and register_rcl_preshutdown_callback().
|
inline |
Declare a parameter that has a floating point range constraint.
node_name | Name of parameter |
default_value | Default node value to add |
fp_range | floating point range |
description | Node description |
additional_constraints | Any additional constraints on the parameters to list |
read_only | Whether this param should be considered read only |
Definition at line 98 of file lifecycle_node.hpp.
|
inline |
Declare a parameter that has an integer range constraint.
node_name | Name of parameter |
default_value | Default node value to add |
integer_range | Integer range |
description | Node description |
additional_constraints | Any additional constraints on the parameters to list |
read_only | Whether this param should be considered read only |
Definition at line 127 of file lifecycle_node.hpp.
|
inline |
Declare a parameter that has no integer or floating point range constraints.
node_name | Name of parameter |
default_value | Default node value to add |
description | Node description |
additional_constraints | Any additional constraints on the parameters to list |
read_only | Whether this param should be considered read only |
Definition at line 74 of file lifecycle_node.hpp.
|
inline |
Abstracted on_error state transition callback, since unimplemented as of 2020 in the managed ROS2 node state machine.
state | State prior to error transition |
Definition at line 162 of file lifecycle_node.hpp.
|
protected |
Register our preshutdown callback for this Node's rcl Context. The callback fires before this Node's Context is shutdown. Note this is not directly related to the lifecycle state machine.
Definition at line 101 of file lifecycle_node.cpp.
References on_rcl_preshutdown().
Referenced by LifecycleNode().
|
protected |
Run some common cleanup steps shared between rcl preshutdown and destruction.
Definition at line 70 of file lifecycle_node.cpp.
Referenced by on_rcl_preshutdown(), and nav2_costmap_2d::Costmap2DROS::on_rcl_preshutdown().