37 postureTaskIsActive_ =
true;
38 postureTaskWasActive_ =
true;
39 startStandingButton_ =
false;
40 startStanding_ =
false;
44 logger().addLogEntry(
"walking_phase", []() {
return -2.; });
48 gui()->removeElement({
"Walking",
"Main"},
"Pause walking");
56 logger().removeLogEntry(
"walking_phase");
67 postureTaskIsActive_ = (ctl.postureTask->speed().norm() > 1e-2);
68 if(postureTaskIsActive_)
71 postureTaskWasActive_ =
true;
73 else if(postureTaskWasActive_)
76 postureTaskWasActive_ =
false;
86 if(startStanding_ && !postureTaskIsActive_)
96 if(!startStandingButton_ &&
gui())
98 using namespace mc_rtc::gui;
99 gui()->addElement({
"Walking",
"Main"}, Button(
"Start standing", [
this]() { startStanding_ =
true; }));
100 startStandingButton_ =
true;
106 if(startStandingButton_ &&
gui())
108 gui()->removeElement({
"Walking",
"Main"},
"Start standing");
109 startStandingButton_ =
false;
void start() override
Start state.
void runState() override
Main state function, called if no transition at this cycle.
std::shared_ptr< mc_rtc::gui::StateBuilder > gui()
Get GUI handle.
void hideStartStandingButton()
Remove "Start standing" transition button from GUI.
mc_rtc::Logger & logger()
Get logger.
void teardown() override
Teardown state.
void showStartStandingButton()
Add "Start standing" transition button to GUI.
Main controller namespace.
bool checkTransitions() override
Check transitions at beginning of control cycle.
Controller & controller()
Get controller.
Hold posture and check contacts.