22 #include "MABodySitting.hpp" 24 #include "core/MARandomness.hpp" 25 #include "types/MABodyMotion.hpp" 26 #include "types/MAComplexIndicators.hpp" 27 #include "types/MAGoals.hpp" 28 #include "types/MARobotState.hpp" 29 #include "controllers/MALegController.hpp" 30 #include "MABodySittingBored.hpp" 31 #include "MALegSittingPosition.hpp" 32 #include "MALegMoveAway.hpp" 33 #include "MALegMoved.hpp" 34 #include "MASittingFreefall.hpp" 35 #include "MATailToBack.hpp" 36 #include "MATypeRanges.hpp" 46 if (MA::RobotState->BodyMotion->Sitting > 80)
56 return MA::RobotState->ComplexIndicators->OverloadDangerWhileSitting > 50;
62 if (!MA::RobotState->ComplexIndicators->IsSittingPosture)
80 if (!MA::RobotState->LegLH->Moving)
81 MA::LegLH->SetPower(
false);
82 if (!MA::RobotState->LegRH->Moving)
83 MA::LegRH->SetPower(
false);
87 MALEGBEHAVIOR_CREATE(
MALegMoved, MA::Leg::LH,
this);
88 MALEGBEHAVIOR_CREATE(
MALegMoved, MA::Leg::RH,
this);
95 MC_LOG(
"Overload danger in the front legs while sitting.");
96 if (MA::RobotState->ComplexIndicators->IsSittingPosture &&
97 !MA::RobotState->LegLF->Moving && !MA::RobotState->LegRF->Moving &&
98 !MA::RobotState->LegLH->Moving && !MA::RobotState->LegRH->Moving)
101 MA::RobotState->Goals->LiePostureDesire = 1;
virtual MABehavior::StimulusLevelType GetCurrentStimulus() override
Get the current behavior stimulus.
virtual void ActivatingActions() override
Perform actions when the behavior is being activated.
Move the tail to the back behavior.
Moves the leg to sitting position.
Body sitting bored behavior.
Moves the leg away from the body.
#define MABEHAVIOR_CREATE(_behavior, _master,...)
Create behaviors with custom constructor safely.
std::string MCGetClassName(T *instance=nullptr, const std::string &name_suffix="")
Get a class name.
Freefall in sitting posture.
virtual void FailingActions() override
Perform actions when the behavior is being failed.
The leg is being moved on its own.
virtual bool IsFailed() override
Whether the behavior is failed.
#define MC_LOG(...)
Debug macro.