##

State.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/* Desc: A generic physics state
* Author: Nate Koenig
*/
#ifndef _STATE_HH_
#define _STATE_HH_
#include <string>
#include <sdf/sdf.hh>
#include "gazebo/physics/PhysicsTypes.hh"
#include "gazebo/common/Time.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace physics
{
class GZ_PHYSICS_VISIBLE State
{
public: State();
public: State(const std::string &_name,
const common::Time &_realTime,
const common::Time &_simTime,
const uint64_t _iterations);
public: virtual ~State();
public: virtual void Load(const sdf::ElementPtr _elem);
public: State &operator=(const State &_state);
public: State operator-(const State &_state) const;
public: std::string GetName() const;
public: void SetName(const std::string &_name);
public: common::Time GetWallTime() const;
public: common::Time GetRealTime() const;
public: common::Time GetSimTime() const;
public: uint64_t GetIterations() const;
public: virtual void SetWallTime(const common::Time &_time);
public: virtual void SetRealTime(const common::Time &_time);
public: virtual void SetSimTime(const common::Time &_time);
public: virtual void SetIterations(const uint64_t _iterations);
protected: std::string name;
protected: common::Time wallTime, realTime, simTime;
protected: uint64_t iterations = 0;
};
}
}
#endif
gazebo::physics::State::GetIterations
uint64_t GetIterations() const
Get the iterations when this state was generated.
gazebo::physics::State::wallTime
common::Time wallTime
Times for the state data.
Definition: State.hh:127
gazebo::physics::State::iterations
uint64_t iterations
The number of simulation iterations when this state was generated.
Definition: State.hh:131
Time.hh
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::common::Time
A Time class, can be used to hold wall- or sim-time. stored as sec and nano-sec.
Definition: Time.hh:47
gazebo::physics::State::GetSimTime
common::Time GetSimTime() const
Get the sim time when this state was generated.
system.hh
PhysicsTypes.hh
default namespace for gazebo
gazebo::physics::State::realTime
common::Time realTime
Definition: State.hh:127
gazebo::physics::State::SetWallTime
virtual void SetWallTime(const common::Time &_time)
Set the wall time when this state was generated.
gazebo::physics::State::SetRealTime
virtual void SetRealTime(const common::Time &_time)
Set the real time when this state was generated.
gazebo::physics::State::GetName
std::string GetName() const
Get the name associated with this State.
gazebo::physics::State::SetIterations
virtual void SetIterations(const uint64_t _iterations)
Set the iterations when this state was generated.
gazebo::physics::State::operator=
State & operator=(const State &_state)
Assignment operator.
gazebo::physics::State::SetName
void SetName(const std::string &_name)
Set the name associated with this State.
gazebo::physics::State::~State
virtual ~State()
Destructor.
gazebo::physics::State::simTime
common::Time simTime
Definition: State.hh:127
gazebo::physics::State
State of an entity.
Definition: State.hh:43
gazebo::physics::State::SetSimTime
virtual void SetSimTime(const common::Time &_time)
Set the sim time when this state was generated.
gazebo::physics::State::operator-
State operator-(const State &_state) const
Subtraction operator.
gazebo::physics::State::GetWallTime
common::Time GetWallTime() const
Get the wall time when this state was generated.
gazebo::physics::State::name
std::string name
Name associated with this State.
Definition: State.hh:124
gazebo::physics::State::State
State()
Default constructor.
gazebo::physics::State::GetRealTime
common::Time GetRealTime() const
Get the real time when this state was generated.
gazebo::physics::State::Load
virtual void Load(const sdf::ElementPtr _elem)
Load state from SDF element.