Loading...
Searching...
No Matches
ForceTorque.hh
Go to the documentation of this file.
1/*
2 * Copyright 2020 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#ifndef SDF_FORCE_TORQUE_HH_
18#define SDF_FORCE_TORQUE_HH_
19
20#include <string>
21#include <sdf/Error.hh>
22#include <sdf/Element.hh>
23#include <sdf/Noise.hh>
24#include <sdf/sdf_config.h>
25
26namespace sdf
27{
28 // Inline bracket to help doxygen filtering.
29 inline namespace SDF_VERSION_NAMESPACE {
30 // Forward declare private data class.
31 class ForceTorquePrivate;
32
35 enum class ForceTorqueFrame : uint8_t
36 {
38 INVALID = 0,
39
41 PARENT = 1,
42
44 CHILD = 2,
45
47 SENSOR = 3
48 };
49
52 enum class ForceTorqueMeasureDirection : uint8_t
53 {
55 INVALID = 0,
56
58 PARENT_TO_CHILD = 1,
59
61 CHILD_TO_PARENT = 2
62 };
63
67 {
69 public: ForceTorque();
70
73 public: ForceTorque(const ForceTorque &_ft);
74
77 public: ForceTorque(ForceTorque &&_ft) noexcept;
78
80 public: ~ForceTorque();
81
85 public: ForceTorque &operator=(const ForceTorque &_ft);
86
90 public: ForceTorque &operator=(ForceTorque &&_ft) noexcept;
91
98 public: Errors Load(ElementPtr _sdf);
99
103 public: sdf::ElementPtr Element() const;
104
107 public: const Noise &ForceXNoise() const;
108
111 public: void SetForceXNoise(const Noise &_noise);
112
115 public: const Noise &ForceYNoise() const;
116
119 public: void SetForceYNoise(const Noise &_noise);
120
123 public: const Noise &ForceZNoise() const;
124
127 public: void SetForceZNoise(const Noise &_noise);
128
131 public: const Noise &TorqueXNoise() const;
132
135 public: void SetTorqueXNoise(const Noise &_noise);
136
139 public: const Noise &TorqueYNoise() const;
140
143 public: void SetTorqueYNoise(const Noise &_noise);
144
147 public: const Noise &TorqueZNoise() const;
148
151 public: void SetTorqueZNoise(const Noise &_noise);
152
155 public: ForceTorqueFrame Frame() const;
156
159 public: void SetFrame(ForceTorqueFrame _frame) const;
160
164
168 ForceTorqueMeasureDirection _direction) const;
169
173 public: bool operator==(const ForceTorque &_ft) const;
174
179 public: bool operator!=(const ForceTorque &_ft) const;
180
182 private: ForceTorquePrivate *dataPtr;
183 };
184 }
185}
186
187#endif
ForceTorque contains information about a force torque sensor.
Definition ForceTorque.hh:67
const Noise & ForceYNoise() const
Get the force noise values in the measurement frame Y-axis.
ForceTorque & operator=(const ForceTorque &_ft)
Assignment operator.
const Noise & TorqueYNoise() const
Get the torque noise values in the measurement frame Y-axis.
ForceTorque & operator=(ForceTorque &&_ft) noexcept
Move assignment operator.
Errors Load(ElementPtr _sdf)
Load the force torque sensor based on an element pointer.
~ForceTorque()
Destructor.
bool operator!=(const ForceTorque &_ft) const
Return true this force torque object does not contain the same values as the passed-in parameter.
ForceTorqueMeasureDirection MeasureDirection() const
Get the measure direction of the wrench values.
ForceTorque(ForceTorque &&_ft) noexcept
Move constructor.
bool operator==(const ForceTorque &_ft) const
Return true if both force torque objects contain the same values.
void SetTorqueXNoise(const Noise &_noise)
Set the torque noise values in the measurement frame X-axis.
void SetTorqueYNoise(const Noise &_noise)
Set the torque noise values in the measurement frame Y-axis.
void SetForceXNoise(const Noise &_noise)
Set the force noise values in the measurement frame X-axis.
const Noise & ForceZNoise() const
Get the force noise values in the measurement frame Z-axis.
ForceTorque()
Default constructor.
sdf::ElementPtr Element() const
Get a pointer to the SDF element that was used during load.
ForceTorqueFrame Frame() const
Get the frame in which the wrench values are reported.
void SetTorqueZNoise(const Noise &_noise)
Set the torque noise values in the measurement frame Z-axis.
const Noise & ForceXNoise() const
Get the force noise values in the measurement frame X-axis.
ForceTorque(const ForceTorque &_ft)
Copy constructor.
const Noise & TorqueXNoise() const
Get the torque noise values in the measurement frame X-axis.
void SetForceZNoise(const Noise &_noise)
Set the force noise values in the measurement frame Z-axis.
const Noise & TorqueZNoise() const
Get the torque noise values in the measurement frame Z-axis.
void SetForceYNoise(const Noise &_noise)
Set the force noise values in the measurement frame Y-axis.
void SetMeasureDirection(ForceTorqueMeasureDirection _direction) const
Set the measure direction of the wrench values.
void SetFrame(ForceTorqueFrame _frame) const
Set the frame in which the wrench values are reported.
The Noise class contains information about a noise model, such as a Gaussian distribution.
Definition Noise.hh:50
ForceTorqueMeasureDirection
The set of measure directions of the wrench values.
Definition ForceTorque.hh:53
std::vector< Error > Errors
A vector of Error.
Definition Types.hh:89
ForceTorqueFrame
The set of supported frames of the wrench values.
Definition ForceTorque.hh:36
std::shared_ptr< Element > ElementPtr
Definition Element.hh:53
namespace for Simulation Description Format parser
Definition Actor.hh:33
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition system_util.hh:48