dart
Public Member Functions | Protected Attributes | List of all members
StateMachine Class Reference

StateMachine for Atlas robot. More...

#include <StateMachine.hpp>

Collaboration diagram for StateMachine:
Collaboration graph
[legend]

Public Member Functions

 StateMachine (const std::string &_name)
 Constructor.
 
virtual ~StateMachine ()
 Destructor.
 
void setName (const std::string &_name)
 Set name.
 
const std::string & getName () const
 Get name.
 
void addState (State *_state)
 Add state.
 
void setInitialState (State *_state)
 Set initial state.
 
void begin (double _currentTime)
 Initiate state. More...
 
void computeControlForce (double _dt)
 Compute control force and apply it to Atlas robot.
 
void end (double _currentTime)
 Finalize state. More...
 
StategetCurrentState ()
 Get current state.
 
void transiteToNextState (double _currentTime)
 Transite to the next state manually.
 
void transiteTo (State *_state, double _currentTime)
 Change state to _state.
 
void transiteTo (std::string &_stateName, double _currentTime)
 Change state to a state whose names is _stateName.
 
void transiteTo (std::size_t _idx, double _currentTime)
 Change state to a state whose index is _idx.
 
void setVerbosity (bool verbosity)
 Set the verbosity.
 
 StateMachine (const std::string &_name)
 Constructor.
 
virtual ~StateMachine ()
 Destructor.
 
void setName (const std::string &_name)
 Set name.
 
const std::string & getName () const
 Get name.
 
void addState (State *_state)
 Add state.
 
void setInitialState (State *_state)
 Set initial state.
 
void begin (double _currentTime)
 Initiate state. More...
 
void computeControlForce (double _dt)
 Compute control force and apply it to Atlas robot.
 
void end (double _currentTime)
 Finalize state. More...
 
StategetCurrentState ()
 Get current state.
 
void transiteToNextState (double _currentTime)
 Transite to the next state manually.
 
void transiteTo (State *_state, double _currentTime)
 Change state to _state.
 
void transiteTo (std::string &_stateName, double _currentTime)
 Change state to a state whose names is _stateName.
 
void transiteTo (std::size_t _idx, double _currentTime)
 Change state to a state whose index is _idx.
 

Protected Attributes

std::string mName
 Name.
 
std::vector< State * > mStates
 States.
 
StatemCurrentState
 Current state.
 
double mBeginTime
 Started time.
 
double mEndTime
 Stopped time.
 
int mFrame
 Frame number.
 
double mElapsedTime
 Elapsed time which is stopped time minus started time.
 

Detailed Description

StateMachine for Atlas robot.

Member Function Documentation

◆ begin() [1/2]

void StateMachine::begin ( double  _currentTime)

Initiate state.

This is called when the contoller change the current state machine to this.

◆ begin() [2/2]

void StateMachine::begin ( double  _currentTime)

Initiate state.

This is called when the contoller change the current state machine to this.

◆ end() [1/2]

void StateMachine::end ( double  _currentTime)

Finalize state.

This is called when the state machine stransite from this state to the next state.

◆ end() [2/2]

void StateMachine::end ( double  _currentTime)

Finalize state.

This is called when the state machine stransite from this state to the next state.


The documentation for this class was generated from the following files: