StabilizerStandingState.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2019 CNRS-UM LIRMM, CNRS-AIST JRL
3  */
4 
5 #pragma once
6 
7 #include <mc_control/fsm/State.h>
8 #include <mc_planning/Pendulum.h>
10 
11 namespace mc_tasks
12 {
13 namespace lipm_stabilizer
14 {
15 struct StabilizerTask;
16 }
17 } // namespace mc_tasks
18 
19 namespace mc_control
20 {
21 namespace fsm
22 {
23 
40 {
41  void configure(const mc_rtc::Configuration & config) override;
42 
43  void start(Controller &) override;
44 
45  bool run(Controller &) override;
46 
47  void teardown(Controller &) override;
48 
49 protected:
58  void targetCoP(const Eigen::Vector3d & cop);
59 
70  void targetCoM(const Eigen::Vector3d & com);
71 
77  double copHeight() const;
78 
79 protected:
80  std::shared_ptr<mc_tasks::lipm_stabilizer::StabilizerTask> stabilizerTask_ = nullptr;
82  bool hasCompletion_ = false;
85  Eigen::Vector3d dcmThreshold_ = Eigen::Vector3d{0.01, 0.01, 0.01};
89  double K_ = 5;
90  double D_ = 0.;
92  double comHeight_ = 0;
93  Eigen::Vector3d comTarget_ = Eigen::Vector3d::Zero();
94  Eigen::Vector3d copTarget_ = Eigen::Vector3d::Zero();
96  bool optionalGUI_ = true;
98  std::string robot_ = "";
99  std::string anchorFrameFunction_ = "";
101  false;
102 };
103 
104 } // namespace fsm
105 } // namespace mc_control
mc_control::fsm::StabilizerStandingState::comTarget_
Eigen::Vector3d comTarget_
Definition: StabilizerStandingState.h:93
mc_rtc::Configuration
Simplify access to values hold within a JSON file.
Definition: Configuration.h:165
mc_control::fsm::StabilizerStandingState::comHeight_
double comHeight_
Definition: StabilizerStandingState.h:92
mc_control::fsm::StabilizerStandingState::stabilizerTask_
std::shared_ptr< mc_tasks::lipm_stabilizer::StabilizerTask > stabilizerTask_
Definition: StabilizerStandingState.h:80
mc_control::fsm::StabilizerStandingState::K_
double K_
Definition: StabilizerStandingState.h:89
mc_control::fsm::StabilizerStandingState::ownsAnchorFrameCallback_
bool ownsAnchorFrameCallback_
Definition: StabilizerStandingState.h:100
Contact.h
mc_control::fsm::StabilizerStandingState::dcmThreshold_
Eigen::Vector3d dcmThreshold_
Definition: StabilizerStandingState.h:85
mc_control::fsm::StabilizerStandingState::anchorFrameFunction_
std::string anchorFrameFunction_
Definition: StabilizerStandingState.h:99
Pendulum.h
mc_planning::Pendulum
Definition: Pendulum.h:17
mc_control::fsm::StabilizerStandingState::config_
mc_rtc::Configuration config_
Definition: StabilizerStandingState.h:81
mc_control::fsm::StabilizerStandingState::hasCompletion_
bool hasCompletion_
Definition: StabilizerStandingState.h:82
mc_control::fsm::StabilizerStandingState
Simple state to control and stabilize the CoM of a biped-like robot using the LIPMStabilizer.
Definition: StabilizerStandingState.h:39
mc_control::fsm::StabilizerStandingState::targetCoM
void targetCoM(const Eigen::Vector3d &com)
Freely target a CoM position. The corresponding CoP position will be computed as the projection of th...
mc_tasks::lipm_stabilizer::StabilizerTask
Definition: StabilizerTask.h:56
mc_control::fsm::StabilizerStandingState::start
void start(Controller &) override
mc_control::fsm::State
Definition: State.h:58
mc_control::fsm::StabilizerStandingState::teardown
void teardown(Controller &) override
mc_control::fsm::StabilizerStandingState::run
bool run(Controller &) override
mc_control::fsm::StabilizerStandingState::robot_
std::string robot_
Definition: StabilizerStandingState.h:98
mc_control::fsm::StabilizerStandingState::copTarget_
Eigen::Vector3d copTarget_
Definition: StabilizerStandingState.h:94
mc_control::fsm::StabilizerStandingState::pendulum_
mc_planning::Pendulum pendulum_
Definition: StabilizerStandingState.h:87
mc_control::fsm::StabilizerStandingState::D_
double D_
Definition: StabilizerStandingState.h:90
mc_control::fsm::StabilizerStandingState::optionalGUI_
bool optionalGUI_
Definition: StabilizerStandingState.h:96
mc_control
Definition: CompletionCriteria.h:10
State.h
mc_control::fsm::StabilizerStandingState::targetCoP
void targetCoP(const Eigen::Vector3d &cop)
Targets a given Cop. The CoM height will be automatically set at comHeight_ above this CoP....
mc_tasks
Definition: StabilizerStandingState.h:11
mc_control::fsm::StabilizerStandingState::copHeight
double copHeight() const
CoP height from contacts.
mc_control::fsm::Controller
Definition: Controller.h:49
mc_control::fsm::StabilizerStandingState::configure
void configure(const mc_rtc::Configuration &config) override