Nav2 Navigation Stack - humble
humble
ROS 2 Navigation Stack
|
Helper functions to interact with a lifecycle node. More...
#include <nav2_util/include/nav2_util/lifecycle_service_client.hpp>
Public Member Functions | |
LifecycleServiceClient (const std::string &lifecycle_node_name) | |
LifecycleServiceClient (const std::string &lifecycle_node_name, rclcpp::Node::SharedPtr parent_node) | |
bool | change_state (const uint8_t transition, const std::chrono::seconds timeout) |
Trigger a state change. More... | |
bool | change_state (std::uint8_t transition) |
Trigger a state change, returning result. | |
uint8_t | get_state (const std::chrono::seconds timeout=std::chrono::seconds(2)) |
Get the current state as a lifecycle_msgs::msg::State id value. More... | |
Protected Attributes | |
rclcpp::Node::SharedPtr | node_ |
ServiceClient< lifecycle_msgs::srv::ChangeState > | change_state_ |
ServiceClient< lifecycle_msgs::srv::GetState > | get_state_ |
Helper functions to interact with a lifecycle node.
Definition at line 31 of file lifecycle_service_client.hpp.
bool nav2_util::LifecycleServiceClient::change_state | ( | const uint8_t | transition, |
const std::chrono::seconds | timeout | ||
) |
Trigger a state change.
Throws std::runtime_error on failure
uint8_t nav2_util::LifecycleServiceClient::get_state | ( | const std::chrono::seconds | timeout = std::chrono::seconds(2) | ) |
Get the current state as a lifecycle_msgs::msg::State id value.
Throws std::runtime_error on failure
Definition at line 90 of file lifecycle_service_client.cpp.