ros2_control - rolling
Loading...
Searching...
No Matches
introspection.hpp
1// Copyright 2024 PAL Robotics S.L.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
16
17#ifndef HARDWARE_INTERFACE__INTROSPECTION_HPP_
18#define HARDWARE_INTERFACE__INTROSPECTION_HPP_
19
20#include "pal_statistics/pal_statistics_macros.hpp"
21#include "pal_statistics/pal_statistics_utils.hpp"
22
23namespace hardware_interface
24{
25constexpr char DEFAULT_REGISTRY_KEY[] = "ros2_control";
26constexpr char DEFAULT_INTROSPECTION_TOPIC[] = "~/introspection_data";
27
28#define REGISTER_ROS2_CONTROL_INTROSPECTION(ID, ENTITY) \
29 REGISTER_ENTITY( \
30 hardware_interface::DEFAULT_REGISTRY_KEY, get_name() + "." + ID, ENTITY, \
31 &stats_registrations_, false);
32
33#define UNREGISTER_ROS2_CONTROL_INTROSPECTION(ID) \
34 UNREGISTER_ENTITY(DEFAULT_REGISTRY_KEY, get_name() + "." + ID);
35
36#define CLEAR_ALL_ROS2_CONTROL_INTROSPECTION_REGISTRIES() CLEAR_ALL_REGISTRIES();
37
38#define INITIALIZE_ROS2_CONTROL_INTROSPECTION_REGISTRY(node, topic, registry_key) \
39 INITIALIZE_REGISTRY(node, topic, registry_key);
40
41#define START_ROS2_CONTROL_INTROSPECTION_PUBLISHER_THREAD(registry_key) \
42 START_PUBLISH_THREAD(registry_key);
43
44#define PUBLISH_ROS2_CONTROL_INTROSPECTION_DATA_ASYNC(registry_key) \
45 PUBLISH_ASYNC_STATISTICS(registry_key);
46
47#define DEFAULT_REGISTER_ROS2_CONTROL_INTROSPECTION(ID, ENTITY) \
48 REGISTER_ENTITY(DEFAULT_REGISTRY_KEY, ID, ENTITY);
49
50#define DEFAULT_UNREGISTER_ROS2_CONTROL_INTROSPECTION(ID) \
51 UNREGISTER_ENTITY(DEFAULT_REGISTRY_KEY, ID);
52} // namespace hardware_interface
53
54#endif // HARDWARE_INTERFACE__INTROSPECTION_HPP_
Definition actuator.hpp:33