33 #ifndef EXAMPLES_ATLASSIMBICON_STATEMACHINE_HPP_ 34 #define EXAMPLES_ATLASSIMBICON_STATEMACHINE_HPP_ 39 #include <Eigen/Dense> 41 #include <dart/dart.hpp> 57 void setName(
const std::string& _name);
60 const std::string&
getName()
const;
71 void begin(
double _currentTime);
78 void end(
double _currentTime);
90 void transiteTo(std::string& _stateName,
double _currentTime);
93 void transiteTo(std::size_t _idx,
double _currentTime);
122 bool _containState(
const State* _state)
const;
125 bool _containState(
const std::string& _name)
const;
128 State* _findState(
const std::string& _name)
const;
134 #endif // EXAMPLES_ATLASSIMBICON_STATEMACHINE_HPP_ void transiteTo(State *_state, double _currentTime)
Change state to _state.
Definition: StateMachine.cpp:144
const std::string & getName() const
Get name.
Definition: StateMachine.cpp:74
StateMachine for Atlas robot.
Definition: StateMachine.hpp:46
void computeControlForce(double _dt)
Compute control force and apply it to Atlas robot.
Definition: StateMachine.cpp:108
double mBeginTime
Started time.
Definition: StateMachine.hpp:109
void setVerbosity(bool verbosity)
Set the verbosity.
Definition: StateMachine.cpp:185
double mEndTime
Stopped time.
Definition: StateMachine.hpp:112
double mElapsedTime
Elapsed time which is stopped time minus started time.
Definition: StateMachine.hpp:118
StateMachine(const std::string &_name)
Constructor.
Definition: StateMachine.cpp:46
State * getCurrentState()
Get current state.
Definition: StateMachine.cpp:132
std::string mName
Name.
Definition: StateMachine.hpp:100
class State
Definition: State.hpp:65
void addState(State *_state)
Add state.
Definition: StateMachine.cpp:80
std::vector< State * > mStates
States.
Definition: StateMachine.hpp:103
void setName(const std::string &_name)
Set name.
Definition: StateMachine.cpp:68
virtual ~StateMachine()
Destructor.
Definition: StateMachine.cpp:59
State * mCurrentState
Current state.
Definition: StateMachine.hpp:106
void begin(double _currentTime)
Initiate state.
Definition: StateMachine.cpp:98
int mFrame
Frame number.
Definition: StateMachine.hpp:115
void setInitialState(State *_state)
Set initial state.
Definition: StateMachine.cpp:89
void transiteToNextState(double _currentTime)
Transite to the next state manually.
Definition: StateMachine.cpp:138
void end(double _currentTime)
Finalize state.
Definition: StateMachine.cpp:124