diff --git a/hardware_interface/include/hardware_interface/actuator_interface.hpp b/hardware_interface/include/hardware_interface/actuator_interface.hpp index 6ca478231f..6f4dfa4402 100644 --- a/hardware_interface/include/hardware_interface/actuator_interface.hpp +++ b/hardware_interface/include/hardware_interface/actuator_interface.hpp @@ -27,6 +27,7 @@ #include "hardware_interface/hardware_info.hpp" #include "hardware_interface/types/hardware_interface_return_values.hpp" #include "hardware_interface/types/lifecycle_state_names.hpp" +#include "hardware_interface/types/trigger_type.hpp" #include "lifecycle_msgs/msg/state.hpp" #include "rclcpp/duration.hpp" #include "rclcpp/logger.hpp" @@ -546,11 +547,6 @@ class ActuatorInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNod // interface names to Handle accessed through getters/setters std::unordered_map actuator_states_; std::unordered_map actuator_commands_; - enum class TriggerType - { - READ, - WRITE - }; std::atomic next_trigger_ = TriggerType::READ; }; diff --git a/hardware_interface/include/hardware_interface/system_interface.hpp b/hardware_interface/include/hardware_interface/system_interface.hpp index ec649b0225..e145deae5b 100644 --- a/hardware_interface/include/hardware_interface/system_interface.hpp +++ b/hardware_interface/include/hardware_interface/system_interface.hpp @@ -28,6 +28,7 @@ #include "hardware_interface/types/hardware_interface_return_values.hpp" #include "hardware_interface/types/hardware_interface_type_values.hpp" #include "hardware_interface/types/lifecycle_state_names.hpp" +#include "hardware_interface/types/trigger_type.hpp" #include "lifecycle_msgs/msg/state.hpp" #include "rclcpp/duration.hpp" #include "rclcpp/logger.hpp" @@ -585,11 +586,6 @@ class SystemInterface : public rclcpp_lifecycle::node_interfaces::LifecycleNodeI // interface names to Handle accessed through getters/setters std::unordered_map system_states_; std::unordered_map system_commands_; - enum class TriggerType - { - READ, - WRITE - }; std::atomic next_trigger_ = TriggerType::READ; }; diff --git a/hardware_interface/include/hardware_interface/types/trigger_type.hpp b/hardware_interface/include/hardware_interface/types/trigger_type.hpp new file mode 100644 index 0000000000..63970bc0f0 --- /dev/null +++ b/hardware_interface/include/hardware_interface/types/trigger_type.hpp @@ -0,0 +1,28 @@ +// Copyright 2024 ros2_control Development Team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef HARDWARE_INTERFACE__TYPES__TRIGGER_TYPE_HPP_ +#define HARDWARE_INTERFACE__TYPES__TRIGGER_TYPE_HPP_ + +namespace hardware_interface +{ +enum class TriggerType +{ + READ, + WRITE +}; + +} // namespace hardware_interface + +#endif // HARDWARE_INTERFACE__TYPES__TRIGGER_TYPE_HPP_