ROS 2 rclcpp + rcl - jazzy
jazzy
ROS 2 C++ Client Library with ROS Client Library
|
A helper class for aggregating node interfaces. More...
#include <rclcpp/node_interfaces/node_interfaces.hpp>
Public Member Functions | |
template<typename NodeT > | |
NodeInterfaces (NodeT &node) | |
Create a new NodeInterfaces object using the given node-like object's interfaces. More... | |
NodeInterfaces (std::shared_ptr< InterfaceTs >... args) | |
Additional Inherited Members | |
![]() | |
using | is_supported = std::false_type |
A helper class for aggregating node interfaces.
Definition at line 45 of file node_interfaces.hpp.
|
inline |
Create a new NodeInterfaces object using the given node-like object's interfaces.
Specify which interfaces you need by passing them as template parameters.
This allows you to aggregate interfaces from different sources together to pass as a single aggregate object to any functions that take node interfaces or node-likes, without needing to templatize that function.
You may also use this constructor to create a NodeInterfaces that contains a subset of another NodeInterfaces' interfaces.
Finally, this class supports implicit conversion from node-like objects, allowing you to directly pass a node-like to a function that takes a NodeInterfaces object.
Usage examples:
You may use any of the standard node interfaces that come with rclcpp:
Or you use custom interfaces as long as you make a template specialization of the rclcpp::node_interfaces::detail::NodeInterfacesSupport struct using the RCLCPP_NODE_INTERFACE_HELPERS_SUPPORT macro.
Usage example:
If you choose not to use the helper macro, then you can specialize the template yourself, but you must:
[in] | node | Node-like object from which to get the node interfaces |
Definition at line 150 of file node_interfaces.hpp.