21 #ifndef _MODELSTATE_HH_
22 #define _MODELSTATE_HH_
26 #include <boost/regex.hpp>
64 const common::Time &_simTime,
const uint64_t _iterations);
77 public:
explicit ModelState(
const sdf::ElementPtr _sdf);
91 const common::Time &_simTime,
const uint64_t _iterations);
97 public:
virtual void Load(
const sdf::ElementPtr _elem);
105 public:
bool IsZero()
const;
111 public:
unsigned int GetLinkStateCount()
const;
117 public:
LinkState_M GetLinkStates(
const boost::regex &_regex)
const;
123 public:
JointState_M GetJointStates(
const boost::regex &_regex)
const;
132 public:
LinkState GetLinkState(
const std::string &_linkName)
const;
137 public:
bool HasLinkState(
const std::string &_linkName)
const;
147 public:
unsigned int GetJointStateCount()
const;
156 public:
JointState GetJointState(
unsigned int _index)
const;
165 public:
JointState GetJointState(
const std::string &_jointName)
const;
174 public:
bool HasJointState(
const std::string &_jointName)
const;
178 public:
void FillSDF(sdf::ElementPtr _sdf);
183 public:
virtual void SetWallTime(
const common::Time &_time);
187 public:
virtual void SetRealTime(
const common::Time &_time);
191 public:
virtual void SetSimTime(
const common::Time &_time);
196 public:
virtual void SetIterations(
const uint64_t _iterations);
217 public:
inline friend std::ostream &
operator<<(std::ostream &_out,
221 _out << std::fixed <<std::setprecision(3)
222 <<
"<model name='" << _state.
GetName() <<
"'>"
224 << _state.pose.
pos.
x <<
" "
225 << _state.pose.
pos.
y <<
" "
226 << _state.pose.
pos.
z <<
" "
232 for (LinkState_M::const_iterator iter =
233 _state.linkStates.begin(); iter != _state.linkStates.end();
236 _out << iter->second;
std::string GetName() const
Get the name associated with this State.
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:84
#define GZ_PHYSICS_VISIBLE
Definition: system.hh:318
Encapsulates a position and rotation in three space.
Definition: Pose.hh:37
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
std::map< std::string, JointState > JointState_M
Definition: PhysicsTypes.hh:212
double x
X location.
Definition: Vector3.hh:311
double z
Z location.
Definition: Vector3.hh:317
State of an entity.
Definition: State.hh:49
Vector3 pos
The position.
Definition: Pose.hh:252
keeps track of state of a physics::Joint
Definition: JointState.hh:46
Quaternion rot
The rotation.
Definition: Pose.hh:255
friend std::ostream & operator<<(std::ostream &_out, const gazebo::physics::ModelState &_state)
Stream insertion operator.
Definition: ModelState.hh:217
Store state information of a physics::Model object.
Definition: ModelState.hh:50
std::map< std::string, LinkState > LinkState_M
Definition: PhysicsTypes.hh:208
Store state information of a physics::Link object.
Definition: LinkState.hh:49
double y
Y location.
Definition: Vector3.hh:314
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:39
Vector3 GetAsEuler() const
Return the rotation in Euler angles.