C++ API
rclcpp: ROS Client Library for C++
rclcpp
provides the canonical C++ API for interacting with ROS. It consists of these main components:
Node
rclcpp/node.hpp
Publisher
rclcpp/publisher.hpp
Subscription
rclcpp/subscription.hpp
Service Client
rclcpp/client.hpp
Service Server
rclcpp/service.hpp
Timer
rclcpp/timer.hpp
Parameters:
rclcpp/parameter.hpp
rclcpp/parameter_value.hpp
rclcpp/parameter_client.hpp
rclcpp/parameter_service.hpp
Rate:
rclcpp/rate.hpp
There are also some components which help control the execution of callbacks:
Executors (responsible for execution of callbacks through a blocking spin):
rclcpp/executor.hpp
rclcpp/executors.hpp
rclcpp/executors/single_threaded_executor.hpp
rclcpp/executors/multi_threaded_executor.hpp
CallbackGroups (mechanism for enforcing concurrency rules for callbacks):
rclcpp/callback_group.hpp
Additionally, there are some methods for introspecting the ROS graph:
Graph Events (a waitable event object that wakes up when the graph changes):
List topic names and types:
Get the number of publishers or subscribers on a topic:
And components related to logging:
Logging macros:
Some examples (not exhaustive):
RCLCPP_DEBUG()
RCLCPP_INFO()
RCLCPP_WARN_ONCE()
RCLCPP_ERROR_SKIPFIRST()
rclcpp/logging.hpp
Logger:
rclcpp/logger.hpp
Finally, there are many internal API’s and utilities:
Exceptions:
rclcpp/exceptions.hpp
Allocator related items:
rclcpp/allocator/allocator_common.hpp
rclcpp/allocator/allocator_deleter.hpp
Dynamic typesupport wrappers
rclcpp/dynamic_typesupport/dynamic_message.hpp
rclcpp/dynamic_typesupport/dynamic_message_type.hpp
rclcpp/dynamic_typesupport/dynamic_message_type_builder.hpp
rclcpp/dynamic_typesupport/dynamic_serialization_support.hpp
Dynamic typesupport
rclcpp/dynamic_typesupport/dynamic_message_type_support.hpp
Generic publisher
rclcpp/generic_publisher.hpp
Generic subscription
rclcpp/generic_subscription.hpp
Memory management tools:
rclcpp/memory_strategies.hpp
rclcpp/memory_strategy.hpp
rclcpp/message_memory_strategy.hpp
rclcpp/strategies/allocator_memory_strategy.hpp
rclcpp/strategies/message_pool_memory_strategy.hpp
Context object which is shared amongst multiple Nodes:
rclcpp/context.hpp
rclcpp/contexts/default_context.hpp
Various utilities:
rclcpp/duration.hpp
rclcpp/function_traits.hpp
rclcpp/macros.hpp
rclcpp/time.hpp
rclcpp/utilities.hpp
rclcpp/typesupport_helpers.hpp
rclcpp/visibility_control.hpp