ROS2 Control
sensor.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__SENSOR_HPP_
16 #define HARDWARE_INTERFACE__SENSOR_HPP_
17 
18 #include <memory>
19 #include <string>
20 #include <utility>
21 #include <vector>
22 
23 #include "hardware_interface/handle.hpp"
24 #include "hardware_interface/hardware_info.hpp"
25 #include "hardware_interface/types/hardware_interface_return_values.hpp"
26 #include "hardware_interface/types/hardware_interface_status_values.hpp"
27 #include "hardware_interface/visibility_control.h"
28 
29 namespace hardware_interface
30 {
31 class SensorInterface;
32 
33 class Sensor final
34 {
35 public:
36  Sensor() = default;
37 
38  HARDWARE_INTERFACE_PUBLIC
39  explicit Sensor(std::unique_ptr<SensorInterface> impl);
40 
41  Sensor(Sensor && other) = default;
42 
43  ~Sensor() = default;
44 
45  HARDWARE_INTERFACE_PUBLIC
46  return_type configure(const HardwareInfo & sensor_info);
47 
48  HARDWARE_INTERFACE_PUBLIC
49  std::vector<StateInterface> export_state_interfaces();
50 
51  HARDWARE_INTERFACE_PUBLIC
52  return_type start();
53 
54  HARDWARE_INTERFACE_PUBLIC
55  return_type stop();
56 
57  HARDWARE_INTERFACE_PUBLIC
58  std::string get_name() const;
59 
60  HARDWARE_INTERFACE_PUBLIC
61  status get_status() const;
62 
63  HARDWARE_INTERFACE_PUBLIC
64  return_type read();
65 
66 private:
67  std::unique_ptr<SensorInterface> impl_;
68 };
69 
70 } // namespace hardware_interface
71 #endif // HARDWARE_INTERFACE__SENSOR_HPP_
Definition: actuator.hpp:28
This structure stores information about hardware defined in a robot&#39;s URDF.
Definition: hardware_info.hpp:100
Definition: sensor.hpp:33