17 #ifndef GAZEBO_PHYSICS_LINKSTATE_HH_
18 #define GAZEBO_PHYSICS_LINKSTATE_HH_
24 #include <ignition/math/Pose3.hh>
61 const common::Time &_simTime,
const uint64_t _iterations);
74 public:
explicit LinkState(
const sdf::ElementPtr _sdf);
88 const common::Time &_simTime,
const uint64_t _iterations);
94 public:
virtual void Load(
const sdf::ElementPtr _elem);
103 public:
const ignition::math::Pose3d &Pose()
const;
112 public:
const ignition::math::Pose3d &Velocity()
const;
121 public:
const ignition::math::Pose3d &Acceleration()
const;
130 public:
const ignition::math::Pose3d &Wrench()
const;
136 public:
unsigned int GetCollisionStateCount()
const;
145 public:
CollisionState GetCollisionState(
unsigned int _index)
const;
155 const std::string &_collisionName)
const;
159 public:
const std::vector<CollisionState> &GetCollisionStates()
const;
163 public:
bool IsZero()
const;
167 public:
void FillSDF(sdf::ElementPtr _sdf);
172 public:
virtual void SetWallTime(
const common::Time &_time);
176 public:
virtual void SetRealTime(
const common::Time &_time);
180 public:
virtual void SetSimTime(
const common::Time &_time);
185 public:
virtual void SetIterations(
const uint64_t _iterations);
206 public:
inline friend std::ostream &
operator<<(std::ostream &_out,
209 ignition::math::Vector3d euler(_state.pose.Rot().Euler());
210 _out.unsetf(std::ios_base::floatfield);
211 _out << std::setprecision(4)
212 <<
"<link name='" << _state.
name <<
"'>"
214 << ignition::math::precision(_state.pose.Pos().X(), 4) <<
" "
215 << ignition::math::precision(_state.pose.Pos().Y(), 4) <<
" "
216 << ignition::math::precision(_state.pose.Pos().Z(), 4) <<
" "
217 << ignition::math::precision(euler.X(), 4) <<
" "
218 << ignition::math::precision(euler.Y(), 4) <<
" "
219 << ignition::math::precision(euler.Z(), 4) <<
" "
225 euler = _state.velocity.Rot().Euler();
226 _out.unsetf(std::ios_base::floatfield);
227 _out << std::setprecision(4)
229 << ignition::math::precision(_state.velocity.Pos().X(), 4) <<
" "
230 << ignition::math::precision(_state.velocity.Pos().Y(), 4) <<
" "
231 << ignition::math::precision(_state.velocity.Pos().Z(), 4) <<
" "
232 << ignition::math::precision(euler.X(), 4) <<
" "
233 << ignition::math::precision(euler.Y(), 4) <<
" "
234 << ignition::math::precision(euler.Z(), 4) <<
" "
256 public:
void SetRecordVelocity(
const bool _record);
260 public:
bool RecordVelocity()
const;
263 private: ignition::math::Pose3d pose;
266 private: ignition::math::Pose3d velocity;
269 private: ignition::math::Pose3d acceleration;
272 private: ignition::math::Pose3d wrench;
275 private: std::vector<CollisionState> collisionStates;
boost::shared_ptr< Link > LinkPtr
Definition: PhysicsTypes.hh:109
std::string name
Name associated with this State.
Definition: State.hh:130
Encapsulates a position and rotation in three space.
Definition: Pose.hh:42
State of an entity.
Definition: State.hh:49
friend std::ostream & operator<<(std::ostream &_out, const gazebo::physics::LinkState &_state)
Stream insertion operator.
Definition: LinkState.hh:206
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
Store state information of a physics::Collision object.
Definition: CollisionState.hh:44
bool RecordVelocity() const
Get whether link velocity is recorded.
Store state information of a physics::Link object.
Definition: LinkState.hh:47
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:44