Gazebo Sensors

API Reference

9.0.0
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/msgs/wrench.pb.h>
30
31#include <gz/sensors/config.hh>
32#include <gz/sensors/force_torque/Export.hh>
33
34#include "gz/sensors/Sensor.hh"
35
36namespace gz
37{
38 namespace sensors
39 {
40 // Inline bracket to help doxygen filtering.
41 inline namespace GZ_SENSORS_VERSION_NAMESPACE {
42 //
44 class ForceTorqueSensorPrivate;
45
49 class GZ_SENSORS_FORCE_TORQUE_VISIBLE ForceTorqueSensor
50 : public Sensor
51 {
54
56 public: virtual ~ForceTorqueSensor();
57
61 public: virtual bool Load(const sdf::Sensor &_sdf) override;
62
66 public: virtual bool Load(sdf::ElementPtr _sdf) override;
67
70 public: virtual bool Init() override;
71
72 using Sensor::Update;
73
77 public: virtual bool Update(
78 const std::chrono::steady_clock::duration &_now) override;
79
82 public: math::Vector3d Force() const;
83
87 public: void SetForce(const math::Vector3d &_force);
88
91 public: math::Vector3d Torque() const;
92
96 public: void SetTorque(const math::Vector3d &_torque);
97
101 public: const msgs::Wrench &MeasuredWrench() const;
102
106 public: math::Quaterniond RotationParentInSensor() const;
107
112 const math::Quaterniond &_rotParentInSensor);
113
117 public: math::Quaterniond RotationChildInSensor() const;
118
123 const math::Quaterniond &_rotChildInSensor);
124
127 public: virtual bool HasConnections() const override;
128
129 GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
133 GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
134 };
135 }
136 }
137}
138
139#endif