Gazebo Sim

API Reference

8.7.0
Link.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 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 GZ_SIM_LINK_HH_
18 #define GZ_SIM_LINK_HH_
19 
20 #include <memory>
21 #include <optional>
22 #include <string>
23 #include <vector>
24 
25 #include <gz/math/Inertial.hh>
26 #include <gz/math/Matrix3.hh>
27 #include <gz/math/Matrix6.hh>
28 #include <gz/math/Pose3.hh>
29 #include <gz/math/Quaternion.hh>
30 #include <gz/math/Vector3.hh>
31 
32 #include <gz/sim/config.hh>
34 #include <gz/sim/Export.hh>
35 #include <gz/sim/Model.hh>
36 #include <gz/sim/Types.hh>
37 
38 namespace gz
39 {
40  namespace sim
41  {
42  // Inline bracket to help doxygen filtering.
43  inline namespace GZ_SIM_VERSION_NAMESPACE {
44  // Forward declarations.
45  class GZ_SIM_HIDDEN LinkPrivate;
46  //
66  class GZ_SIM_VISIBLE Link
67  {
70  public: explicit Link(sim::Entity _entity = kNullEntity);
71 
74  public: Link(const Link &_link);
75 
78  public: Link(Link &&_link) noexcept;
79 
83  public: Link &operator=(Link &&_link) noexcept;
84 
88  public: Link &operator=(const Link &_link);
89 
91  public: ~Link();
92 
95  public: sim::Entity Entity() const;
96 
99  public: void ResetEntity(sim::Entity _newEntity);
100 
105  public: bool Valid(const EntityComponentManager &_ecm) const;
106 
111  public: std::optional<std::string> Name(
112  const EntityComponentManager &_ecm) const;
113 
118  public: std::optional<Model> ParentModel(
119  const EntityComponentManager &_ecm) const;
120 
124  public: bool IsCanonical(const EntityComponentManager &_ecm) const;
125 
129  public: bool WindMode(const EntityComponentManager &_ecm) const;
130 
137  const std::string &_name) const;
138 
145  const std::string &_name) const;
146 
151  const EntityComponentManager &_ecm) const;
152 
157  const EntityComponentManager &_ecm) const;
158 
163  public: uint64_t CollisionCount(const EntityComponentManager &_ecm) const;
164 
169  public: uint64_t VisualCount(const EntityComponentManager &_ecm) const;
170 
175  public: std::optional<math::Pose3d> WorldPose(
176  const EntityComponentManager &_ecm) const;
177 
182  public: std::optional<math::Inertiald> WorldInertial(
183  const EntityComponentManager &_ecm) const;
184 
190  public: std::optional<math::Pose3d> WorldInertialPose(
191  const EntityComponentManager &_ecm) const;
192 
201  public: std::optional<math::Vector3d> WorldLinearVelocity(
202  const EntityComponentManager &_ecm) const;
203 
212  public: std::optional<math::Vector3d> WorldLinearVelocity(
213  const EntityComponentManager &_ecm,
214  const math::Vector3d &_offset) const;
215 
221  public: std::optional<math::Vector3d> WorldAngularVelocity(
222  const EntityComponentManager &_ecm) const;
223 
231  bool _enable = true) const;
232 
238  const math::Vector3d &_vel) const;
239 
240 
246  const math::Vector3d &_vel) const;
247 
253  public: std::optional<math::Vector3d> WorldAngularAcceleration(
254  const EntityComponentManager &_ecm) const;
255 
261  public: std::optional<math::Vector3d> WorldLinearAcceleration(
262  const EntityComponentManager &_ecm) const;
263 
271  bool _enable = true) const;
272 
278  public: std::optional<math::Matrix3d> WorldInertiaMatrix(
279  const EntityComponentManager &_ecm) const;
280 
286  public: std::optional<math::Matrix6d> WorldFluidAddedMassMatrix(
287  const EntityComponentManager &_ecm) const;
288 
296  public: std::optional<double> WorldKineticEnergy(
297  const EntityComponentManager &_ecm) const;
298 
304  const math::Vector3d &_force) const;
305 
313  const math::Vector3d &_force,
314  const math::Vector3d &_position) const;
315 
323  const math::Vector3d &_force,
324  const math::Vector3d &_torque) const;
325 
335  const math::Vector3d &_force,
336  const math::Vector3d &_torque,
337  const math::Vector3d &_offset) const;
338 
340  private: std::unique_ptr<LinkPrivate> dataPtr;
341  };
342  }
343  }
344 }
345 #endif