Gazebo Sensors

API Reference

8.2.1
ForceTorqueSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef GZ_SENSORS_FORCETORQUESENSOR_HH_
19 #define GZ_SENSORS_FORCETORQUESENSOR_HH_
20 
21 #include <memory>
22 
23 #include <sdf/sdf.hh>
24 
25 #include <gz/utils/SuppressWarning.hh>
26 
27 #include <gz/math/Pose3.hh>
28 
29 #include <gz/sensors/config.hh>
30 #include <gz/sensors/force_torque/Export.hh>
31 
32 #include "gz/sensors/Sensor.hh"
33 
34 namespace gz
35 {
36  namespace sensors
37  {
38  // Inline bracket to help doxygen filtering.
39  inline namespace GZ_SENSORS_VERSION_NAMESPACE {
40  //
42  class ForceTorqueSensorPrivate;
43 
47  class GZ_SENSORS_FORCE_TORQUE_VISIBLE ForceTorqueSensor
48  : public Sensor
49  {
51  public: ForceTorqueSensor();
52 
54  public: virtual ~ForceTorqueSensor();
55 
59  public: virtual bool Load(const sdf::Sensor &_sdf) override;
60 
64  public: virtual bool Load(sdf::ElementPtr _sdf) override;
65 
68  public: virtual bool Init() override;
69 
70  using Sensor::Update;
71 
75  public: virtual bool Update(
76  const std::chrono::steady_clock::duration &_now) override;
77 
80  public: math::Vector3d Force() const;
81 
85  public: void SetForce(const math::Vector3d &_force);
86 
89  public: math::Vector3d Torque() const;
90 
94  public: void SetTorque(const math::Vector3d &_torque);
95 
99  public: math::Quaterniond RotationParentInSensor() const;
100 
105  const math::Quaterniond &_rotParentInSensor);
106 
110  public: math::Quaterniond RotationChildInSensor() const;
111 
116  const math::Quaterniond &_rotChildInSensor);
117 
120  public: virtual bool HasConnections() const override;
121 
122  GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
126  GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
127  };
128  }
129  }
130 }
131 
132 #endif