22 #include "MAHeadLookAround.hpp" 24 #include "types/MABodyMotion.hpp" 25 #include "types/MAComplexIndicators.hpp" 26 #include "types/MAEmotions.hpp" 27 #include "types/MAGoals.hpp" 28 #include "types/MAHead.hpp" 29 #include "types/MARobotState.hpp" 30 #include "controllers/MAHeadController.hpp" 31 #include "MABodyStroked.hpp" 32 #include "MAHeadTurnAhead.hpp" 33 #include "MAMotorOverload.hpp" 34 #include "MASkitterPlaybackExecute.hpp" 47 if (MA::RobotState->Head->SleptAwaken > 80 &&
48 (MA::RobotState->BodyMotion->Lying > 80 || MA::RobotState->BodyMotion->Sitting > 80 ||
49 MA::RobotState->BodyMotion->OnStation || MA::RobotState->ComplexIndicators->IsStandingPosture))
61 Ret = Ret && (MA::RobotState->BodyMotion->Lying < 60 && MA::RobotState->BodyMotion->Sitting < 60);
62 Ret = Ret && !MA::RobotState->BodyMotion->OnStation;
63 Ret = Ret && !MA::RobotState->ComplexIndicators->IsStandingPosture;
64 Ret = Ret || MA::RobotState->Head->SleptAwaken == 0;
65 Ret = Ret || MA::RobotState->Goals->TurnHeadToLeft != 0;
66 Ret = Ret || MA::RobotState->Goals->TurnHeadToRight != 0;
73 if (MA::RobotState->BodyMotion->Lying > 80 || MA::RobotState->ComplexIndicators->IsStandingPosture ||
74 MA::RobotState->BodyMotion->OnStation)
78 if (MA::RobotState->BodyMotion->Sitting > 80)
81 MAMotorOverload::CreateBehaviorForMotors(MA::Head->GetMotors(),
nullptr);
92 MACreateBehavior<MAHeadLookAround>(
GetMaster());
94 MAMotorOverload::DeleteBehaviorForMotors(MA::Head->GetMotors());
#define MABEHAVIOR_IS_NORMAL(_behavior)
Check if a behavior exists and it is in normal state.
#define MABEHAVIOR_EXISTS(_behavior)
Check if a behavior exists.
MA::DesiredConnectionMap DesiredConnections
Desired connection map to other behaviors.
Skitter playback execution behavior.
void SetLifetimeExpirationTime(const unsigned int expiration_time)
Set the lifetime expiration time.
std::string MCGetClassName(T *instance=nullptr, const std::string &name_suffix="")
Get a class name.
virtual bool IsFailed() override
Whether the behavior is failed.
MABehavior * GetMaster()
Get the master behavior.
virtual MABehavior::StimulusLevelType GetCurrentStimulus() override
Get the current behavior stimulus.
virtual void ActivatingActions() override
Perform actions when the behavior is being activated.
void StartTransition(MAController &controller, const std::string &transition_name)
Start a transition.
virtual void FinishingActions() override
Perform actions when the behavior is being finished.