21 #ifndef _MODELSTATE_HH_
22 #define _MODELSTATE_HH_
26 #include <boost/regex.hpp>
76 public:
explicit ModelState(
const sdf::ElementPtr _sdf);
95 public:
virtual void Load(
const sdf::ElementPtr _elem);
103 public:
bool IsZero()
const;
109 public:
unsigned int GetLinkStateCount()
const;
115 public:
LinkState_M GetLinkStates(
const boost::regex &_regex)
const;
121 public:
JointState_M GetJointStates(
const boost::regex &_regex)
const;
130 public:
LinkState GetLinkState(
const std::string &_linkName)
const;
135 public:
bool HasLinkState(
const std::string &_linkName)
const;
145 public:
unsigned int GetJointStateCount()
const;
154 public:
JointState GetJointState(
unsigned int _index)
const;
163 public:
JointState GetJointState(
const std::string &_jointName)
const;
172 public:
bool HasJointState(
const std::string &_jointName)
const;
176 public:
void FillSDF(sdf::ElementPtr _sdf);
181 public:
virtual void SetWallTime(
const common::Time &_time);
185 public:
virtual void SetRealTime(
const common::Time &_time);
189 public:
virtual void SetSimTime(
const common::Time &_time);
210 public:
inline friend std::ostream &
operator<<(std::ostream &_out,
214 _out << std::fixed <<std::setprecision(3)
215 <<
"<model name='" << _state.
GetName() <<
"'>"
217 << _state.pose.
pos.
x <<
" "
218 << _state.pose.
pos.
y <<
" "
219 << _state.pose.
pos.
z <<
" "
225 for (LinkState_M::const_iterator iter =
226 _state.linkStates.begin(); iter != _state.linkStates.end();
229 _out << iter->second;
std::string GetName() const
Get the name associated with this State.
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:82
Encapsulates a position and rotation in three space.
Definition: Pose.hh:40
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:43
std::map< std::string, JointState > JointState_M
Definition: PhysicsTypes.hh:198
double x
X location.
Definition: Vector3.hh:302
double z
Z location.
Definition: Vector3.hh:308
State of an entity.
Definition: State.hh:43
Vector3 pos
The position.
Definition: Pose.hh:243
keeps track of state of a physics::Joint
Definition: JointState.hh:40
Quaternion rot
The rotation.
Definition: Pose.hh:246
friend std::ostream & operator<<(std::ostream &_out, const gazebo::physics::ModelState &_state)
Stream insertion operator.
Definition: ModelState.hh:210
Store state information of a physics::Model object.
Definition: ModelState.hh:50
std::map< std::string, LinkState > LinkState_M
Definition: PhysicsTypes.hh:194
Store state information of a physics::Link object.
Definition: LinkState.hh:49
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
double y
Y location.
Definition: Vector3.hh:305
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:43
Vector3 GetAsEuler() const
Return the rotation in Euler angles.