17#ifndef _GAZEBO_SKELETONANIMATION_HH_
18#define _GAZEBO_SKELETONANIMATION_HH_
24#include <ignition/math/Matrix4.hh>
25#include <ignition/math/Pose3.hh>
50 public:
void SetName(
const std::string &_name);
60 const ignition::math::Matrix4d &_trans);
66 const ignition::math::Pose3d &_pose);
78 public:
void GetKeyFrame(
const unsigned int _i,
double &_time,
79 ignition::math::Matrix4d &_trans)
const;
86 public: std::pair<double, ignition::math::Matrix4d>
KeyFrame(
87 const unsigned int _i)
const;
100 double _time,
bool _loop =
true)
const;
105 public:
void Scale(
const double _scale);
119 protected: std::map<double, ignition::math::Matrix4d>
keyFrames;
138 public:
void SetName(
const std::string &_name);
151 public:
bool HasNode(
const std::string &_node)
const;
157 public:
void AddKeyFrame(
const std::string &_node,
const double _time,
158 const ignition::math::Matrix4d &_mat);
165 public:
void AddKeyFrame(
const std::string &_node,
const double _time,
166 const ignition::math::Pose3d &_pose);
177 public: ignition::math::Matrix4d
NodePoseAt(
const std::string &_node,
178 const double _time,
const bool _loop =
true);
188 public: std::map<std::string, ignition::math::Matrix4d>
PoseAt(
189 const double _time,
const bool _loop =
true)
const;
199 public: std::map<std::string, ignition::math::Matrix4d>
PoseAtX(
200 const double _x,
const std::string &_node,
201 const bool _loop =
true)
const;
206 public:
void Scale(
const double _scale);
common
Definition FuelModelDatabase.hh:37
Node animation.
Definition SkeletonAnimation.hh:40
void SetName(const std::string &_name)
Changes the name of the animation.
NodeAnimation(const std::string &_name)
constructor
~NodeAnimation()
Destructor. It empties the key frames list.
ignition::math::Matrix4d FrameAt(double _time, bool _loop=true) const
Returns a frame transformation at a specific time if a node does not exist at that time (with toleran...
std::map< double, ignition::math::Matrix4d > keyFrames
the dictionary of key frames, indexed by time
Definition SkeletonAnimation.hh:119
unsigned int GetFrameCount() const
Returns the number of key frames.
void AddKeyFrame(const double _time, const ignition::math::Matrix4d &_trans)
Adds a key frame at a specific time.
double length
the duration of the animations (time of last key frame)
Definition SkeletonAnimation.hh:122
std::string GetName() const
Returns the name.
std::string name
the name of the animation
Definition SkeletonAnimation.hh:116
std::pair< double, ignition::math::Matrix4d > KeyFrame(const unsigned int _i) const
Returns a key frame using the index.
void GetKeyFrame(const unsigned int _i, double &_time, ignition::math::Matrix4d &_trans) const
Finds a key frame using the index.
void Scale(const double _scale)
Scales each transformation in the key frames.
double GetTimeAtX(const double _x) const
Returns the time where a transformation's translational value along the X axis is equal to _x.
double GetLength() const
Returns the duration of the animations.
void AddKeyFrame(const double _time, const ignition::math::Pose3d &_pose)
Adds a key frame at a specific time.
Skeleton animation.
Definition SkeletonAnimation.hh:127
void SetName(const std::string &_name)
Changes the name.
std::map< std::string, ignition::math::Matrix4d > PoseAtX(const double _x, const std::string &_node, const bool _loop=true) const
Returns a dictionary of transformations indexed by name where a named node transformation's translati...
unsigned int GetNodeCount() const
Returns the number of animation nodes.
std::map< std::string, ignition::math::Matrix4d > PoseAt(const double _time, const bool _loop=true) const
Returns a dictionary of transformations indexed by name at a specific time if a node does not exist a...
bool HasNode(const std::string &_node) const
Looks for a node with a specific name in the animations.
double length
the duration of the longest animation
Definition SkeletonAnimation.hh:216
SkeletonAnimation(const std::string &_name)
The Constructor.
std::string GetName() const
Returns the name.
ignition::math::Matrix4d NodePoseAt(const std::string &_node, const double _time, const bool _loop=true)
Returns the key frame transformation for a named animation at a specific time if a node does not exis...
std::string name
the node name
Definition SkeletonAnimation.hh:213
void AddKeyFrame(const std::string &_node, const double _time, const ignition::math::Pose3d &_pose)
Adds or replaces a named key frame at a specific time.
void Scale(const double _scale)
Scales every animation in the animations list.
~SkeletonAnimation()
The destructor.
double GetLength() const
Returns the duration of the animations.
std::map< std::string, NodeAnimation * > animations
a dictionary of node animations
Definition SkeletonAnimation.hh:219
void AddKeyFrame(const std::string &_node, const double _time, const ignition::math::Matrix4d &_mat)
Adds or replaces a named key frame at a specific time.
Forward declarations for the common classes.
Definition Animation.hh:27