Gazebo Sim

API Reference

10.6.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>
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
39namespace 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
143 public: std::optional<bool> Kinematic(
144 const EntityComponentManager &_ecm) const;
145
152 const std::string &_name) const;
153
160 const std::string &_name) const;
161
168 const std::string &_name) const;
169
174 const EntityComponentManager &_ecm) const;
175
180 const EntityComponentManager &_ecm) const;
181
186 const EntityComponentManager &_ecm) const;
187
192 public: uint64_t CollisionCount(const EntityComponentManager &_ecm) const;
193
198 public: uint64_t SensorCount(const EntityComponentManager &_ecm) const;
199
204 public: uint64_t VisualCount(const EntityComponentManager &_ecm) const;
205
210 public: std::optional<math::Pose3d> WorldPose(
211 const EntityComponentManager &_ecm) const;
212
217 public: std::optional<math::Inertiald> WorldInertial(
218 const EntityComponentManager &_ecm) const;
219
225 public: std::optional<math::Pose3d> WorldInertialPose(
226 const EntityComponentManager &_ecm) const;
227
236 public: std::optional<math::Vector3d> WorldLinearVelocity(
237 const EntityComponentManager &_ecm) const;
238
247 public: std::optional<math::Vector3d> WorldLinearVelocity(
248 const EntityComponentManager &_ecm,
249 const math::Vector3d &_offset) const;
250
256 public: std::optional<math::Vector3d> WorldAngularVelocity(
257 const EntityComponentManager &_ecm) const;
258
266 bool _enable = true) const;
267
273 const math::Vector3d &_vel) const;
274
275
281 const math::Vector3d &_vel) const;
282
287 bool _enabled) const;
288
296 bool _kinematic) const;
297
303 public: std::optional<math::Vector3d> WorldAngularAcceleration(
304 const EntityComponentManager &_ecm) const;
305
311 public: std::optional<math::Vector3d> WorldLinearAcceleration(
312 const EntityComponentManager &_ecm) const;
313
321 bool _enable = true) const;
322
328 public: std::optional<math::Matrix3d> WorldInertiaMatrix(
329 const EntityComponentManager &_ecm) const;
330
336 public: std::optional<math::Matrix6d> WorldFluidAddedMassMatrix(
337 const EntityComponentManager &_ecm) const;
338
346 public: std::optional<double> WorldKineticEnergy(
347 const EntityComponentManager &_ecm) const;
348
354 const math::Vector3d &_force) const;
355
363 const math::Vector3d &_force,
364 const math::Vector3d &_position) const;
365
372 const math::Vector3d &_force) const;
373
383 const math::Vector3d &_force,
384 const math::Vector3d &_position) const;
385
393 const math::Vector3d &_force,
394 const math::Vector3d &_torque) const;
395
405 const math::Vector3d &_force,
406 const math::Vector3d &_torque,
407 const math::Vector3d &_offset) const;
408
419 bool _enable = true) const;
420
426 public: std::optional<math::AxisAlignedBox> AxisAlignedBox(
427 const EntityComponentManager &_ecm) const;
428
434 public: std::optional<math::AxisAlignedBox> WorldAxisAlignedBox(
435 const EntityComponentManager &_ecm) const;
436
446 public: std::optional<math::AxisAlignedBox> ComputeAxisAlignedBox(
447 const EntityComponentManager &_ecm) const;
448
450 private: std::unique_ptr<LinkPrivate> dataPtr;
451 };
452 }
453 }
454}
455#endif