Gazebo Sim

API Reference

8.14.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 #include <gz/math/AxisAlignedBox.hh>
32 
33 #include <gz/sim/config.hh>
35 #include <gz/sim/Export.hh>
36 #include <gz/sim/Model.hh>
37 #include <gz/sim/Types.hh>
38 
39 namespace gz
40 {
41  namespace sim
42  {
43  // Inline bracket to help doxygen filtering.
44  inline namespace GZ_SIM_VERSION_NAMESPACE {
45  // Forward declarations.
46  class GZ_SIM_HIDDEN LinkPrivate;
47  //
67  class GZ_SIM_VISIBLE Link
68  {
71  public: explicit Link(sim::Entity _entity = kNullEntity);
72 
75  public: Link(const Link &_link);
76 
79  public: Link(Link &&_link) noexcept;
80 
84  public: Link &operator=(Link &&_link) noexcept;
85 
89  public: Link &operator=(const Link &_link);
90 
92  public: ~Link();
93 
96  public: sim::Entity Entity() const;
97 
100  public: void ResetEntity(sim::Entity _newEntity);
101 
106  public: bool Valid(const EntityComponentManager &_ecm) const;
107 
112  public: std::optional<std::string> Name(
113  const EntityComponentManager &_ecm) const;
114 
119  public: std::optional<Model> ParentModel(
120  const EntityComponentManager &_ecm) const;
121 
125  public: bool IsCanonical(const EntityComponentManager &_ecm) const;
126 
130  public: bool WindMode(const EntityComponentManager &_ecm) const;
131 
135  public: std::optional<bool> GravityEnabled(
136  const EntityComponentManager &_ecm) const;
137 
144  const std::string &_name) const;
145 
152  const std::string &_name) const;
153 
160  const std::string &_name) const;
161 
166  const EntityComponentManager &_ecm) const;
167 
172  const EntityComponentManager &_ecm) const;
173 
178  const EntityComponentManager &_ecm) const;
179 
184  public: uint64_t CollisionCount(const EntityComponentManager &_ecm) const;
185 
190  public: uint64_t SensorCount(const EntityComponentManager &_ecm) const;
191 
196  public: uint64_t VisualCount(const EntityComponentManager &_ecm) const;
197 
202  public: std::optional<math::Pose3d> WorldPose(
203  const EntityComponentManager &_ecm) const;
204 
209  public: std::optional<math::Inertiald> WorldInertial(
210  const EntityComponentManager &_ecm) const;
211 
217  public: std::optional<math::Pose3d> WorldInertialPose(
218  const EntityComponentManager &_ecm) const;
219 
228  public: std::optional<math::Vector3d> WorldLinearVelocity(
229  const EntityComponentManager &_ecm) const;
230 
239  public: std::optional<math::Vector3d> WorldLinearVelocity(
240  const EntityComponentManager &_ecm,
241  const math::Vector3d &_offset) const;
242 
248  public: std::optional<math::Vector3d> WorldAngularVelocity(
249  const EntityComponentManager &_ecm) const;
250 
258  bool _enable = true) const;
259 
265  const math::Vector3d &_vel) const;
266 
267 
273  const math::Vector3d &_vel) const;
274 
279  bool _enabled) const;
280 
286  public: std::optional<math::Vector3d> WorldAngularAcceleration(
287  const EntityComponentManager &_ecm) const;
288 
294  public: std::optional<math::Vector3d> WorldLinearAcceleration(
295  const EntityComponentManager &_ecm) const;
296 
304  bool _enable = true) const;
305 
311  public: std::optional<math::Matrix3d> WorldInertiaMatrix(
312  const EntityComponentManager &_ecm) const;
313 
319  public: std::optional<math::Matrix6d> WorldFluidAddedMassMatrix(
320  const EntityComponentManager &_ecm) const;
321 
329  public: std::optional<double> WorldKineticEnergy(
330  const EntityComponentManager &_ecm) const;
331 
337  const math::Vector3d &_force) const;
338 
346  const math::Vector3d &_force,
347  const math::Vector3d &_position) const;
348 
356  const math::Vector3d &_force,
357  const math::Vector3d &_torque) const;
358 
368  const math::Vector3d &_force,
369  const math::Vector3d &_torque,
370  const math::Vector3d &_offset) const;
371 
382  bool _enable = true) const;
383 
389  public: std::optional<math::AxisAlignedBox> AxisAlignedBox(
390  const EntityComponentManager &_ecm) const;
391 
397  public: std::optional<math::AxisAlignedBox> WorldAxisAlignedBox(
398  const EntityComponentManager &_ecm) const;
399 
409  public: std::optional<math::AxisAlignedBox> ComputeAxisAlignedBox(
410  const EntityComponentManager &_ecm) const;
411 
413  private: std::unique_ptr<LinkPrivate> dataPtr;
414  };
415  }
416  }
417 }
418 #endif