ROS2 Control
actuator.hpp
1 // Copyright 2020 ros2_control Development Team
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 
15 #ifndef HARDWARE_INTERFACE__ACTUATOR_HPP_
16 #define HARDWARE_INTERFACE__ACTUATOR_HPP_
17 
18 #include <memory>
19 #include <string>
20 #include <vector>
21 
22 #include "hardware_interface/handle.hpp"
23 #include "hardware_interface/hardware_info.hpp"
24 #include "hardware_interface/types/hardware_interface_return_values.hpp"
25 #include "hardware_interface/types/hardware_interface_status_values.hpp"
26 #include "hardware_interface/visibility_control.h"
27 
28 namespace hardware_interface
29 {
30 class ActuatorInterface;
31 
32 class Actuator final
33 {
34 public:
35  Actuator() = default;
36 
37  HARDWARE_INTERFACE_PUBLIC
38  explicit Actuator(std::unique_ptr<ActuatorInterface> impl);
39 
40  Actuator(Actuator && other) = default;
41 
42  ~Actuator() = default;
43 
44  HARDWARE_INTERFACE_PUBLIC
45  return_type configure(const HardwareInfo & actuator_info);
46 
47  HARDWARE_INTERFACE_PUBLIC
48  std::vector<StateInterface> export_state_interfaces();
49 
50  HARDWARE_INTERFACE_PUBLIC
51  std::vector<CommandInterface> export_command_interfaces();
52 
53  HARDWARE_INTERFACE_PUBLIC
54  return_type prepare_command_mode_switch(
55  const std::vector<std::string> & start_interfaces,
56  const std::vector<std::string> & stop_interfaces);
57 
58  HARDWARE_INTERFACE_PUBLIC
59  return_type perform_command_mode_switch(
60  const std::vector<std::string> & start_interfaces,
61  const std::vector<std::string> & stop_interfaces);
62 
63  HARDWARE_INTERFACE_PUBLIC
64  return_type start();
65 
66  HARDWARE_INTERFACE_PUBLIC
67  return_type stop();
68 
69  HARDWARE_INTERFACE_PUBLIC
70  std::string get_name() const;
71 
72  HARDWARE_INTERFACE_PUBLIC
73  status get_status() const;
74 
75  HARDWARE_INTERFACE_PUBLIC
76  return_type read();
77 
78  HARDWARE_INTERFACE_PUBLIC
79  return_type write();
80 
81 private:
82  std::unique_ptr<ActuatorInterface> impl_;
83 };
84 
85 } // namespace hardware_interface
86 #endif // HARDWARE_INTERFACE__ACTUATOR_HPP_
Definition: actuator.hpp:28
This structure stores information about hardware defined in a robot&#39;s URDF.
Definition: hardware_info.hpp:100
Definition: actuator.hpp:32