Gazebo Sim

API Reference

7.9.0
gz/sim/Actor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 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 GZ_SIM_ACTOR_HH_
18 #define GZ_SIM_ACTOR_HH_
19 
20 #include <memory>
21 #include <optional>
22 #include <string>
23 
24 #include <gz/math/Pose3.hh>
25 
26 #include <gz/utils/ImplPtr.hh>
27 
28 #include "gz/sim/config.hh"
30 #include "gz/sim/Export.hh"
31 #include "gz/sim/Types.hh"
32 
33 namespace gz
34 {
35  namespace sim
36  {
37  // Inline bracket to help doxygen filtering.
38  inline namespace GZ_SIM_VERSION_NAMESPACE {
39  //
59  class GZ_SIM_VISIBLE Actor
60  {
63  public: explicit Actor(sim::Entity _entity = kNullEntity);
64 
67  public: sim::Entity Entity() const;
68 
71  public: void ResetEntity(sim::Entity _newEntity);
72 
77  public: bool Valid(const EntityComponentManager &_ecm) const;
78 
83  public: std::optional<std::string> Name(
84  const EntityComponentManager &_ecm) const;
85 
93  public: std::optional<math::Pose3d> Pose(
94  const EntityComponentManager &_ecm) const;
95 
104  public: std::optional<math::Pose3d> TrajectoryPose(
105  const EntityComponentManager &_ecm) const;
106 
115  public: void SetTrajectoryPose(EntityComponentManager &_ecm,
116  const math::Pose3d &_pose);
117 
128  public: std::optional<math::Pose3d> WorldPose(
129  const EntityComponentManager &_ecm) const;
130 
134  public: void SetAnimationName(EntityComponentManager &_ecm,
135  const std::string &_name);
136 
140  public: void SetAnimationTime(EntityComponentManager &_ecm,
141  const std::chrono::steady_clock::duration &_time);
142 
146  public: std::optional<std::string> AnimationName(
147  const EntityComponentManager &_ecm) const;
148 
152  public: std::optional<std::chrono::steady_clock::duration> AnimationTime(
153  const EntityComponentManager &_ecm) const;
154 
156  GZ_UTILS_IMPL_PTR(dataPtr)
157  };
158  }
159  }
160 }
161 #endif