22 #include "MALegLyingPosition.hpp" 24 #include "types/MABodyMotion.hpp" 25 #include "types/MARobotState.hpp" 26 #include "controllers/MALegController.hpp" 27 #include "MALegMoveAway.hpp" 28 #include "MALegMoved.hpp" 29 #include "MAMotorOverload.hpp" 31 MALegLyingPosition::MALegLyingPosition(MA::Leg::LegTypes leg_type) :
42 if (MA::RobotState->BodyMotion->Lying > 80 && !Controller->IsLyingPosition() &&
43 !MALEGBEHAVIOR_IS_ACTIVATED(
MALegMoved, Controller->GetLegType()))
55 if (Controller->IsBack())
60 if ((LegState.Type == MA::Leg::LH && LegState.IsForwardNearBody() &&
61 MA::RobotState->LegLF->IsBackwardNearBody()) ||
62 (LegState.Type == MA::Leg::RH && LegState.IsForwardNearBody() &&
63 MA::RobotState->LegRF->IsBackwardNearBody()))
87 Controller->SetPower(
false);
Base class for leg behaviors.
Moves the leg away from the body.
virtual void FailingActions() override
Perform actions when the behavior is being failed.
void SetSelfActivationDuration(const int new_duration)
Set the self-activation duration.
std::string MCGetClassName(T *instance=nullptr, const std::string &name_suffix="")
Get a class name.
virtual void FinishingActions() override
Perform actions when the behavior is being finished.
MABehavior * GetMaster()
Get the master behavior.
void StartTransition(MAController &controller, const std::string &transition_name)
Start a transition.
virtual void ActivatingActions() override
Perform actions when the behavior is being activated.
virtual MABehavior::StimulusLevelType GetCurrentStimulus() override
Get the current behavior stimulus.
virtual bool IsFailed() override
Whether the behavior is failed.
The leg is being moved on its own.