Ignition Gazebo

API Reference

3.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 IGNITION_GAZEBO_LINK_HH_
18 #define IGNITION_GAZEBO_LINK_HH_
19 
20 #include <memory>
21 #include <optional>
22 #include <string>
23 #include <vector>
24 
25 #include <ignition/math/Pose3.hh>
27 #include <ignition/math/Vector3.hh>
28 
29 #include <ignition/gazebo/config.hh>
31 #include <ignition/gazebo/Export.hh>
32 #include <ignition/gazebo/Model.hh>
33 #include <ignition/gazebo/Types.hh>
34 
35 namespace ignition
36 {
37  namespace gazebo
38  {
39  // Inline bracket to help doxygen filtering.
40  inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
41  // Forward declarations.
42  class IGNITION_GAZEBO_HIDDEN LinkPrivate;
43  //
63  class IGNITION_GAZEBO_VISIBLE Link
64  {
67  public: explicit Link(gazebo::Entity _entity = kNullEntity);
68 
71  public: Link(const Link &_link);
72 
75  public: Link(Link &&_link) noexcept;
76 
80  public: Link &operator=(Link &&_link) noexcept;
81 
85  public: Link &operator=(const Link &_link);
86 
88  public: ~Link();
89 
92  public: gazebo::Entity Entity() const;
93 
96  public: void ResetEntity(gazebo::Entity _newEntity);
97 
102  public: bool Valid(const EntityComponentManager &_ecm) const;
103 
108  public: std::optional<std::string> Name(
109  const EntityComponentManager &_ecm) const;
110 
115  public: std::optional<Model> ParentModel(
116  const EntityComponentManager &_ecm) const;
117 
121  public: bool IsCanonical(const EntityComponentManager &_ecm) const;
122 
126  public: bool WindMode(const EntityComponentManager &_ecm) const;
127 
133  public: gazebo::Entity CollisionByName(const EntityComponentManager &_ecm,
134  const std::string &_name) const;
135 
141  public: gazebo::Entity VisualByName(const EntityComponentManager &_ecm,
142  const std::string &_name) const;
143 
147  public: std::vector<gazebo::Entity> Collisions(
148  const EntityComponentManager &_ecm) const;
149 
153  public: std::vector<gazebo::Entity> Visuals(
154  const EntityComponentManager &_ecm) const;
155 
160  public: uint64_t CollisionCount(const EntityComponentManager &_ecm) const;
161 
166  public: uint64_t VisualCount(const EntityComponentManager &_ecm) const;
167 
172  public: std::optional<math::Pose3d> WorldPose(
173  const EntityComponentManager &_ecm) const;
174 
180  public: std::optional<math::Pose3d> WorldInertialPose(
181  const EntityComponentManager &_ecm) const;
182 
190  public: std::optional<math::Vector3d> WorldLinearVelocity(
191  const EntityComponentManager &_ecm) const;
192 
201  public: std::optional<math::Vector3d> WorldLinearVelocity(
202  const EntityComponentManager &_ecm,
203  const math::Vector3d &_offset) const;
204 
209  public: std::optional<math::Vector3d> WorldAngularVelocity(
210  const EntityComponentManager &_ecm) const;
211 
217  public: std::optional<math::Vector3d> WorldLinearAcceleration(
218  const EntityComponentManager &_ecm) const;
219 
225  public: std::optional<math::Matrix3d> WorldInertiaMatrix(
226  const EntityComponentManager &_ecm) const;
227 
235  public: std::optional<double> WorldKineticEnergy(
236  const EntityComponentManager &_ecm) const;
237 
242  public: void AddWorldForce(EntityComponentManager &_ecm,
243  const math::Vector3d &_force) const;
244 
251  public: void AddWorldWrench(EntityComponentManager &_ecm,
252  const math::Vector3d &_force,
253  const math::Vector3d &_torque) const;
254 
256  private: std::unique_ptr<LinkPrivate> dataPtr;
257  };
258  }
259  }
260 }
261 #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:42
STL class.
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
Component< bool, class WindModeTag > WindMode
A component used to indicate whether an entity is affected by wind.
Definition: WindMode.hh:33
const Entity kNullEntity
Indicates a non-existant or invalid Entity.
Definition: Entity.hh:62
STL class.
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