Ignition Gazebo

API Reference

3.0.0
Model.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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_MODEL_HH_
18 #define IGNITION_GAZEBO_MODEL_HH_
19 
20 #include <memory>
21 #include <string>
22 
23 #include <ignition/gazebo/config.hh>
25 #include <ignition/gazebo/Export.hh>
26 #include <ignition/gazebo/Types.hh>
27 
28 namespace ignition
29 {
30  namespace gazebo
31  {
32  // Inline bracket to help doxygen filtering.
33  inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
34  // Forward declarations.
35  class IGNITION_GAZEBO_HIDDEN ModelPrivate;
36  //
57  class IGNITION_GAZEBO_VISIBLE Model {
60  public: explicit Model(gazebo::Entity _entity = kNullEntity);
61 
64  public: Model(const Model &_model);
65 
68  public: Model(Model &&_model) noexcept;
69 
73  public: Model &operator=(Model &&_model) noexcept;
74 
78  public: Model &operator=(const Model &_model);
79 
81  public: virtual ~Model();
82 
85  public: gazebo::Entity Entity() const;
86 
91  public: bool Valid(const EntityComponentManager &_ecm) const;
92 
96  public: std::string Name(const EntityComponentManager &_ecm) const;
97 
103  public: gazebo::Entity JointByName(const EntityComponentManager &_ecm,
104  const std::string &_name);
105 
111  public: gazebo::Entity LinkByName(const EntityComponentManager &_ecm,
112  const std::string &_name);
113 
115  private: std::unique_ptr<ModelPrivate> dataPtr;
116  };
117  }
118  }
119 }
120 #endif
This class provides wrappers around entities and components which are more convenient and straight-fo...
Definition: Model.hh:57
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
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
class IGNITION_GAZEBO_HIDDEN ModelPrivate
Definition: Model.hh:35
Component< NoData, class ModelTag > Model
A component that identifies an entity as being a model.
Definition: components/Model.hh:33
const Entity kNullEntity
Indicates a non-existant or invalid Entity.
Definition: Entity.hh:62
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