21 #ifndef _WORLDSTATE_HH_
22 #define _WORLDSTATE_HH_
61 public:
explicit WorldState(
const sdf::ElementPtr _sdf);
70 public:
void Load(
const WorldPtr _world);
76 public:
virtual void Load(
const sdf::ElementPtr _elem);
80 public:
void SetWorld(
const WorldPtr _world);
86 public:
ModelState_M GetModelStates(
const boost::regex &_regex)
const;
96 public:
unsigned int GetModelStateCount()
const;
102 public:
ModelState GetModelState(
const std::string &_modelName)
const;
108 public:
bool HasModelState(
const std::string &_modelName)
const;
114 public:
bool IsZero()
const;
118 public:
void FillSDF(sdf::ElementPtr _sdf);
123 public:
virtual void SetWallTime(
const common::Time &_time);
127 public:
virtual void SetRealTime(
const common::Time &_time);
131 public:
virtual void SetSimTime(
const common::Time &_time);
152 public:
inline friend std::ostream &
operator<<(std::ostream &_out,
155 _out <<
"<state world_name='" << _state.
name <<
"'>"
156 <<
"<sim_time>" << _state.
simTime <<
"</sim_time>"
157 <<
"<wall_time>" << _state.
wallTime <<
"</wall_time>"
158 <<
"<real_time>" << _state.
realTime <<
"</real_time>";
161 if (_state.insertions.size() > 0)
163 _out <<
"<insertions>";
164 for (std::vector<std::string>::const_iterator iter =
165 _state.insertions.begin();
166 iter != _state.insertions.end(); ++iter)
170 _out <<
"</insertions>";
174 if (_state.deletions.size() > 0)
176 _out <<
"<deletions>";
177 for (std::vector<std::string>::const_iterator iter =
178 _state.deletions.begin();
179 iter != _state.deletions.end(); ++iter)
181 _out <<
"<name>" << (*iter) <<
"</name>";
183 _out <<
"</deletions>";
187 for (ModelState_M::const_iterator iter = _state.modelStates.begin();
188 iter != _state.modelStates.end(); ++iter)
190 _out << iter->second;
203 private: std::vector<std::string> insertions;
207 private: std::vector<std::string> deletions;
friend std::ostream & operator<<(std::ostream &_out, const gazebo::physics::WorldState &_state)
Stream insertion operator.
Definition: WorldState.hh:152
std::string name
Name associated with this State.
Definition: State.hh:114
common::Time realTime
Definition: State.hh:117
State of an entity.
Definition: State.hh:43
std::map< std::string, ModelState > ModelState_M
Definition: PhysicsTypes.hh:190
common::Time wallTime
Times for the state data.
Definition: State.hh:117
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:78
common::Time simTime
Definition: State.hh:117
Store state information of a physics::Model object.
Definition: ModelState.hh:50
Store state information of a physics::World object.
Definition: WorldState.hh:46
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:43