22 #include "MALookForAbyss.hpp" 24 #include "types/MABodyMotion.hpp" 25 #include "types/MAComplexIndicators.hpp" 26 #include "types/MARobotState.hpp" 27 #include "types/MATorso.hpp" 28 #include "controllers/MAHeadController.hpp" 29 #include "controllers/MALegController.hpp" 30 #include "MAAbyssHeadShake.hpp" 31 #include "MABodyStroked.hpp" 32 #include "MAHeadLookAround.hpp" 33 #include "MAHeadTurnAhead.hpp" 34 #include "MAHeadTurnAround.hpp" 35 #include "MAHeadTurnMaster.hpp" 36 #include "MAMotorOverload.hpp" 52 if (!MA::LegLF->IsAnyActiveTransition() && !MA::LegLH->IsAnyActiveTransition() &&
53 !MA::LegRF->IsAnyActiveTransition() && !MA::LegRH->IsAnyActiveTransition())
72 MAMotorOverload::CreateBehaviorForMotors(MA::Head->GetMotors(),
nullptr);
78 if (MA::RobotState->BodyMotion->Lying > 80 && MA::RobotState->BodyMotion->Flying < 20)
80 MA::RobotState->ComplexIndicators->AbyssWhileLying = 1;
81 MC_LOG(
"Abyss detected before the dog");
83 MAMotorOverload::DeleteBehaviorForMotors(MA::Head->GetMotors());
91 if (MA::RobotState->BodyMotion->Lying > 80 && MA::RobotState->BodyMotion->Flying < 20)
93 MA::RobotState->ComplexIndicators->AbyssWhileLying = 0;
94 MC_LOG(
"There is no abyss before the dog");
96 MAMotorOverload::DeleteBehaviorForMotors(MA::Head->GetMotors());
Shaking the head when an abyss is detected before the dog.
int GetElapsedActivatedStateTime() const
Get the elapsed activated state time.
MA::DesiredConnectionMap DesiredConnections
Desired connection map to other behaviors.
virtual MABehavior::StimulusLevelType GetCurrentStimulus() override
Get the current behavior stimulus.
virtual bool IsFailed() override
Whether the behavior is failed.
void SetSelfActivationDuration(const int new_duration)
Set the self-activation duration.
#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.
virtual void ActivatingActions() override
Perform actions when the behavior is being activated.
virtual void FinishingActions() override
Perform actions when the behavior is being finished.
virtual void FailingActions() override
Perform actions when the behavior is being failed.
void StartTransition(MAController &controller, const std::string &transition_name)
Start a transition.
#define MC_LOG(...)
Debug macro.