Gazebo Sim

API Reference

9.3.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
138 const std::string &_name) const;
139
146 const std::string &_name) const;
147
154 const std::string &_name) const;
155
160 const EntityComponentManager &_ecm) const;
161
166 const EntityComponentManager &_ecm) const;
167
172 const EntityComponentManager &_ecm) const;
173
178 public: uint64_t CollisionCount(const EntityComponentManager &_ecm) const;
179
184 public: uint64_t SensorCount(const EntityComponentManager &_ecm) const;
185
190 public: uint64_t VisualCount(const EntityComponentManager &_ecm) const;
191
196 public: std::optional<math::Pose3d> WorldPose(
197 const EntityComponentManager &_ecm) const;
198
203 public: std::optional<math::Inertiald> WorldInertial(
204 const EntityComponentManager &_ecm) const;
205
211 public: std::optional<math::Pose3d> WorldInertialPose(
212 const EntityComponentManager &_ecm) const;
213
222 public: std::optional<math::Vector3d> WorldLinearVelocity(
223 const EntityComponentManager &_ecm) const;
224
233 public: std::optional<math::Vector3d> WorldLinearVelocity(
234 const EntityComponentManager &_ecm,
235 const math::Vector3d &_offset) const;
236
242 public: std::optional<math::Vector3d> WorldAngularVelocity(
243 const EntityComponentManager &_ecm) const;
244
252 bool _enable = true) const;
253
259 const math::Vector3d &_vel) const;
260
261
267 const math::Vector3d &_vel) const;
268
274 public: std::optional<math::Vector3d> WorldAngularAcceleration(
275 const EntityComponentManager &_ecm) const;
276
282 public: std::optional<math::Vector3d> WorldLinearAcceleration(
283 const EntityComponentManager &_ecm) const;
284
292 bool _enable = true) const;
293
299 public: std::optional<math::Matrix3d> WorldInertiaMatrix(
300 const EntityComponentManager &_ecm) const;
301
307 public: std::optional<math::Matrix6d> WorldFluidAddedMassMatrix(
308 const EntityComponentManager &_ecm) const;
309
317 public: std::optional<double> WorldKineticEnergy(
318 const EntityComponentManager &_ecm) const;
319
325 const math::Vector3d &_force) const;
326
334 const math::Vector3d &_force,
335 const math::Vector3d &_position) const;
336
344 const math::Vector3d &_force,
345 const math::Vector3d &_torque) const;
346
356 const math::Vector3d &_force,
357 const math::Vector3d &_torque,
358 const math::Vector3d &_offset) const;
359
370 bool _enable = true) const;
371
377 public: std::optional<math::AxisAlignedBox> AxisAlignedBox(
378 const EntityComponentManager &_ecm) const;
379
385 public: std::optional<math::AxisAlignedBox> WorldAxisAlignedBox(
386 const EntityComponentManager &_ecm) const;
387
397 public: std::optional<math::AxisAlignedBox> ComputeAxisAlignedBox(
398 const EntityComponentManager &_ecm) const;
399
401 private: std::unique_ptr<LinkPrivate> dataPtr;
402 };
403 }
404 }
405}
406#endif