Actor.hh
Go to the documentation of this file.
1 /*
2  * Copyright 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 SDF_ACTOR_HH_
18 #define SDF_ACTOR_HH_
19 
20 #include <memory>
21 #include <string>
22 
23 #include <ignition/math/Pose3.hh>
24 #include <ignition/utils/ImplPtr.hh>
25 
26 #include "sdf/Element.hh"
27 #include "sdf/Types.hh"
28 #include "sdf/Link.hh"
29 #include "sdf/Joint.hh"
30 #include "sdf/sdf_config.h"
31 #include "sdf/system_util.hh"
32 
33 namespace sdf
34 {
35  // Inline bracke to help doxygen filtering.
36  inline namespace SDF_VERSION_NAMESPACE {
37  //
40  {
42  public: Animation();
43 
50  public: Errors Load(ElementPtr _sdf);
51 
54  public: const std::string &Name() const;
55 
58  public: void SetName(const std::string &_name);
59 
62  public: const std::string &Filename() const;
63 
66  public: void SetFilename(const std::string &_filename);
67 
70  public: const std::string &FilePath() const;
71 
74  public: void SetFilePath(const std::string &_filePath);
75 
78  public: double Scale() const;
79 
82  public: void SetScale(double _scale);
83 
86  public: bool InterpolateX() const;
87 
90  public: void SetInterpolateX(bool _interpolateX);
91 
93  IGN_UTILS_IMPL_PTR(dataPtr)
94  };
95 
98  {
100  public: Waypoint();
101 
108  public: Errors Load(ElementPtr _sdf);
109 
112  public: double Time() const;
113 
116  public: void SetTime(double _time);
117 
120  public: ignition::math::Pose3d Pose() const;
121 
124  public: void SetPose(const ignition::math::Pose3d &_pose);
125 
127  IGN_UTILS_IMPL_PTR(dataPtr)
128  };
129 
132  {
134  public: Trajectory();
135 
142  public: Errors Load(ElementPtr _sdf);
143 
146  public: uint64_t Id() const;
147 
150  public: void SetId(uint64_t _id);
151 
154  public: const std::string &Type() const;
155 
159  public: void SetType(const std::string &_type);
160 
163  public: double Tension() const;
164 
167  public: void SetTension(double _tension);
168 
171  public: uint64_t WaypointCount() const;
172 
178  public: const Waypoint *WaypointByIndex(uint64_t _index) const;
179 
182  public: void AddWaypoint(const Waypoint &_waypoint);
183 
185  IGN_UTILS_IMPL_PTR(dataPtr)
186  };
187 
188 
191  {
193  public: Actor();
194 
201  public: Errors Load(ElementPtr _sdf);
202 
205  public: const std::string &Name() const;
206 
209  public: void SetName(const std::string &_name);
210 
216  public: const ignition::math::Pose3d &RawPose() const;
217 
221  public: void SetRawPose(const ignition::math::Pose3d &_pose);
222 
227  public: const std::string &PoseRelativeTo() const;
228 
233  public: void SetPoseRelativeTo(const std::string &_frame);
234 
237  public: const std::string &FilePath() const;
238 
241  public: void SetFilePath(const std::string &_filePath);
242 
245  public: const std::string &SkinFilename() const;
246 
249  public: void SetSkinFilename(std::string _skinFilename);
250 
253  public: double SkinScale() const;
254 
257  public: void SetSkinScale(double _skinScale);
258 
261  public: uint64_t AnimationCount() const;
262 
268  public: const Animation *AnimationByIndex(uint64_t _index) const;
269 
273  public: bool AnimationNameExists(const std::string &_name) const;
274 
277  public: void AddAnimation(const Animation &_anim);
278 
281  public: bool ScriptLoop() const;
282 
286  public: void SetScriptLoop(bool _scriptLoop);
287 
290  public: double ScriptDelayStart() const;
291 
294  public: void SetScriptDelayStart(double _scriptDelayStart);
295 
298  public: bool ScriptAutoStart() const;
299 
303  public: void SetScriptAutoStart(bool _scriptAutoStart);
304 
307  public: uint64_t TrajectoryCount() const;
308 
314  public: const Trajectory *TrajectoryByIndex(uint64_t _index) const;
315 
319  public: bool TrajectoryIdExists(uint64_t _id) const;
320 
323  public: void AddTrajectory(const Trajectory &_traj);
324 
327  public: uint64_t LinkCount() const;
328 
334  public: const Link *LinkByIndex(uint64_t _index) const;
335 
339  public: bool LinkNameExists(const std::string &_name) const;
340 
343  public: uint64_t JointCount() const;
344 
350  public: const Joint *JointByIndex(uint64_t _index) const;
351 
355  public: bool JointNameExists(const std::string &_name) const;
356 
361  public: sdf::ElementPtr Element() const;
362 
364  IGN_UTILS_IMPL_PTR(dataPtr)
365  };
366  }
367 }
368 #endif
sdf::v11::Joint
Definition: Joint.hh:85
sdf::v11::Actor
Provides a description of an actor.
Definition: Actor.hh:190
sdf::v11::ElementPtr
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:53
sdf
namespace for Simulation Description Format parser
Definition: Actor.hh:33
sdf::v11::Waypoint
Waypoint for Trajectory.
Definition: Actor.hh:97
sdf::v11::Animation
Animation in Actor.
Definition: Actor.hh:39
Types.hh
SDFORMAT_VISIBLE
#define SDFORMAT_VISIBLE
Definition: system_util.hh:41
Joint.hh
sdf::v11::Time
A Time class, can be used to hold wall- or sim-time.
Definition: Types.hh:177
sdf::v11::Trajectory
Trajectory for Animation.
Definition: Actor.hh:131
system_util.hh
sdf::v11::Element
class SDFORMAT_VISIBLE Element
Definition: Element.hh:49
sdf::v11::Errors
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:106
Element.hh