rclcpp
master
C++ ROS Client Library API
|
#include <parameter_client.hpp>
Public Member Functions | |
AsyncParametersClient (const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base_interface, const rclcpp::node_interfaces::NodeTopicsInterface::SharedPtr node_topics_interface, const rclcpp::node_interfaces::NodeGraphInterface::SharedPtr node_graph_interface, const rclcpp::node_interfaces::NodeServicesInterface::SharedPtr node_services_interface, const std::string &remote_node_name="", const rmw_qos_profile_t &qos_profile=rmw_qos_profile_parameters, rclcpp::CallbackGroup::SharedPtr group=nullptr) | |
Create an async parameters client. More... | |
template<typename NodeT > | |
AsyncParametersClient (const std::shared_ptr< NodeT > node, const std::string &remote_node_name="", const rmw_qos_profile_t &qos_profile=rmw_qos_profile_parameters, rclcpp::CallbackGroup::SharedPtr group=nullptr) | |
Constructor. More... | |
template<typename NodeT > | |
AsyncParametersClient (NodeT *node, const std::string &remote_node_name="", const rmw_qos_profile_t &qos_profile=rmw_qos_profile_parameters, rclcpp::CallbackGroup::SharedPtr group=nullptr) | |
Constructor. More... | |
std::shared_future< std::vector< rclcpp::Parameter > > | get_parameters (const std::vector< std::string > &names, std::function< void(std::shared_future< std::vector< rclcpp::Parameter >>) > callback=nullptr) |
std::shared_future< std::vector< rcl_interfaces::msg::ParameterDescriptor > > | describe_parameters (const std::vector< std::string > &names, std::function< void(std::shared_future< std::vector< rcl_interfaces::msg::ParameterDescriptor >>) > callback=nullptr) |
std::shared_future< std::vector< rclcpp::ParameterType > > | get_parameter_types (const std::vector< std::string > &names, std::function< void(std::shared_future< std::vector< rclcpp::ParameterType >>) > callback=nullptr) |
std::shared_future< std::vector< rcl_interfaces::msg::SetParametersResult > > | set_parameters (const std::vector< rclcpp::Parameter > ¶meters, std::function< void(std::shared_future< std::vector< rcl_interfaces::msg::SetParametersResult >>) > callback=nullptr) |
std::shared_future< rcl_interfaces::msg::SetParametersResult > | set_parameters_atomically (const std::vector< rclcpp::Parameter > ¶meters, std::function< void(std::shared_future< rcl_interfaces::msg::SetParametersResult >) > callback=nullptr) |
std::shared_future< std::vector< rcl_interfaces::msg::SetParametersResult > > | delete_parameters (const std::vector< std::string > ¶meters_names) |
Delete several parameters at once. More... | |
std::shared_future< std::vector< rcl_interfaces::msg::SetParametersResult > > | load_parameters (const std::string &yaml_filename) |
Load parameters from yaml file. More... | |
std::shared_future< std::vector< rcl_interfaces::msg::SetParametersResult > > | load_parameters (const rclcpp::ParameterMap ¶meter_map) |
Load parameters from parameter map. More... | |
std::shared_future< rcl_interfaces::msg::ListParametersResult > | list_parameters (const std::vector< std::string > &prefixes, uint64_t depth, std::function< void(std::shared_future< rcl_interfaces::msg::ListParametersResult >) > callback=nullptr) |
template<typename CallbackT , typename AllocatorT = std::allocator<void>> | |
rclcpp::Subscription< rcl_interfaces::msg::ParameterEvent >::SharedPtr | on_parameter_event (CallbackT &&callback, const rclcpp::QoS &qos=(rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_parameter_events))), const rclcpp::SubscriptionOptionsWithAllocator< AllocatorT > &options=(rclcpp::SubscriptionOptionsWithAllocator< AllocatorT >())) |
bool | service_is_ready () const |
Return if the parameter services are ready. More... | |
template<typename RepT = int64_t, typename RatioT = std::milli> | |
bool | wait_for_service (std::chrono::duration< RepT, RatioT > timeout=std::chrono::duration< RepT, RatioT >(-1)) |
Wait for the services to be ready. More... | |
Static Public Member Functions | |
template<typename CallbackT , typename NodeT , typename AllocatorT = std::allocator<void>> | |
static rclcpp::Subscription< rcl_interfaces::msg::ParameterEvent >::SharedPtr | on_parameter_event (NodeT &&node, CallbackT &&callback, const rclcpp::QoS &qos=(rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rmw_qos_profile_parameter_events))), const rclcpp::SubscriptionOptionsWithAllocator< AllocatorT > &options=(rclcpp::SubscriptionOptionsWithAllocator< AllocatorT >())) |
Protected Member Functions | |
bool | wait_for_service_nanoseconds (std::chrono::nanoseconds timeout) |
rclcpp::AsyncParametersClient::AsyncParametersClient | ( | const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr | node_base_interface, |
const rclcpp::node_interfaces::NodeTopicsInterface::SharedPtr | node_topics_interface, | ||
const rclcpp::node_interfaces::NodeGraphInterface::SharedPtr | node_graph_interface, | ||
const rclcpp::node_interfaces::NodeServicesInterface::SharedPtr | node_services_interface, | ||
const std::string & | remote_node_name = "" , |
||
const rmw_qos_profile_t & | qos_profile = rmw_qos_profile_parameters , |
||
rclcpp::CallbackGroup::SharedPtr | group = nullptr |
||
) |
Create an async parameters client.
[in] | node_base_interface | The node base interface of the corresponding node. |
[in] | node_topics_interface | Node topic base interface. |
[in] | node_graph_interface | The node graph interface of the corresponding node. |
[in] | node_services_interface | Node service interface. |
[in] | remote_node_name | (optional) name of the remote node |
[in] | qos_profile | (optional) The rmw qos profile to use to subscribe |
[in] | group | (optional) The async parameter client will be added to this callback group. |
|
inline |
Constructor.
[in] | node | The async paramters client will be added to this node. |
[in] | remote_node_name | (optional) name of the remote node |
[in] | qos_profile | (optional) The rmw qos profile to use to subscribe |
[in] | group | (optional) The async parameter client will be added to this callback group. |
|
inline |
Constructor.
[in] | node | The async paramters client will be added to this node. |
[in] | remote_node_name | (optional) name of the remote node |
[in] | qos_profile | (optional) The rmw qos profile to use to subscribe |
[in] | group | (optional) The async parameter client will be added to this callback group. |
std::shared_future<std::vector<rclcpp::Parameter> > rclcpp::AsyncParametersClient::get_parameters | ( | const std::vector< std::string > & | names, |
std::function< void(std::shared_future< std::vector< rclcpp::Parameter >>) > | callback = nullptr |
||
) |
std::shared_future<std::vector<rcl_interfaces::msg::ParameterDescriptor> > rclcpp::AsyncParametersClient::describe_parameters | ( | const std::vector< std::string > & | names, |
std::function< void(std::shared_future< std::vector< rcl_interfaces::msg::ParameterDescriptor >>) > | callback = nullptr |
||
) |
std::shared_future<std::vector<rclcpp::ParameterType> > rclcpp::AsyncParametersClient::get_parameter_types | ( | const std::vector< std::string > & | names, |
std::function< void(std::shared_future< std::vector< rclcpp::ParameterType >>) > | callback = nullptr |
||
) |
std::shared_future<std::vector<rcl_interfaces::msg::SetParametersResult> > rclcpp::AsyncParametersClient::set_parameters | ( | const std::vector< rclcpp::Parameter > & | parameters, |
std::function< void(std::shared_future< std::vector< rcl_interfaces::msg::SetParametersResult >>) > | callback = nullptr |
||
) |
std::shared_future<rcl_interfaces::msg::SetParametersResult> rclcpp::AsyncParametersClient::set_parameters_atomically | ( | const std::vector< rclcpp::Parameter > & | parameters, |
std::function< void(std::shared_future< rcl_interfaces::msg::SetParametersResult >) > | callback = nullptr |
||
) |
std::shared_future<std::vector<rcl_interfaces::msg::SetParametersResult> > rclcpp::AsyncParametersClient::delete_parameters | ( | const std::vector< std::string > & | parameters_names | ) |
Delete several parameters at once.
This function behaves like command-line tool ros2 param delete
would.
parameters_names | vector of parameters names |
std::shared_future<std::vector<rcl_interfaces::msg::SetParametersResult> > rclcpp::AsyncParametersClient::load_parameters | ( | const std::string & | yaml_filename | ) |
Load parameters from yaml file.
This function behaves like command-line tool ros2 param load
would.
yaml_filename | the full name of the yaml file |
std::shared_future<std::vector<rcl_interfaces::msg::SetParametersResult> > rclcpp::AsyncParametersClient::load_parameters | ( | const rclcpp::ParameterMap & | parameter_map | ) |
Load parameters from parameter map.
This function filters the parameters to be set based on the node name.
yaml_filename | the full name of the yaml file |
InvalidParametersException | if there is no parameter to set |
std::shared_future<rcl_interfaces::msg::ListParametersResult> rclcpp::AsyncParametersClient::list_parameters | ( | const std::vector< std::string > & | prefixes, |
uint64_t | depth, | ||
std::function< void(std::shared_future< rcl_interfaces::msg::ListParametersResult >) > | callback = nullptr |
||
) |
|
inline |
|
inlinestatic |
The NodeT type only needs to have a method called get_node_topics_interface() which returns a shared_ptr to a NodeTopicsInterface, or be a NodeTopicsInterface pointer itself.
bool rclcpp::AsyncParametersClient::service_is_ready | ( | ) | const |
Return if the parameter services are ready.
This method checks the following services:
true
if the service is ready, false
otherwise
|
inline |
Wait for the services to be ready.
timeout | maximum time to wait |
true
if the services are ready and the timeout is not over, false
otherwise
|
protected |