Ignition Gazebo

API Reference

2.10.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 IGNITION_GAZEBO_LINK_HH_
18 #define IGNITION_GAZEBO_LINK_HH_
19 
20 #include <memory>
21 #include <optional>
22 #include <string>
23 
24 #include <ignition/math/Pose3.hh>
26 #include <ignition/math/Vector3.hh>
27 
28 #include <ignition/gazebo/config.hh>
30 #include <ignition/gazebo/Export.hh>
31 #include <ignition/gazebo/Model.hh>
32 #include <ignition/gazebo/Types.hh>
33 
34 namespace ignition
35 {
36  namespace gazebo
37  {
38  // Inline bracket to help doxygen filtering.
39  inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
40  // Forward declarations.
41  class IGNITION_GAZEBO_HIDDEN LinkPrivate;
42  //
62  class IGNITION_GAZEBO_VISIBLE Link
63  {
66  public: explicit Link(gazebo::Entity _entity = kNullEntity);
67 
70  public: Link(const Link &_link);
71 
74  public: Link(Link &&_link) noexcept;
75 
79  public: Link &operator=(Link &&_link) noexcept;
80 
84  public: Link &operator=(const Link &_link);
85 
87  public: ~Link();
88 
91  public: gazebo::Entity Entity() const;
92 
95  public: void ResetEntity(gazebo::Entity _newEntity);
96 
101  public: bool Valid(const EntityComponentManager &_ecm) const;
102 
107  public: std::optional<std::string> Name(
108  const EntityComponentManager &_ecm) const;
109 
114  public: std::optional<Model> ParentModel(
115  const EntityComponentManager &_ecm) const;
116 
121  public: std::optional<math::Pose3d> WorldPose(
122  const EntityComponentManager &_ecm) const;
123 
129  public: std::optional<math::Pose3d> WorldInertialPose(
130  const EntityComponentManager &_ecm) const;
131 
139  public: std::optional<math::Vector3d> WorldLinearVelocity(
140  const EntityComponentManager &_ecm) const;
141 
150  public: std::optional<math::Vector3d> WorldLinearVelocity(
151  const EntityComponentManager &_ecm,
152  const math::Vector3d &_offset) const;
153 
158  public: std::optional<math::Vector3d> WorldAngularVelocity(
159  const EntityComponentManager &_ecm) const;
160 
166  public: std::optional<math::Vector3d> WorldLinearAcceleration(
167  const EntityComponentManager &_ecm) const;
168 
174  public: std::optional<math::Matrix3d> WorldInertiaMatrix(
175  const EntityComponentManager &_ecm) const;
176 
181  public: void AddWorldForce(EntityComponentManager &_ecm,
182  const math::Vector3d &_force) const;
183 
185  private: std::unique_ptr<LinkPrivate> dataPtr;
186  };
187  }
188  }
189 }
190 #endif
Component< std::string, class NameTag > Name
This component holds an entity&#39;s name. The component has no concept of scoped names nor does it care ...
Definition: Name.hh:35
class IGNITION_GAZEBO_HIDDEN LinkPrivate
Definition: Link.hh:41
The EntityComponentManager constructs, deletes, and returns components and entities. A component can be of any class which inherits from components::BaseComponent.
Definition: EntityComponentManager.hh:64
const Entity kNullEntity
Indicates a non-existant or invalid Entity.
Definition: Entity.hh:62
Component< NoData, class LinkTag > Link
A component that identifies an entity as being a link.
Definition: components/Link.hh:33
This library is part of the Ignition Robotics project.
uint64_t Entity
An Entity identifies a single object in simulation such as a model, link, or light. At its core, an Entity is just an identifier.
Definition: Entity.hh:59