2024-09-10 22:30:30 +08:00
|
|
|
//
|
|
|
|
// Created by biao on 24-9-10.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include <unitree_guide_controller/FSM/StateFixedStand.h>
|
|
|
|
|
|
|
|
StateFixedStand::StateFixedStand(CtrlComponent ctrlComp): FSMState(
|
|
|
|
FSMStateName::FIXEDSTAND, "fixed stand", std::move(ctrlComp)) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void StateFixedStand::enter() {
|
2024-09-11 14:01:07 +08:00
|
|
|
for (int i = 0; i < 12; i++) {
|
|
|
|
ctrlComp_.joint_position_command_interface_[i].get().set_value(start_pos_[i]);
|
|
|
|
}
|
2024-09-10 22:30:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void StateFixedStand::run() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void StateFixedStand::exit() {
|
|
|
|
}
|
|
|
|
|
|
|
|
FSMStateName StateFixedStand::checkChange() {
|
2024-09-11 14:01:07 +08:00
|
|
|
if (ctrlComp_.control_inputs_.get().command == 1) {
|
|
|
|
return FSMStateName::PASSIVE;
|
|
|
|
}
|
2024-09-10 22:30:30 +08:00
|
|
|
return FSMStateName::FIXEDSTAND;
|
|
|
|
}
|