Nav2 Navigation Stack - jazzy  jazzy
ROS 2 Navigation Stack
Public Member Functions | Protected Attributes | List of all members
nav2_util::LifecycleServiceClient Class Reference

Helper functions to interact with a lifecycle node. More...

#include <nav2_util/include/nav2_util/lifecycle_service_client.hpp>

Collaboration diagram for nav2_util::LifecycleServiceClient:
Collaboration graph
[legend]

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_
 

Detailed Description

Helper functions to interact with a lifecycle node.

Definition at line 31 of file lifecycle_service_client.hpp.

Member Function Documentation

◆ change_state()

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

◆ get_state()

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.


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