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 
153  const std::string &_name) const;
154 
159  const EntityComponentManager &_ecm) const;
160 
165  const EntityComponentManager &_ecm) const;
166 
171  const EntityComponentManager &_ecm) const;
172 
177  public: uint64_t CollisionCount(const EntityComponentManager &_ecm) const;
178 
183  public: uint64_t SensorCount(const EntityComponentManager &_ecm) const;
184 
189  public: uint64_t VisualCount(const EntityComponentManager &_ecm) const;
190 
195  public: std::optional<math::Pose3d> WorldPose(
196  const EntityComponentManager &_ecm) const;
197 
202  public: std::optional<math::Inertiald> WorldInertial(
203  const EntityComponentManager &_ecm) const;
204 
210  public: std::optional<math::Pose3d> WorldInertialPose(
211  const EntityComponentManager &_ecm) const;
212 
221  public: std::optional<math::Vector3d> WorldLinearVelocity(
222  const EntityComponentManager &_ecm) const;
223 
232  public: std::optional<math::Vector3d> WorldLinearVelocity(
233  const EntityComponentManager &_ecm,
234  const math::Vector3d &_offset) const;
235 
241  public: std::optional<math::Vector3d> WorldAngularVelocity(
242  const EntityComponentManager &_ecm) const;
243 
251  bool _enable = true) const;
252 
258  const math::Vector3d &_vel) const;
259 
260 
266  const math::Vector3d &_vel) const;
267 
273  public: std::optional<math::Vector3d> WorldAngularAcceleration(
274  const EntityComponentManager &_ecm) const;
275 
281  public: std::optional<math::Vector3d> WorldLinearAcceleration(
282  const EntityComponentManager &_ecm) const;
283 
291  bool _enable = true) const;
292 
298  public: std::optional<math::Matrix3d> WorldInertiaMatrix(
299  const EntityComponentManager &_ecm) const;
300 
306  public: std::optional<math::Matrix6d> WorldFluidAddedMassMatrix(
307  const EntityComponentManager &_ecm) const;
308 
316  public: std::optional<double> WorldKineticEnergy(
317  const EntityComponentManager &_ecm) const;
318 
324  const math::Vector3d &_force) const;
325 
333  const math::Vector3d &_force,
334  const math::Vector3d &_position) const;
335 
343  const math::Vector3d &_force,
344  const math::Vector3d &_torque) const;
345 
355  const math::Vector3d &_force,
356  const math::Vector3d &_torque,
357  const math::Vector3d &_offset) const;
358 
360  private: std::unique_ptr<LinkPrivate> dataPtr;
361  };
362  }
363  }
364 }
365 #endif