InterfaceModel.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2021 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 
18 #ifndef SDF_INTERFACE_MODEL_HH_
19 #define SDF_INTERFACE_MODEL_HH_
20 
21 #include <functional>
22 #include <string>
23 #include <memory>
24 #include <vector>
25 
26 #include <ignition/math/Pose3.hh>
27 #include <ignition/utils/ImplPtr.hh>
28 
29 #include "sdf/InterfaceFrame.hh"
30 #include "sdf/InterfaceJoint.hh"
31 #include "sdf/InterfaceLink.hh"
33 #include "sdf/Types.hh"
34 
35 #include "sdf/sdf_config.h"
36 #include "sdf/system_util.hh"
37 
38 namespace sdf
39 {
40 inline namespace SDF_VERSION_NAMESPACE
41 {
42 class InterfaceModel;
43 class Model;
44 struct PoseRelativeToGraph;
45 template <typename T>
46 class ScopedGraph;
47 class World;
48 
49 using InterfaceModelPtr = std::shared_ptr<InterfaceModel>;
50 using InterfaceModelConstPtr = std::shared_ptr<const InterfaceModel>;
51 
53 using RepostureFunction =
54  std::function<void(const sdf::InterfaceModelPoseGraph &)>;
55 
58 {
71  public: InterfaceModel(const std::string &_name,
72  const sdf::RepostureFunction &_repostureFunction,
73  bool _static,
74  const std::string &_canonicalLinkName,
75  const ignition::math::Pose3d &_poseInParentFrame = {});
76 
79  public: const std::string &Name() const;
80 
83  public: bool Static() const;
84 
90  public: const std::string &CanonicalLinkName() const;
91 
94  public: const ignition::math::Pose3d &ModelFramePoseInParentFrame() const;
95 
98  public: void AddNestedModel(sdf::InterfaceModelConstPtr _nestedModel);
99 
101  public: const std::vector<sdf::InterfaceModelConstPtr> &NestedModels() const;
102 
106  public: void AddFrame(sdf::InterfaceFrame _frame);
107 
109  public: const std::vector<sdf::InterfaceFrame> &Frames() const;
110 
114  public: void AddJoint(sdf::InterfaceJoint _joint);
115 
117  public: const std::vector<sdf::InterfaceJoint> &Joints() const;
118 
122  public: void AddLink(sdf::InterfaceLink _link);
123 
125  public: const std::vector<sdf::InterfaceLink> &Links() const;
126 
129  private: void InvokeRespostureFunction(
131 
132  friend World;
133  friend Model;
135  IGN_UTILS_IMPL_PTR(dataPtr)
136 };
137 }
138 }
139 
140 #endif
InterfaceModelPoseGraph.hh
InterfaceJoint.hh
sdf::v11::ScopedGraph
Definition: Collision.hh:39
sdf::v11::World
Definition: World.hh:51
sdf::v11::InterfaceModelPtr
std::shared_ptr< InterfaceModel > InterfaceModelPtr
Definition: InterfaceModel.hh:49
sdf::v11::InterfaceJoint
Interface element representing a Joint.
Definition: InterfaceJoint.hh:34
sdf
namespace for Simulation Description Format parser
Definition: Actor.hh:33
sdf::v11::Model
Definition: Model.hh:48
Types.hh
SDFORMAT_VISIBLE
#define SDFORMAT_VISIBLE
Definition: system_util.hh:41
InterfaceFrame.hh
sdf::v11::InterfaceModelConstPtr
std::shared_ptr< const InterfaceModel > InterfaceModelConstPtr
Definition: InterfaceModel.hh:50
sdf::v11::InterfaceModel
Interface element representing a Model.
Definition: InterfaceModel.hh:57
sdf::v11::RepostureFunction
std::function< void(const sdf::InterfaceModelPoseGraph &)> RepostureFunction
Function signature for the reposture callback function.
Definition: InterfaceModel.hh:54
system_util.hh
sdf::v11::InterfaceFrame
Interface element representing an explicit frame.
Definition: InterfaceFrame.hh:34
sdf::v11::InterfaceModelPoseGraph
Class used in reposture callbacks of custom parsers to resolve poses.
Definition: InterfaceModelPoseGraph.hh:44