lipm_walking_controller
1.6.0
|
Main controller class. More...
#include <lipm_walking/Controller.h>
Public Member Functions | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | Controller (std::shared_ptr< mc_rbdyn::RobotModule > robot, double dt, const mc_rtc::Configuration &config) |
Initialize the controller. More... | |
void | reset (const mc_control::ControllerResetData &data) override |
Reset controller. More... | |
void | addGUIElements (std::shared_ptr< mc_rtc::gui::StateBuilder > gui) |
Add GUI panel. More... | |
void | addGUIMarkers (std::shared_ptr< mc_rtc::gui::StateBuilder > gui) |
Add GUI markers. More... | |
void | addLogEntries (mc_rtc::Logger &logger) |
Log controller entries. More... | |
void | internalReset () |
Reset robot to its initial (half-sitting) configuration. More... | |
void | leftFootRatio (double ratio) |
Set fraction of total weight that should be sustained by the left foot. More... | |
void | loadFootstepPlan (std::string name) |
Load footstep plan from configuration. More... | |
void | pauseWalkingCallback (bool verbose=false) |
Callback function called by "Pause walking" button. More... | |
virtual bool | run () override |
Main function of the controller, called at every control cycle. More... | |
void | startLogSegment (const std::string &label) |
Start new log segment. More... | |
void | stopLogSegment () |
Stop current log segment. More... | |
bool | updatePreview () |
Update horizontal MPC preview. More... | |
void | updateRealFromKinematics () |
Update measured robot's floating base from kinematic observer. More... | |
void | warnIfRobotIsInTheAir () |
Log a warning message when robot is in the air. More... | |
mc_rbdyn::Robot & | controlRobot () |
Get control robot state. More... | |
double | doubleSupportDuration () |
Get next double support duration. More... | |
bool | isLastDSP () |
True after the last step. More... | |
bool | isLastSSP () |
True during the last step. More... | |
double | leftFootRatio () |
Get fraction of total weight that should be sustained by the left foot. More... | |
double | measuredLeftFootRatio () |
Estimate left foot pressure ratio from force sensors. More... | |
ModelPredictiveControl & | mpc () |
Get model predictive control solver. More... | |
const Contact & | nextContact () const |
Get next contact in plan. More... | |
void | nextDoubleSupportDuration (double duration) |
Override next DSP duration. More... | |
Pendulum & | pendulum () |
This getter is only used for consistency with the rest of mc_rtc. More... | |
const Contact & | prevContact () const |
Get previous contact in plan. More... | |
mc_rbdyn::Robot & | realRobot () |
Get observed robot state. More... | |
double | singleSupportDuration () |
Get next SSP duration. More... | |
const Sole & | sole () const |
Get model sole properties. More... | |
Stabilizer & | stabilizer () |
This getter is only used for consistency with the rest of mc_rtc. More... | |
const Contact & | supportContact () |
Get current support contact. More... | |
const Contact & | targetContact () |
Get current target contact. More... | |
Public Attributes | |
FootstepPlan | plan |
Current footstep plan. More... | |
PlanInterpolator | planInterpolator |
Footstep plan interpolator. More... | |
bool | emergencyStop = false |
Emergency flag: if on, the controller stops doing anything. More... | |
bool | pauseWalking = false |
Is the pause-walking behavior engaged? More... | |
bool | pauseWalkingRequested = false |
Has user clicked on the "Pause walking" button? More... | |
std::shared_ptr< Preview > | preview |
Current solution trajectory from the walking pattern generator. More... | |
std::shared_ptr< mc_tasks::OrientationTask > | pelvisTask |
Pelvis orientation task. More... | |
std::shared_ptr< mc_tasks::OrientationTask > | torsoTask |
Torso orientation task. More... | |
std::vector< std::vector< double > > | halfSitPose |
Half-sit joint-angle configuration stored when the controller starts. More... | |
Main controller class.
Definition at line 67 of file Controller.h.
lipm_walking::Controller::Controller | ( | std::shared_ptr< mc_rbdyn::RobotModule > | robot, |
double | dt, | ||
const mc_rtc::Configuration & | config | ||
) |
Initialize the controller.
robot | Robot model. |
dt | Control timestep. |
config | Configuration dictionary. |
Definition at line 36 of file Controller.cpp.
void lipm_walking::Controller::addGUIElements | ( | std::shared_ptr< mc_rtc::gui::StateBuilder > | gui | ) |
void lipm_walking::Controller::addGUIMarkers | ( | std::shared_ptr< mc_rtc::gui::StateBuilder > | gui | ) |
Add GUI markers.
gui | GUI handle. |
void lipm_walking::Controller::addLogEntries | ( | mc_rtc::Logger & | logger | ) |
|
inline |
Get control robot state.
Definition at line 175 of file Controller.h.
|
inline |
Get next double support duration.
Definition at line 183 of file Controller.h.
void lipm_walking::Controller::internalReset | ( | ) |
Reset robot to its initial (half-sitting) configuration.
The reason why I do it inside the controller rather than via the current mc_rtc way (switching to half_sitting controller then back to this one) is https://gite.lirmm.fr/multi-contact/mc_rtc/issues/54.
Definition at line 358 of file Controller.cpp.
|
inline |
True after the last step.
Definition at line 201 of file Controller.h.
|
inline |
True during the last step.
Definition at line 209 of file Controller.h.
void lipm_walking::Controller::leftFootRatio | ( | double | ratio | ) |
Set fraction of total weight that should be sustained by the left foot.
ratio | Number between 0 and 1. |
Definition at line 400 of file Controller.cpp.
|
inline |
Get fraction of total weight that should be sustained by the left foot.
Definition at line 217 of file Controller.h.
void lipm_walking::Controller::loadFootstepPlan | ( | std::string | name | ) |
Load footstep plan from configuration.
name | Plan name. |
Definition at line 525 of file Controller.cpp.
|
inline |
Estimate left foot pressure ratio from force sensors.
Definition at line 225 of file Controller.h.
|
inline |
Get model predictive control solver.
Definition at line 237 of file Controller.h.
|
inline |
Get next contact in plan.
Definition at line 245 of file Controller.h.
|
inline |
Override next DSP duration.
duration | Custom DSP duration. |
Definition at line 255 of file Controller.h.
void lipm_walking::Controller::pauseWalkingCallback | ( | bool | verbose = false | ) |
Callback function called by "Pause walking" button.
verbose | Talk to user on the command line. |
Definition at line 455 of file Controller.cpp.
|
inline |
This getter is only used for consistency with the rest of mc_rtc.
Definition at line 263 of file Controller.h.
|
inline |
Get previous contact in plan.
Definition at line 271 of file Controller.h.
|
inline |
Get observed robot state.
Definition at line 279 of file Controller.h.
|
override |
|
overridevirtual |
Main function of the controller, called at every control cycle.
Definition at line 411 of file Controller.cpp.
|
inline |
Get next SSP duration.
Definition at line 287 of file Controller.h.
|
inline |
Get model sole properties.
Definition at line 295 of file Controller.h.
|
inline |
This getter is only used for consistency with the rest of mc_rtc.
Definition at line 303 of file Controller.h.
void lipm_walking::Controller::startLogSegment | ( | const std::string & | label | ) |
Start new log segment.
label | Segment label. |
Definition at line 558 of file Controller.cpp.
void lipm_walking::Controller::stopLogSegment | ( | ) |
Stop current log segment.
Definition at line 568 of file Controller.cpp.
|
inline |
Get current support contact.
Definition at line 311 of file Controller.h.
|
inline |
Get current target contact.
Definition at line 319 of file Controller.h.
bool lipm_walking::Controller::updatePreview | ( | ) |
Update horizontal MPC preview.
Definition at line 574 of file Controller.cpp.
void lipm_walking::Controller::updateRealFromKinematics | ( | ) |
Update measured robot's floating base from kinematic observer.
Definition at line 509 of file Controller.cpp.
void lipm_walking::Controller::warnIfRobotIsInTheAir | ( | ) |
Log a warning message when robot is in the air.
Definition at line 485 of file Controller.cpp.
bool lipm_walking::Controller::emergencyStop = false |
Emergency flag: if on, the controller stops doing anything.
Definition at line 327 of file Controller.h.
std::vector<std::vector<double> > lipm_walking::Controller::halfSitPose |
Half-sit joint-angle configuration stored when the controller starts.
Definition at line 334 of file Controller.h.
bool lipm_walking::Controller::pauseWalking = false |
Is the pause-walking behavior engaged?
Definition at line 328 of file Controller.h.
bool lipm_walking::Controller::pauseWalkingRequested = false |
Has user clicked on the "Pause walking" button?
Definition at line 329 of file Controller.h.
std::shared_ptr<mc_tasks::OrientationTask> lipm_walking::Controller::pelvisTask |
Pelvis orientation task.
Definition at line 331 of file Controller.h.
FootstepPlan lipm_walking::Controller::plan |
Current footstep plan.
Definition at line 325 of file Controller.h.
PlanInterpolator lipm_walking::Controller::planInterpolator |
Footstep plan interpolator.
Definition at line 326 of file Controller.h.
std::shared_ptr<Preview> lipm_walking::Controller::preview |
Current solution trajectory from the walking pattern generator.
Definition at line 330 of file Controller.h.
std::shared_ptr<mc_tasks::OrientationTask> lipm_walking::Controller::torsoTask |
Torso orientation task.
Definition at line 332 of file Controller.h.