mc_control::fsm::StabilizerStandingState Struct Reference

Simple state to control and stabilize the CoM of a biped-like robot using the LIPMStabilizer. More...

#include <mc_control/fsm/states/StabilizerStandingState.h>

Inheritance diagram for mc_control::fsm::StabilizerStandingState:
Collaboration diagram for mc_control::fsm::StabilizerStandingState:

Public Member Functions

void configure (const mc_rtc::Configuration &config) override
 
void start (Controller &) override
 
bool run (Controller &) override
 
void teardown (Controller &) override
 
- Public Member Functions inherited from mc_control::fsm::State
virtual ~State ()
 
void configure_ (const mc_rtc::Configuration &config)
 
void start_ (Controller &ctl)
 
void teardown_ (Controller &ctl)
 
virtual void stop (Controller &)
 
virtual bool read_msg (std::string &)
 
virtual bool read_write_msg (std::string &, std::string &)
 
const std::string & output () const noexcept
 
const std::string & name ()
 
void name (const std::string &n)
 

Protected Member Functions

void targetCoP (const Eigen::Vector3d &cop)
 Targets a given Cop. The CoM height will be automatically set at comHeight_ above this CoP. The default CoM height is that of the stabilizer's configuration, and can be overriden from configuration through "comHeight: 0.8" entry. More...
 
void targetCoM (const Eigen::Vector3d &com)
 Freely target a CoM position. The corresponding CoP position will be computed as the projection of the CoM at the average height of both feet contacts. More...
 
double copHeight () const
 CoP height from contacts. More...
 
- Protected Member Functions inherited from mc_control::fsm::State
void output (const std::string &o)
 

Protected Attributes

std::shared_ptr< mc_tasks::lipm_stabilizer::StabilizerTaskstabilizerTask_ = nullptr
 
mc_rtc::Configuration config_
 
bool hasCompletion_ = false
 
Eigen::Vector3d dcmThreshold_ = Eigen::Vector3d{0.01, 0.01, 0.01}
 
mc_planning::Pendulum pendulum_
 
double K_ = 5
 
double D_ = 0.
 
double comHeight_ = 0
 
Eigen::Vector3d comTarget_ = Eigen::Vector3d::Zero()
 
Eigen::Vector3d copTarget_ = Eigen::Vector3d::Zero()
 
bool optionalGUI_ = true
 
std::string robot_ = ""
 
std::string anchorFrameFunction_ = ""
 
bool ownsAnchorFrameCallback_
 
- Protected Attributes inherited from mc_control::fsm::State
mc_rtc::Configuration add_contacts_config_
 
mc_rtc::Configuration remove_contacts_config_
 
mc_rtc::Configuration add_contacts_after_config_
 
mc_rtc::Configuration remove_contacts_after_config_
 
mc_rtc::Configuration add_collisions_config_
 
mc_rtc::Configuration remove_collisions_config_
 
mc_rtc::Configuration add_collisions_after_config_
 
mc_rtc::Configuration remove_collisions_after_config_
 
mc_rtc::Configuration constraints_config_
 
mc_rtc::Configuration tasks_config_
 
mc_rtc::Configuration remove_posture_task_
 
mc_rtc::Configuration config_
 
std::vector< mc_solver::ConstraintSetPtrconstraints_
 
std::vector< std::pair< mc_tasks::MetaTaskPtr, mc_rtc::Configuration > > tasks_
 
std::vector< mc_tasks::PostureTaskPtrpostures_
 

Detailed Description

Simple state to control and stabilize the CoM of a biped-like robot using the LIPMStabilizer.

This state allows to:

  • Move the CoM to a desired position using the LIPMStabilizer The reference trajectory is computed as a simple spring-damper system.

Typical uses:

Member Function Documentation

◆ configure()

void mc_control::fsm::StabilizerStandingState::configure ( const mc_rtc::Configuration config)
overridevirtual

Called to configure the state.

This is called multiple times:

  • once for every level of state inheritance
  • once with the executor configuration, this is the FSM global executor, the Meta state executor, the Parallel state or any state that handle other states

The default implementation simply loads the provided configuration into the config_ protected members. You can override this behavior to implement a more complex loading logic.

You can access this configuration either via the config_ variable

Reimplemented from mc_control::fsm::State.

◆ copHeight()

double mc_control::fsm::StabilizerStandingState::copHeight ( ) const
protected

CoP height from contacts.

  • double support: average of both contact heights
  • single support: contact height

◆ run()

bool mc_control::fsm::StabilizerStandingState::run ( Controller ctl)
overridevirtual

Called every iteration until it returns true

Implements mc_control::fsm::State.

◆ start()

void mc_control::fsm::StabilizerStandingState::start ( Controller ctl)
overridevirtual

Called before the state starts being run

This will be called only once with the state fully configured.

Implements mc_control::fsm::State.

◆ targetCoM()

void mc_control::fsm::StabilizerStandingState::targetCoM ( const Eigen::Vector3d &  com)
protected

Freely target a CoM position. The corresponding CoP position will be computed as the projection of the CoM at the average height of both feet contacts.

Note
Caution, this function does not check the feasibility of the provided CoM
Parameters
comDesired CoM position

◆ targetCoP()

void mc_control::fsm::StabilizerStandingState::targetCoP ( const Eigen::Vector3d &  cop)
protected

Targets a given Cop. The CoM height will be automatically set at comHeight_ above this CoP. The default CoM height is that of the stabilizer's configuration, and can be overriden from configuration through "comHeight: 0.8" entry.

Parameters
copDesired CoP

◆ teardown()

void mc_control::fsm::StabilizerStandingState::teardown ( Controller ctl)
overridevirtual

Called right before destruction

Implements mc_control::fsm::State.

Member Data Documentation

◆ anchorFrameFunction_

std::string mc_control::fsm::StabilizerStandingState::anchorFrameFunction_ = ""
protected

◆ comHeight_

double mc_control::fsm::StabilizerStandingState::comHeight_ = 0
protected

Desired height of the CoM above the CoP target

◆ comTarget_

Eigen::Vector3d mc_control::fsm::StabilizerStandingState::comTarget_ = Eigen::Vector3d::Zero()
protected

World target for the CoM

◆ config_

mc_rtc::Configuration mc_control::fsm::StabilizerStandingState::config_
protected

Full state configuration

◆ copTarget_

Eigen::Vector3d mc_control::fsm::StabilizerStandingState::copTarget_ = Eigen::Vector3d::Zero()
protected

World target for the CoP

◆ D_

double mc_control::fsm::StabilizerStandingState::D_ = 0.
protected

CoM tracking damping

◆ dcmThreshold_

Eigen::Vector3d mc_control::fsm::StabilizerStandingState::dcmThreshold_ = Eigen::Vector3d{0.01, 0.01, 0.01}
protected

Completion criteria threshold

◆ hasCompletion_

bool mc_control::fsm::StabilizerStandingState::hasCompletion_ = false
protected

If the latest definition of the state configuration has an empty "completion" element, no completion rule will be used

◆ K_

double mc_control::fsm::StabilizerStandingState::K_ = 5
protected

LIPM Pendulum model CoM tracking stiffness (set-point)

◆ optionalGUI_

bool mc_control::fsm::StabilizerStandingState::optionalGUI_ = true
protected

Controls whether optional GUI elements are displayed

◆ ownsAnchorFrameCallback_

bool mc_control::fsm::StabilizerStandingState::ownsAnchorFrameCallback_
protected
Initial value:
=
false

◆ pendulum_

mc_planning::Pendulum mc_control::fsm::StabilizerStandingState::pendulum_
protected

◆ robot_

std::string mc_control::fsm::StabilizerStandingState::robot_ = ""
protected

◆ stabilizerTask_

std::shared_ptr<mc_tasks::lipm_stabilizer::StabilizerTask> mc_control::fsm::StabilizerStandingState::stabilizerTask_ = nullptr
protected

The documentation for this struct was generated from the following file: