File: ForceTorque.hh

package info (click to toggle)
sdformat 12.3.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,980 kB
  • sloc: cpp: 54,706; python: 3,729; javascript: 704; ruby: 366; sh: 97; ansic: 30; makefile: 16
file content (168 lines) | stat: -rw-r--r-- 6,466 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/*
 * Copyright 2020 Open Source Robotics Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
#ifndef SDF_FORCE_TORQUE_HH_
#define SDF_FORCE_TORQUE_HH_

#include <string>
#include <ignition/utils/ImplPtr.hh>
#include <sdf/Error.hh>
#include <sdf/Element.hh>
#include <sdf/Noise.hh>
#include <sdf/sdf_config.h>

namespace sdf
{
  // Inline bracket to help doxygen filtering.
  inline namespace SDF_VERSION_NAMESPACE {
  /// \enum ForceTorqueFrame
  /// \brief The set of supported frames of the wrench values.
  enum class ForceTorqueFrame : uint8_t
  {
    /// \brief Invalid frame
    INVALID = 0,

    /// \brief Wrench expressed in the orientation of the parent link frame
    PARENT = 1,

    /// \brief Wrench expressed in the orientation of the child link frame
    CHILD = 2,

    /// \brief Wrench expressed in the orientation of the joint sensor frame
    SENSOR = 3
  };

  /// \enum ForceTorqueMeasureDirection
  /// \brief The set of measure directions of the wrench values.
  enum class ForceTorqueMeasureDirection : uint8_t
  {
    /// \brief Invalid frame
    INVALID = 0,

    /// \brief Wrench measured as applied by the parent link on the child link
    PARENT_TO_CHILD = 1,

    /// \brief Wrench measured as applied by the child link on the parent link
    CHILD_TO_PARENT = 2
  };

  /// \brief ForceTorque contains information about a force torque sensor.
  /// This sensor can be attached to a joint.
  class SDFORMAT_VISIBLE ForceTorque
  {
    /// \brief Default constructor
    public: ForceTorque();

    /// \brief Load the force torque sensor based on an element pointer. This is
    /// *not* the usual entry point. Typical usage of the SDF DOM is through the
    /// Root object.
    /// \param[in] _sdf The SDF Element pointer
    /// \return Errors, which is a vector of Error objects. Each Error includes
    /// an error code and message. An empty vector indicates no error.
    public: Errors Load(ElementPtr _sdf);

    /// \brief Get a pointer to the SDF element that was used during load.
    /// \return SDF element pointer. The value will be nullptr if Load has
    /// not been called.
    public: sdf::ElementPtr Element() const;

    /// \brief Get the force noise values in the measurement frame X-axis.
    /// \return Noise values for the X-axis force.
    public: const Noise &ForceXNoise() const;

    /// \brief Set the force noise values in the measurement frame X-axis.
    /// \param[in] _noise Noise values for the X-axis force.
    public: void SetForceXNoise(const Noise &_noise);

    /// \brief Get the force noise values in the measurement frame Y-axis.
    /// \return Noise values for the Y-axis force.
    public: const Noise &ForceYNoise() const;

    /// \brief Set the force noise values in the measurement frame Y-axis.
    /// \param[in] _noise Noise values for the Y-axis force.
    public: void SetForceYNoise(const Noise &_noise);

    /// \brief Get the force noise values in the measurement frame Z-axis.
    /// \return Noise values for the Z-axis force.
    public: const Noise &ForceZNoise() const;

    /// \brief Set the force noise values in the measurement frame Z-axis.
    /// \param[in] _noise Noise values for the Z-axis force.
    public: void SetForceZNoise(const Noise &_noise);

    /// \brief Get the torque noise values in the measurement frame X-axis.
    /// \return Noise values for the X-axis torque.
    public: const Noise &TorqueXNoise() const;

    /// \brief Set the torque noise values in the measurement frame X-axis.
    /// \param[in] _noise Noise values for the X-axis torque.
    public: void SetTorqueXNoise(const Noise &_noise);

    /// \brief Get the torque noise values in the measurement frame Y-axis.
    /// \return Noise values for the Y-axis torque.
    public: const Noise &TorqueYNoise() const;

    /// \brief Set the torque noise values in the measurement frame Y-axis.
    /// \param[in] _noise Noise values for the Y-axis torque.
    public: void SetTorqueYNoise(const Noise &_noise);

    /// \brief Get the torque noise values in the measurement frame Z-axis.
    /// \return Noise values for the Z-axis torque.
    public: const Noise &TorqueZNoise() const;

    /// \brief Set the torque noise values in the measurement frame Z-axis.
    /// \param[in] _noise Noise values for the Z-axis torque.
    public: void SetTorqueZNoise(const Noise &_noise);

    /// \brief Get the frame in which the wrench values are reported.
    /// \return The frame of the wrench values.
    public: ForceTorqueFrame Frame() const;

    /// \brief Set the frame in which the wrench values are reported.
    /// \param[in] _frame The frame of the wrench values.
    public: void SetFrame(ForceTorqueFrame _frame);

    /// \brief Get the measure direction of the wrench values.
    /// \return The measure direction of the wrench values.
    public: ForceTorqueMeasureDirection MeasureDirection() const;

    /// \brief Set the measure direction of the wrench values.
    /// \param[in] _direction The measure direction of the wrench values.
    public: void SetMeasureDirection(ForceTorqueMeasureDirection _direction);

    /// \brief Return true if both force torque objects contain the same values.
    /// \param[_in] _ft Force torque value to compare.
    /// \returen True if 'this' == _ft.
    public: bool operator==(const ForceTorque &_ft) const;

    /// \brief Return true this force torque object does not contain the same
    /// values as the passed-in parameter.
    /// \param[_in] _ft Force torque value to compare.
    /// \returen True if 'this' != _ft.
    public: bool operator!=(const ForceTorque &_ft) const;

    /// \brief Create and return an SDF element filled with data from this
    /// force torque sensor.
    /// \return SDF element pointer with updated sensor values.
    public: sdf::ElementPtr ToElement() const;

    /// \brief Private data pointer.
    IGN_UTILS_IMPL_PTR(dataPtr)
  };
  }
}

#endif