17 #ifndef GAZEBO_PHYSICS_ACTOR_HH_ 18 #define GAZEBO_PHYSICS_ACTOR_HH_ 24 #include <ignition/math/Color.hh> 49 public:
unsigned int id;
77 public:
typedef std::map<std::string, common::SkeletonAnimation *>
85 public:
virtual ~
Actor();
89 public:
void Load(sdf::ElementPtr _sdf);
92 public:
virtual void Init();
95 public:
virtual void Play();
98 public:
virtual void Stop();
102 public:
virtual bool IsActive()
const;
105 public:
void Update();
108 public:
virtual void Fini();
112 public:
virtual void UpdateParameters(sdf::ElementPtr _sdf);
116 public:
virtual const sdf::ElementPtr GetSDF();
119 public:
void Reset();
126 public:
void SetScriptTime(
const double _time);
132 public:
double ScriptTime()
const;
155 public:
void ResetCustomTrajectory();
161 public:
virtual bool GetSelfCollide()
const;
168 public:
virtual void SetSelfCollide(
bool _selfCollide);
174 public:
virtual bool WindMode()
const;
181 public:
virtual void SetWindMode(
const bool _enabled);
188 private:
void AddSphereInertia(
const sdf::ElementPtr &_linkSdf,
189 const ignition::math::Pose3d &_pose,
190 const double _mass,
const double _radius);
198 private:
void AddSphereCollision(
const sdf::ElementPtr &_linkSdf,
199 const std::string &_name,
200 const ignition::math::Pose3d &_pose,
201 const double _radius);
209 private:
void AddBoxCollision(
const sdf::ElementPtr &_linkSdf,
210 const std::string &_name,
211 const ignition::math::Pose3d &_pose,
212 const ignition::math::Vector3d &_size);
221 private:
void AddSphereVisual(
const sdf::ElementPtr &_linkSdf,
222 const std::string &_name,
223 const ignition::math::Pose3d &_pose,
const double _radius,
224 const std::string &_material,
225 const ignition::math::Color &_ambient);
234 private:
void AddBoxVisual(
const sdf::ElementPtr &_linkSdf,
235 const std::string &_name,
236 const ignition::math::Pose3d &_pose,
237 const ignition::math::Vector3d &_size,
238 const std::string &_material,
239 const ignition::math::Color &_ambient);
245 private:
void AddActorVisual(
const sdf::ElementPtr &_linkSdf,
246 const std::string &_name,
247 const ignition::math::Pose3d &_pose);
253 private:
bool LoadSkin(sdf::ElementPtr _sdf);
260 private:
void LoadAnimation(sdf::ElementPtr _sdf);
264 private:
void LoadScript(sdf::ElementPtr _sdf);
271 private:
void SetPose(
272 std::map<std::string, ignition::math::Matrix4d> _frame,
273 std::map<std::string, std::string> _skelMap,
317 protected: std::map<unsigned int, common::PoseAnimation *>
trajectories;
339 protected: std::map<std::string, std::map<std::string, std::string> >
369 private:
double scriptTime;
transport::PublisherPtr bonePosePub
Publisher to send bone info.
Definition: Actor.hh:365
A 3D mesh.
Definition: Mesh.hh:42
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:109
A skeleton.
Definition: Skeleton.hh:52
Forward declarations for the common classes.
Definition: Animation.hh:26
double startTime
Start time of this keyframe within the trajectory, in seconds.
Definition: Actor.hh:59
ignition::math::Vector3d lastPos
Last position of the actor.
Definition: Actor.hh:350
bool loop
True if the animation should loop.
Definition: Actor.hh:296
std::vector< TrajectoryInfo > trajInfo
A vector of trajectory information, which contains information such as their durations, uniquely identifiable by their IDs.
Definition: Actor.hh:323
Actor class enables GPU based mesh model / skeleton scriptable animation.
Definition: Actor.hh:74
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
unsigned int id
ID of the trajectory.
Definition: Actor.hh:49
std::shared_ptr< TrajectoryInfo > TrajectoryInfoPtr
Definition: PhysicsTypes.hh:101
double scriptLength
Total time length of the script, in seconds.
Definition: Actor.hh:293
std::string skinFile
Filename for the skin.
Definition: Actor.hh:283
std::map< unsigned int, common::PoseAnimation * > trajectories
Map of all the trajectories (pose animations) and their indices.
Definition: Actor.hh:317
A model is a collection of links, joints, and plugins.
Definition: Model.hh:59
SkeletonAnimation_M skelAnimation
Map of skeleton animations, indexed by their names.
Definition: Actor.hh:329
uint32_t visualId
ID for the visual representing the skin.
Definition: Actor.hh:362
Information about a trajectory for an Actor.
Definition: Actor.hh:43
double endTime
End time of this keyframe within the trajectory, in seconds.
Definition: Actor.hh:62
double duration
Duration of this keyframe in seconds.
Definition: Actor.hh:56
std::string visualName
Name of the visual representing the skin.
Definition: Actor.hh:359
bool translated
True if the trajectory is translated.
Definition: Actor.hh:65
std::map< std::string, std::map< std::string, std::string > > skelNodesMap
Skeleton to node map:
Definition: Actor.hh:340
bool autoStart
True if the actor should start running automatically, otherwise it will only start once Play is calle...
Definition: Actor.hh:303
std::map< std::string, common::SkeletonAnimation * > SkeletonAnimation_M
Typedef the skeleton animation map, indexed by their names.
Definition: Actor.hh:78
LinkPtr mainLink
Pointer to the actor's canonical link.
Definition: Actor.hh:306
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
double skinScale
Scaling factor to apply to the skin.
Definition: Actor.hh:286
double pathLength
Length of the actor's path.
Definition: Actor.hh:353
bool active
True if the actor is being updated.
Definition: Actor.hh:299
unsigned int lastTraj
Id of the last trajectory.
Definition: Actor.hh:356
common::Time prevFrameTime
Time of the previous frame.
Definition: Actor.hh:309
common::Time playStartTime
Time when the animation was started.
Definition: Actor.hh:312
double startDelay
Time to wait before starting the script.
Definition: Actor.hh:290
std::string type
Type of trajectory.
Definition: Actor.hh:53
std::map< std::string, bool > interpolateX
Map of animation types (the same name as in skelAnimation and skelNodesMap) and whether they should b...
Definition: Actor.hh:347
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:44