rclcpp_lifecycle
master
C++ ROS Lifecycle Library API
|
LifecycleNode for creating lifecycle components. More...
#include <lifecycle_node.hpp>
Public Types | |
using | OnSetParametersCallbackHandle = rclcpp::node_interfaces::OnSetParametersCallbackHandle |
using | OnParametersSetCallbackType = rclcpp::node_interfaces::NodeParametersInterface::OnParametersSetCallbackType |
Public Types inherited from rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface | |
enum | CallbackReturn : uint8_t { CallbackReturn::SUCCESS = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_SUCCESS, CallbackReturn::FAILURE = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_FAILURE, CallbackReturn::ERROR = lifecycle_msgs::msg::Transition::TRANSITION_CALLBACK_ERROR } |
Public Member Functions | |
LifecycleNode (const std::string &node_name, const rclcpp::NodeOptions &options=rclcpp::NodeOptions(), bool enable_communication_interface=true) | |
Create a new lifecycle node with the specified name. More... | |
LifecycleNode (const std::string &node_name, const std::string &namespace_, const rclcpp::NodeOptions &options=rclcpp::NodeOptions(), bool enable_communication_interface=true) | |
Create a node based on the node name and a rclcpp::Context. More... | |
virtual | ~LifecycleNode () |
const char * | get_name () const |
Get the name of the node. More... | |
const char * | get_namespace () const |
Get the namespace of the node. More... | |
rclcpp::Logger | get_logger () const |
Get the logger of the node. More... | |
rclcpp::CallbackGroup::SharedPtr | create_callback_group (rclcpp::CallbackGroupType group_type, bool automatically_add_to_executor_with_node=true) |
Create and return a callback group. More... | |
const std::vector< rclcpp::CallbackGroup::WeakPtr > & | get_callback_groups () const |
Return the list of callback groups in the node. More... | |
template<typename MessageT , typename AllocatorT = std::allocator<void>> | |
std::shared_ptr< rclcpp_lifecycle::LifecyclePublisher< MessageT, AllocatorT > > | create_publisher (const std::string &topic_name, const rclcpp::QoS &qos, const PublisherOptionsWithAllocator< AllocatorT > &options=(create_default_publisher_options< AllocatorT >())) |
Create and return a Publisher. More... | |
template<typename MessageT , typename CallbackT , typename AllocatorT = std::allocator<void>, typename CallbackMessageT = typename rclcpp::subscription_traits::has_message_type<CallbackT>::type, typename SubscriptionT = rclcpp::Subscription<MessageT, AllocatorT>, typename MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy< CallbackMessageT, AllocatorT >> | |
std::shared_ptr< SubscriptionT > | create_subscription (const std::string &topic_name, const rclcpp::QoS &qos, CallbackT &&callback, const SubscriptionOptionsWithAllocator< AllocatorT > &options=create_default_subscription_options< AllocatorT >(), typename MessageMemoryStrategyT::SharedPtr msg_mem_strat=(MessageMemoryStrategyT::create_default())) |
Create and return a Subscription. More... | |
template<typename DurationRepT = int64_t, typename DurationT = std::milli, typename CallbackT > | |
rclcpp::WallTimer< CallbackT >::SharedPtr | create_wall_timer (std::chrono::duration< DurationRepT, DurationT > period, CallbackT callback, rclcpp::CallbackGroup::SharedPtr group=nullptr) |
Create a timer. More... | |
template<typename ServiceT > | |
rclcpp::Client< ServiceT >::SharedPtr | create_client (const std::string &service_name, const rmw_qos_profile_t &qos_profile=rmw_qos_profile_services_default, rclcpp::CallbackGroup::SharedPtr group=nullptr) |
Create and return a Client. More... | |
template<typename ServiceT , typename CallbackT > | |
rclcpp::Service< ServiceT >::SharedPtr | create_service (const std::string &service_name, CallbackT &&callback, const rmw_qos_profile_t &qos_profile=rmw_qos_profile_services_default, rclcpp::CallbackGroup::SharedPtr group=nullptr) |
Create and return a Service. More... | |
template<typename AllocatorT = std::allocator<void>> | |
std::shared_ptr< rclcpp::GenericPublisher > | create_generic_publisher (const std::string &topic_name, const std::string &topic_type, const rclcpp::QoS &qos, const rclcpp::PublisherOptionsWithAllocator< AllocatorT > &options=(rclcpp::PublisherOptionsWithAllocator< AllocatorT >())) |
Create and return a GenericPublisher. More... | |
template<typename AllocatorT = std::allocator<void>> | |
std::shared_ptr< rclcpp::GenericSubscription > | create_generic_subscription (const std::string &topic_name, const std::string &topic_type, const rclcpp::QoS &qos, std::function< void(std::shared_ptr< rclcpp::SerializedMessage >)> callback, const rclcpp::SubscriptionOptionsWithAllocator< AllocatorT > &options=(rclcpp::SubscriptionOptionsWithAllocator< AllocatorT >())) |
Create and return a GenericSubscription. More... | |
const rclcpp::ParameterValue & | declare_parameter (const std::string &name, const rclcpp::ParameterValue &default_value, const rcl_interfaces::msg::ParameterDescriptor ¶meter_descriptor=rcl_interfaces::msg::ParameterDescriptor(), bool ignore_override=false) |
Declare and initialize a parameter, return the effective value. More... | |
const rclcpp::ParameterValue & | declare_parameter (const std::string &name, rclcpp::ParameterType type, const rcl_interfaces::msg::ParameterDescriptor ¶meter_descriptor=rcl_interfaces::msg::ParameterDescriptor{}, bool ignore_override=false) |
Declare and initialize a parameter, return the effective value. More... | |
const rclcpp::ParameterValue & | declare_parameter (const std::string &name) |
Declare a parameter. More... | |
template<typename ParameterT > | |
auto | declare_parameter (const std::string &name, const ParameterT &default_value, const rcl_interfaces::msg::ParameterDescriptor ¶meter_descriptor=rcl_interfaces::msg::ParameterDescriptor(), bool ignore_override=false) |
Declare and initialize a parameter with a type. More... | |
template<typename ParameterT > | |
auto | declare_parameter (const std::string &name, const rcl_interfaces::msg::ParameterDescriptor ¶meter_descriptor=rcl_interfaces::msg::ParameterDescriptor(), bool ignore_override=false) |
Declare and initialize a parameter with a type. More... | |
template<typename ParameterT > | |
std::vector< ParameterT > | declare_parameters (const std::string &namespace_, const std::map< std::string, ParameterT > ¶meters) |
Declare and initialize several parameters with the same namespace and type. More... | |
template<typename ParameterT > | |
std::vector< ParameterT > | declare_parameters (const std::string &namespace_, const std::map< std::string, std::pair< ParameterT, rcl_interfaces::msg::ParameterDescriptor > > ¶meters) |
Declare and initialize several parameters with the same namespace and type. More... | |
void | undeclare_parameter (const std::string &name) |
Undeclare a previously declared parameter. More... | |
bool | has_parameter (const std::string &name) const |
Return true if a given parameter is declared. More... | |
rcl_interfaces::msg::SetParametersResult | set_parameter (const rclcpp::Parameter ¶meter) |
Set a single parameter. More... | |
std::vector< rcl_interfaces::msg::SetParametersResult > | set_parameters (const std::vector< rclcpp::Parameter > ¶meters) |
Set one or more parameters, one at a time. More... | |
rcl_interfaces::msg::SetParametersResult | set_parameters_atomically (const std::vector< rclcpp::Parameter > ¶meters) |
Set one or more parameters, all at once. More... | |
rclcpp::Parameter | get_parameter (const std::string &name) const |
Return the parameter by the given name. More... | |
bool | get_parameter (const std::string &name, rclcpp::Parameter ¶meter) const |
Get the value of a parameter by the given name, and return true if it was set. More... | |
template<typename ParameterT > | |
bool | get_parameter (const std::string &name, ParameterT ¶meter) const |
Get the value of a parameter by the given name, and return true if it was set. More... | |
template<typename ParameterT > | |
bool | get_parameter_or (const std::string &name, ParameterT &value, const ParameterT &alternative_value) const |
Get the parameter value, or the "alternative_value" if not set, and assign it to "parameter". More... | |
std::vector< rclcpp::Parameter > | get_parameters (const std::vector< std::string > &names) const |
Return the parameters by the given parameter names. More... | |
template<typename MapValueT > | |
bool | get_parameters (const std::string &prefix, std::map< std::string, MapValueT > &values) const |
Get the parameter values for all parameters that have a given prefix. More... | |
rcl_interfaces::msg::ParameterDescriptor | describe_parameter (const std::string &name) const |
Return the parameter descriptor for the given parameter name. More... | |
std::vector< rcl_interfaces::msg::ParameterDescriptor > | describe_parameters (const std::vector< std::string > &names) const |
Return a vector of parameter descriptors, one for each of the given names. More... | |
std::vector< uint8_t > | get_parameter_types (const std::vector< std::string > &names) const |
Return a vector of parameter types, one for each of the given names. More... | |
rcl_interfaces::msg::ListParametersResult | list_parameters (const std::vector< std::string > &prefixes, uint64_t depth) const |
Return a list of parameters with any of the given prefixes, up to the given depth. More... | |
RCUTILS_WARN_UNUSED rclcpp_lifecycle::LifecycleNode::OnSetParametersCallbackHandle::SharedPtr | add_on_set_parameters_callback (rclcpp_lifecycle::LifecycleNode::OnParametersSetCallbackType callback) |
Add a callback for when parameters are being set. More... | |
void | remove_on_set_parameters_callback (const rclcpp_lifecycle::LifecycleNode::OnSetParametersCallbackHandle *const handler) |
Remove a callback registered with add_on_set_parameters_callback . More... | |
std::vector< std::string > | get_node_names () const |
Return a vector of existing node names (string). More... | |
std::map< std::string, std::vector< std::string > > | get_topic_names_and_types (bool no_demangle=false) const |
Return a map of existing topic names to list of topic types. More... | |
std::map< std::string, std::vector< std::string > > | get_service_names_and_types () const |
Return a map of existing service names to list of topic types. More... | |
std::map< std::string, std::vector< std::string > > | get_service_names_and_types_by_node (const std::string &node_name, const std::string &namespace_) const |
Return a map of existing service names to list of service types for a specific node. More... | |
size_t | count_publishers (const std::string &topic_name) const |
Return the number of publishers that are advertised on a given topic. More... | |
size_t | count_subscribers (const std::string &topic_name) const |
Return the number of subscribers who have created a subscription for a given topic. More... | |
std::vector< rclcpp::TopicEndpointInfo > | get_publishers_info_by_topic (const std::string &topic_name, bool no_mangle=false) const |
Return the topic endpoint information about publishers on a given topic. More... | |
std::vector< rclcpp::TopicEndpointInfo > | get_subscriptions_info_by_topic (const std::string &topic_name, bool no_mangle=false) const |
Return the topic endpoint information about subscriptions on a given topic. More... | |
rclcpp::Event::SharedPtr | get_graph_event () |
Return a graph event, which will be set anytime a graph change occurs. More... | |
void | wait_for_graph_change (rclcpp::Event::SharedPtr event, std::chrono::nanoseconds timeout) |
Wait for a graph event to occur by waiting on an Event to become set. More... | |
rclcpp::Clock::SharedPtr | get_clock () |
Get a clock as a non-const shared pointer which is managed by the node. More... | |
rclcpp::Clock::ConstSharedPtr | get_clock () const |
Get a clock as a const shared pointer which is managed by the node. More... | |
rclcpp::Time | now () const |
Returns current time from the time source specified by clock_type. More... | |
rclcpp::node_interfaces::NodeBaseInterface::SharedPtr | get_node_base_interface () |
Return the Node's internal NodeBaseInterface implementation. More... | |
rclcpp::node_interfaces::NodeClockInterface::SharedPtr | get_node_clock_interface () |
Return the Node's internal NodeClockInterface implementation. More... | |
rclcpp::node_interfaces::NodeGraphInterface::SharedPtr | get_node_graph_interface () |
Return the Node's internal NodeGraphInterface implementation. More... | |
rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr | get_node_logging_interface () |
Return the Node's internal NodeLoggingInterface implementation. More... | |
rclcpp::node_interfaces::NodeTimersInterface::SharedPtr | get_node_timers_interface () |
Return the Node's internal NodeTimersInterface implementation. More... | |
rclcpp::node_interfaces::NodeTopicsInterface::SharedPtr | get_node_topics_interface () |
Return the Node's internal NodeTopicsInterface implementation. More... | |
rclcpp::node_interfaces::NodeServicesInterface::SharedPtr | get_node_services_interface () |
Return the Node's internal NodeServicesInterface implementation. More... | |
rclcpp::node_interfaces::NodeParametersInterface::SharedPtr | get_node_parameters_interface () |
Return the Node's internal NodeParametersInterface implementation. More... | |
rclcpp::node_interfaces::NodeTimeSourceInterface::SharedPtr | get_node_time_source_interface () |
Return the Node's internal NodeParametersInterface implementation. More... | |
rclcpp::node_interfaces::NodeWaitablesInterface::SharedPtr | get_node_waitables_interface () |
Return the Node's internal NodeWaitablesInterface implementation. More... | |
const rclcpp::NodeOptions & | get_node_options () const |
Return the NodeOptions used when creating this node. More... | |
const State & | get_current_state () |
Return the current State. More... | |
std::vector< State > | get_available_states () |
Return a list with the available states. More... | |
std::vector< Transition > | get_available_transitions () |
Return a list with the current available transitions. More... | |
std::vector< Transition > | get_transition_graph () |
Return a list with all the transitions. More... | |
const State & | trigger_transition (const Transition &transition) |
Trigger the specified transition. More... | |
const State & | trigger_transition (const Transition &transition, LifecycleNodeInterface::CallbackReturn &cb_return_code) |
Trigger the specified transition and get the callback return code. More... | |
const State & | trigger_transition (uint8_t transition_id) |
Trigger the specified transition based on an id. More... | |
const State & | trigger_transition (uint8_t transition_id, LifecycleNodeInterface::CallbackReturn &cb_return_code) |
Trigger the specified transition based on an id and get the callback return code. More... | |
const State & | configure () |
Trigger the configure transition. More... | |
const State & | configure (LifecycleNodeInterface::CallbackReturn &cb_return_code) |
Trigger the configure transition and get the callback return code. More... | |
const State & | cleanup () |
Trigger the cleanup transition. More... | |
const State & | cleanup (LifecycleNodeInterface::CallbackReturn &cb_return_code) |
Trigger the cleanup transition and get the callback return code. More... | |
const State & | activate () |
Trigger the activate transition. More... | |
const State & | activate (LifecycleNodeInterface::CallbackReturn &cb_return_code) |
Trigger the activate transition and get the callback return code. More... | |
const State & | deactivate () |
Trigger the deactivate transition. More... | |
const State & | deactivate (LifecycleNodeInterface::CallbackReturn &cb_return_code) |
Trigger the deactivate transition and get the callback return code. More... | |
const State & | shutdown () |
Trigger the shutdown transition. More... | |
const State & | shutdown (LifecycleNodeInterface::CallbackReturn &cb_return_code) |
Trigger the shutdown transition and get the callback return code. More... | |
bool | register_on_configure (std::function< LifecycleNodeInterface::CallbackReturn(const State &)> fcn) |
Register the configure callback. More... | |
bool | register_on_cleanup (std::function< LifecycleNodeInterface::CallbackReturn(const State &)> fcn) |
Register the cleanup callback. More... | |
bool | register_on_shutdown (std::function< LifecycleNodeInterface::CallbackReturn(const State &)> fcn) |
Register the shutdown callback. More... | |
bool | register_on_activate (std::function< LifecycleNodeInterface::CallbackReturn(const State &)> fcn) |
Register the activate callback. More... | |
bool | register_on_deactivate (std::function< LifecycleNodeInterface::CallbackReturn(const State &)> fcn) |
Register the deactivate callback. More... | |
bool | register_on_error (std::function< LifecycleNodeInterface::CallbackReturn(const State &)> fcn) |
Register the error callback. More... | |
template<typename MessageT , typename CallbackT , typename AllocatorT , typename CallbackMessageT , typename SubscriptionT , typename MessageMemoryStrategyT > | |
std::shared_ptr< SubscriptionT > | create_subscription (const std::string &topic_name, const rclcpp::QoS &qos, CallbackT &&callback, const rclcpp::SubscriptionOptionsWithAllocator< AllocatorT > &options, typename MessageMemoryStrategyT::SharedPtr msg_mem_strat) |
Public Member Functions inherited from rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface | |
virtual CallbackReturn | on_configure (const State &previous_state) |
Callback function for configure transition. More... | |
virtual CallbackReturn | on_cleanup (const State &previous_state) |
Callback function for cleanup transition. More... | |
virtual CallbackReturn | on_shutdown (const State &previous_state) |
Callback function for shutdown transition. More... | |
virtual CallbackReturn | on_activate (const State &previous_state) |
Callback function for activate transition. More... | |
virtual CallbackReturn | on_deactivate (const State &previous_state) |
Callback function for deactivate transition. More... | |
virtual CallbackReturn | on_error (const State &previous_state) |
Callback function for errorneous transition. More... | |
virtual | ~LifecycleNodeInterface () |
Public Member Functions inherited from std::enable_shared_from_this< LifecycleNode > | |
T | enable_shared_from_this (T... args) |
T | operator= (T... args) |
T | shared_from_this (T... args) |
T | ~enable_shared_from_this (T... args) |
Protected Member Functions | |
void | add_publisher_handle (std::shared_ptr< rclcpp_lifecycle::LifecyclePublisherInterface > pub) |
void | add_timer_handle (std::shared_ptr< rclcpp::TimerBase > timer) |
Protected Member Functions inherited from rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface | |
LifecycleNodeInterface () | |
LifecycleNode for creating lifecycle components.
has lifecycle nodeinterface for configuring this node.
using rclcpp_lifecycle::LifecycleNode::OnSetParametersCallbackHandle = rclcpp::node_interfaces::OnSetParametersCallbackHandle |
using rclcpp_lifecycle::LifecycleNode::OnParametersSetCallbackType = rclcpp::node_interfaces::NodeParametersInterface::OnParametersSetCallbackType |
|
explicit |
Create a new lifecycle node with the specified name.
[in] | node_name | Name of the node. |
[in] | options | Additional options to control creation of the node. |
[in] | enable_communication_interface | Deciding whether the communication interface of the underlying rcl_lifecycle_node shall be enabled. |
rclcpp_lifecycle::LifecycleNode::LifecycleNode | ( | const std::string & | node_name, |
const std::string & | namespace_, | ||
const rclcpp::NodeOptions & | options = rclcpp::NodeOptions() , |
||
bool | enable_communication_interface = true |
||
) |
Create a node based on the node name and a rclcpp::Context.
[in] | node_name | Name of the node. |
[in] | namespace_ | Namespace of the node. |
[in] | options | Additional options to control creation of the node. |
[in] | enable_communication_interface | Deciding whether the communication interface of the underlying rcl_lifecycle_node shall be enabled. |
|
virtual |
const char* rclcpp_lifecycle::LifecycleNode::get_name | ( | ) | const |
Get the name of the node.
const char* rclcpp_lifecycle::LifecycleNode::get_namespace | ( | ) | const |
Get the namespace of the node.
rclcpp::Logger rclcpp_lifecycle::LifecycleNode::get_logger | ( | ) | const |
Get the logger of the node.
rclcpp::CallbackGroup::SharedPtr rclcpp_lifecycle::LifecycleNode::create_callback_group | ( | rclcpp::CallbackGroupType | group_type, |
bool | automatically_add_to_executor_with_node = true |
||
) |
Create and return a callback group.
[in] | group_type | callback group type to create by this method. |
[in] | automatically_add_to_executor_with_node | A boolean that determines whether a callback group is automatically added to an executor with the node with which it is associated. |
const std::vector<rclcpp::CallbackGroup::WeakPtr>& rclcpp_lifecycle::LifecycleNode::get_callback_groups | ( | ) | const |
Return the list of callback groups in the node.
std::shared_ptr< rclcpp_lifecycle::LifecyclePublisher< MessageT, AllocatorT > > rclcpp_lifecycle::LifecycleNode::create_publisher | ( | const std::string & | topic_name, |
const rclcpp::QoS & | qos, | ||
const PublisherOptionsWithAllocator< AllocatorT > & | options = ( create_default_publisher_options<AllocatorT>() ) |
||
) |
Create and return a Publisher.
[in] | topic_name | The topic for this publisher to publish on. |
[in] | qos | The Quality of Service settings for this publisher. |
[in] | options | The publisher options for this publisher. |
std::shared_ptr<SubscriptionT> rclcpp_lifecycle::LifecycleNode::create_subscription | ( | const std::string & | topic_name, |
const rclcpp::QoS & | qos, | ||
CallbackT && | callback, | ||
const SubscriptionOptionsWithAllocator< AllocatorT > & | options = create_default_subscription_options< AllocatorT >() , |
||
typename MessageMemoryStrategyT::SharedPtr | msg_mem_strat = (MessageMemoryStrategyT::create_default()) |
||
) |
Create and return a Subscription.
[in] | topic_name | The topic to subscribe on. |
[in] | callback | The user-defined callback function. |
[in] | qos | The quality of service for this subscription. |
[in] | options | The subscription options for this subscription. |
[in] | msg_mem_strat | The message memory strategy to use for allocating messages. |
rclcpp::WallTimer< CallbackT >::SharedPtr rclcpp_lifecycle::LifecycleNode::create_wall_timer | ( | std::chrono::duration< DurationRepT, DurationT > | period, |
CallbackT | callback, | ||
rclcpp::CallbackGroup::SharedPtr | group = nullptr |
||
) |
Create a timer.
[in] | period | Time interval between triggers of the callback. |
[in] | callback | User-defined callback function. |
[in] | group | Callback group to execute this timer's callback in. |
rclcpp::Client< ServiceT >::SharedPtr rclcpp_lifecycle::LifecycleNode::create_client | ( | const std::string & | service_name, |
const rmw_qos_profile_t & | qos_profile = rmw_qos_profile_services_default , |
||
rclcpp::CallbackGroup::SharedPtr | group = nullptr |
||
) |
Create and return a Client.
rclcpp::Service< ServiceT >::SharedPtr rclcpp_lifecycle::LifecycleNode::create_service | ( | const std::string & | service_name, |
CallbackT && | callback, | ||
const rmw_qos_profile_t & | qos_profile = rmw_qos_profile_services_default , |
||
rclcpp::CallbackGroup::SharedPtr | group = nullptr |
||
) |
Create and return a Service.
std::shared_ptr< rclcpp::GenericPublisher > rclcpp_lifecycle::LifecycleNode::create_generic_publisher | ( | const std::string & | topic_name, |
const std::string & | topic_type, | ||
const rclcpp::QoS & | qos, | ||
const rclcpp::PublisherOptionsWithAllocator< AllocatorT > & | options = ( rclcpp::PublisherOptionsWithAllocator<AllocatorT>() ) |
||
) |
Create and return a GenericPublisher.
std::shared_ptr< rclcpp::GenericSubscription > rclcpp_lifecycle::LifecycleNode::create_generic_subscription | ( | const std::string & | topic_name, |
const std::string & | topic_type, | ||
const rclcpp::QoS & | qos, | ||
std::function< void(std::shared_ptr< rclcpp::SerializedMessage >)> | callback, | ||
const rclcpp::SubscriptionOptionsWithAllocator< AllocatorT > & | options = ( rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>() ) |
||
) |
Create and return a GenericSubscription.
const rclcpp::ParameterValue& rclcpp_lifecycle::LifecycleNode::declare_parameter | ( | const std::string & | name, |
const rclcpp::ParameterValue & | default_value, | ||
const rcl_interfaces::msg::ParameterDescriptor & | parameter_descriptor = rcl_interfaces::msg::ParameterDescriptor() , |
||
bool | ignore_override = false |
||
) |
Declare and initialize a parameter, return the effective value.
const rclcpp::ParameterValue& rclcpp_lifecycle::LifecycleNode::declare_parameter | ( | const std::string & | name, |
rclcpp::ParameterType | type, | ||
const rcl_interfaces::msg::ParameterDescriptor & | parameter_descriptor = rcl_interfaces::msg::ParameterDescriptor{} , |
||
bool | ignore_override = false |
||
) |
Declare and initialize a parameter, return the effective value.
const rclcpp::ParameterValue& rclcpp_lifecycle::LifecycleNode::declare_parameter | ( | const std::string & | name | ) |
Declare a parameter.
auto rclcpp_lifecycle::LifecycleNode::declare_parameter | ( | const std::string & | name, |
const ParameterT & | default_value, | ||
const rcl_interfaces::msg::ParameterDescriptor & | parameter_descriptor = rcl_interfaces::msg::ParameterDescriptor() , |
||
bool | ignore_override = false |
||
) |
Declare and initialize a parameter with a type.
auto rclcpp_lifecycle::LifecycleNode::declare_parameter | ( | const std::string & | name, |
const rcl_interfaces::msg::ParameterDescriptor & | parameter_descriptor = rcl_interfaces::msg::ParameterDescriptor() , |
||
bool | ignore_override = false |
||
) |
Declare and initialize a parameter with a type.
See the non-templated declare_parameter() on this class for details.
std::vector< ParameterT > rclcpp_lifecycle::LifecycleNode::declare_parameters | ( | const std::string & | namespace_, |
const std::map< std::string, ParameterT > & | parameters | ||
) |
Declare and initialize several parameters with the same namespace and type.
std::vector< ParameterT > rclcpp_lifecycle::LifecycleNode::declare_parameters | ( | const std::string & | namespace_, |
const std::map< std::string, std::pair< ParameterT, rcl_interfaces::msg::ParameterDescriptor > > & | parameters | ||
) |
Declare and initialize several parameters with the same namespace and type.
void rclcpp_lifecycle::LifecycleNode::undeclare_parameter | ( | const std::string & | name | ) |
Undeclare a previously declared parameter.
bool rclcpp_lifecycle::LifecycleNode::has_parameter | ( | const std::string & | name | ) | const |
Return true if a given parameter is declared.
rcl_interfaces::msg::SetParametersResult rclcpp_lifecycle::LifecycleNode::set_parameter | ( | const rclcpp::Parameter & | parameter | ) |
Set a single parameter.
std::vector<rcl_interfaces::msg::SetParametersResult> rclcpp_lifecycle::LifecycleNode::set_parameters | ( | const std::vector< rclcpp::Parameter > & | parameters | ) |
Set one or more parameters, one at a time.
rcl_interfaces::msg::SetParametersResult rclcpp_lifecycle::LifecycleNode::set_parameters_atomically | ( | const std::vector< rclcpp::Parameter > & | parameters | ) |
Set one or more parameters, all at once.
rclcpp::Parameter rclcpp_lifecycle::LifecycleNode::get_parameter | ( | const std::string & | name | ) | const |
Return the parameter by the given name.
bool rclcpp_lifecycle::LifecycleNode::get_parameter | ( | const std::string & | name, |
rclcpp::Parameter & | parameter | ||
) | const |
Get the value of a parameter by the given name, and return true if it was set.
bool rclcpp_lifecycle::LifecycleNode::get_parameter | ( | const std::string & | name, |
ParameterT & | parameter | ||
) | const |
Get the value of a parameter by the given name, and return true if it was set.
bool rclcpp_lifecycle::LifecycleNode::get_parameter_or | ( | const std::string & | name, |
ParameterT & | value, | ||
const ParameterT & | alternative_value | ||
) | const |
Get the parameter value, or the "alternative_value" if not set, and assign it to "parameter".
std::vector<rclcpp::Parameter> rclcpp_lifecycle::LifecycleNode::get_parameters | ( | const std::vector< std::string > & | names | ) | const |
Return the parameters by the given parameter names.
bool rclcpp_lifecycle::LifecycleNode::get_parameters | ( | const std::string & | prefix, |
std::map< std::string, MapValueT > & | values | ||
) | const |
Get the parameter values for all parameters that have a given prefix.
rcl_interfaces::msg::ParameterDescriptor rclcpp_lifecycle::LifecycleNode::describe_parameter | ( | const std::string & | name | ) | const |
Return the parameter descriptor for the given parameter name.
std::vector<rcl_interfaces::msg::ParameterDescriptor> rclcpp_lifecycle::LifecycleNode::describe_parameters | ( | const std::vector< std::string > & | names | ) | const |
Return a vector of parameter descriptors, one for each of the given names.
std::vector<uint8_t> rclcpp_lifecycle::LifecycleNode::get_parameter_types | ( | const std::vector< std::string > & | names | ) | const |
Return a vector of parameter types, one for each of the given names.
rcl_interfaces::msg::ListParametersResult rclcpp_lifecycle::LifecycleNode::list_parameters | ( | const std::vector< std::string > & | prefixes, |
uint64_t | depth | ||
) | const |
Return a list of parameters with any of the given prefixes, up to the given depth.
RCUTILS_WARN_UNUSED rclcpp_lifecycle::LifecycleNode::OnSetParametersCallbackHandle::SharedPtr rclcpp_lifecycle::LifecycleNode::add_on_set_parameters_callback | ( | rclcpp_lifecycle::LifecycleNode::OnParametersSetCallbackType | callback | ) |
Add a callback for when parameters are being set.
void rclcpp_lifecycle::LifecycleNode::remove_on_set_parameters_callback | ( | const rclcpp_lifecycle::LifecycleNode::OnSetParametersCallbackHandle *const | handler | ) |
Remove a callback registered with add_on_set_parameters_callback
.
std::vector<std::string> rclcpp_lifecycle::LifecycleNode::get_node_names | ( | ) | const |
Return a vector of existing node names (string).
std::map<std::string, std::vector<std::string> > rclcpp_lifecycle::LifecycleNode::get_topic_names_and_types | ( | bool | no_demangle = false | ) | const |
Return a map of existing topic names to list of topic types.
std::map<std::string, std::vector<std::string> > rclcpp_lifecycle::LifecycleNode::get_service_names_and_types | ( | ) | const |
Return a map of existing service names to list of topic types.
std::map<std::string, std::vector<std::string> > rclcpp_lifecycle::LifecycleNode::get_service_names_and_types_by_node | ( | const std::string & | node_name, |
const std::string & | namespace_ | ||
) | const |
Return a map of existing service names to list of service types for a specific node.
This function only considers services - not clients.
[in] | node_name | name of the node |
[in] | namespace_ | namespace of the node |
size_t rclcpp_lifecycle::LifecycleNode::count_publishers | ( | const std::string & | topic_name | ) | const |
Return the number of publishers that are advertised on a given topic.
size_t rclcpp_lifecycle::LifecycleNode::count_subscribers | ( | const std::string & | topic_name | ) | const |
Return the number of subscribers who have created a subscription for a given topic.
std::vector<rclcpp::TopicEndpointInfo> rclcpp_lifecycle::LifecycleNode::get_publishers_info_by_topic | ( | const std::string & | topic_name, |
bool | no_mangle = false |
||
) | const |
Return the topic endpoint information about publishers on a given topic.
std::vector<rclcpp::TopicEndpointInfo> rclcpp_lifecycle::LifecycleNode::get_subscriptions_info_by_topic | ( | const std::string & | topic_name, |
bool | no_mangle = false |
||
) | const |
Return the topic endpoint information about subscriptions on a given topic.
rclcpp::Event::SharedPtr rclcpp_lifecycle::LifecycleNode::get_graph_event | ( | ) |
Return a graph event, which will be set anytime a graph change occurs.
void rclcpp_lifecycle::LifecycleNode::wait_for_graph_change | ( | rclcpp::Event::SharedPtr | event, |
std::chrono::nanoseconds | timeout | ||
) |
Wait for a graph event to occur by waiting on an Event to become set.
rclcpp::Clock::SharedPtr rclcpp_lifecycle::LifecycleNode::get_clock | ( | ) |
Get a clock as a non-const shared pointer which is managed by the node.
rclcpp::Clock::ConstSharedPtr rclcpp_lifecycle::LifecycleNode::get_clock | ( | ) | const |
Get a clock as a const shared pointer which is managed by the node.
rclcpp::Time rclcpp_lifecycle::LifecycleNode::now | ( | ) | const |
Returns current time from the time source specified by clock_type.
rclcpp::node_interfaces::NodeBaseInterface::SharedPtr rclcpp_lifecycle::LifecycleNode::get_node_base_interface | ( | ) |
Return the Node's internal NodeBaseInterface implementation.
rclcpp::node_interfaces::NodeClockInterface::SharedPtr rclcpp_lifecycle::LifecycleNode::get_node_clock_interface | ( | ) |
Return the Node's internal NodeClockInterface implementation.
rclcpp::node_interfaces::NodeGraphInterface::SharedPtr rclcpp_lifecycle::LifecycleNode::get_node_graph_interface | ( | ) |
Return the Node's internal NodeGraphInterface implementation.
rclcpp::node_interfaces::NodeLoggingInterface::SharedPtr rclcpp_lifecycle::LifecycleNode::get_node_logging_interface | ( | ) |
Return the Node's internal NodeLoggingInterface implementation.
rclcpp::node_interfaces::NodeTimersInterface::SharedPtr rclcpp_lifecycle::LifecycleNode::get_node_timers_interface | ( | ) |
Return the Node's internal NodeTimersInterface implementation.
rclcpp::node_interfaces::NodeTopicsInterface::SharedPtr rclcpp_lifecycle::LifecycleNode::get_node_topics_interface | ( | ) |
Return the Node's internal NodeTopicsInterface implementation.
rclcpp::node_interfaces::NodeServicesInterface::SharedPtr rclcpp_lifecycle::LifecycleNode::get_node_services_interface | ( | ) |
Return the Node's internal NodeServicesInterface implementation.
rclcpp::node_interfaces::NodeParametersInterface::SharedPtr rclcpp_lifecycle::LifecycleNode::get_node_parameters_interface | ( | ) |
Return the Node's internal NodeParametersInterface implementation.
rclcpp::node_interfaces::NodeTimeSourceInterface::SharedPtr rclcpp_lifecycle::LifecycleNode::get_node_time_source_interface | ( | ) |
Return the Node's internal NodeParametersInterface implementation.
rclcpp::node_interfaces::NodeWaitablesInterface::SharedPtr rclcpp_lifecycle::LifecycleNode::get_node_waitables_interface | ( | ) |
Return the Node's internal NodeWaitablesInterface implementation.
const rclcpp::NodeOptions& rclcpp_lifecycle::LifecycleNode::get_node_options | ( | ) | const |
Return the NodeOptions used when creating this node.
const State& rclcpp_lifecycle::LifecycleNode::get_current_state | ( | ) |
Return the current State.
std::vector<State> rclcpp_lifecycle::LifecycleNode::get_available_states | ( | ) |
Return a list with the available states.
std::vector<Transition> rclcpp_lifecycle::LifecycleNode::get_available_transitions | ( | ) |
Return a list with the current available transitions.
std::vector<Transition> rclcpp_lifecycle::LifecycleNode::get_transition_graph | ( | ) |
Return a list with all the transitions.
const State& rclcpp_lifecycle::LifecycleNode::trigger_transition | ( | const Transition & | transition | ) |
Trigger the specified transition.
const State& rclcpp_lifecycle::LifecycleNode::trigger_transition | ( | const Transition & | transition, |
LifecycleNodeInterface::CallbackReturn & | cb_return_code | ||
) |
Trigger the specified transition and get the callback return code.
const State& rclcpp_lifecycle::LifecycleNode::trigger_transition | ( | uint8_t | transition_id | ) |
Trigger the specified transition based on an id.
const State& rclcpp_lifecycle::LifecycleNode::trigger_transition | ( | uint8_t | transition_id, |
LifecycleNodeInterface::CallbackReturn & | cb_return_code | ||
) |
Trigger the specified transition based on an id and get the callback return code.
const State& rclcpp_lifecycle::LifecycleNode::configure | ( | ) |
Trigger the configure transition.
const State& rclcpp_lifecycle::LifecycleNode::configure | ( | LifecycleNodeInterface::CallbackReturn & | cb_return_code | ) |
Trigger the configure transition and get the callback return code.
const State& rclcpp_lifecycle::LifecycleNode::cleanup | ( | ) |
Trigger the cleanup transition.
const State& rclcpp_lifecycle::LifecycleNode::cleanup | ( | LifecycleNodeInterface::CallbackReturn & | cb_return_code | ) |
Trigger the cleanup transition and get the callback return code.
const State& rclcpp_lifecycle::LifecycleNode::activate | ( | ) |
Trigger the activate transition.
const State& rclcpp_lifecycle::LifecycleNode::activate | ( | LifecycleNodeInterface::CallbackReturn & | cb_return_code | ) |
Trigger the activate transition and get the callback return code.
const State& rclcpp_lifecycle::LifecycleNode::deactivate | ( | ) |
Trigger the deactivate transition.
const State& rclcpp_lifecycle::LifecycleNode::deactivate | ( | LifecycleNodeInterface::CallbackReturn & | cb_return_code | ) |
Trigger the deactivate transition and get the callback return code.
const State& rclcpp_lifecycle::LifecycleNode::shutdown | ( | ) |
Trigger the shutdown transition.
const State& rclcpp_lifecycle::LifecycleNode::shutdown | ( | LifecycleNodeInterface::CallbackReturn & | cb_return_code | ) |
Trigger the shutdown transition and get the callback return code.
bool rclcpp_lifecycle::LifecycleNode::register_on_configure | ( | std::function< LifecycleNodeInterface::CallbackReturn(const State &)> | fcn | ) |
Register the configure callback.
This callback will be called when the transition to this state is triggered
[in] | fcn | callback function to call |
bool rclcpp_lifecycle::LifecycleNode::register_on_cleanup | ( | std::function< LifecycleNodeInterface::CallbackReturn(const State &)> | fcn | ) |
Register the cleanup callback.
This callback will be called when the transition to this state is triggered
[in] | fcn | callback function to call |
bool rclcpp_lifecycle::LifecycleNode::register_on_shutdown | ( | std::function< LifecycleNodeInterface::CallbackReturn(const State &)> | fcn | ) |
Register the shutdown callback.
This callback will be called when the transition to this state is triggered
[in] | fcn | callback function to call |
bool rclcpp_lifecycle::LifecycleNode::register_on_activate | ( | std::function< LifecycleNodeInterface::CallbackReturn(const State &)> | fcn | ) |
Register the activate callback.
This callback will be called when the transition to this state is triggered
[in] | fcn | callback function to call |
bool rclcpp_lifecycle::LifecycleNode::register_on_deactivate | ( | std::function< LifecycleNodeInterface::CallbackReturn(const State &)> | fcn | ) |
Register the deactivate callback.
This callback will be called when the transition to this state is triggered
[in] | fcn | callback function to call |
bool rclcpp_lifecycle::LifecycleNode::register_on_error | ( | std::function< LifecycleNodeInterface::CallbackReturn(const State &)> | fcn | ) |
Register the error callback.
This callback will be called when the transition to this state is triggered
[in] | fcn | callback function to call |
|
protected |
|
protected |
std::shared_ptr<SubscriptionT> rclcpp_lifecycle::LifecycleNode::create_subscription | ( | const std::string & | topic_name, |
const rclcpp::QoS & | qos, | ||
CallbackT && | callback, | ||
const rclcpp::SubscriptionOptionsWithAllocator< AllocatorT > & | options, | ||
typename MessageMemoryStrategyT::SharedPtr | msg_mem_strat | ||
) |