22 #include "MAHeavyCalculations.hpp" 24 #include "types/MARobotState.hpp" 25 #include "types/MAGoals.hpp" 26 #include "types/MAHead.hpp" 27 #include "types/MALeg.hpp" 28 #include "controllers/MAHeadController.hpp" 29 #include "controllers/MALedsController.hpp" 30 #include "controllers/MALegController.hpp" 31 #include "ml/MADataCollector.hpp" 32 #include "MABehaviorManager.hpp" 33 #include "MABodyLyingBored.hpp" 34 #include "MABodySittingBored.hpp" 35 #include "MABodyStandingBored.hpp" 36 #include "MAMouthSpeaking.hpp" 37 #include "MAMouthSpeakingMaster.hpp" 40 #include <MCTimer.hpp> 55 bool CalculationNeeded =
true;
57 CalculationNeeded = CalculationNeeded && MA::DataCollector->IsAnyJobFinished();
58 CalculationNeeded = CalculationNeeded && !MA::DataCollector->AreAllFinishedJobsCompressed();
60 if (!CalculationNeeded)
69 ReadyBody += !MA::Head->IsAnyActiveTransition() && !MA::LegLF->IsAnyActiveTransition() &&
70 !MA::LegLH->IsAnyActiveTransition() && !MA::LegRF->IsAnyActiveTransition() &&
71 !MA::LegRH->IsAnyActiveTransition();
74 if (ReadyBody == 3 && MA::RobotState->Goals->ArousalFeedbackNeeded == 0)
84 return MA::DataCollector->AreAllFinishedJobsCompressed();
96 MA::Leds->StartTransition(MA::Leds->FadeOutCrownWhiteStr);
104 MA::BehaviorManager->HibernateSystem();
105 MA::DataCollector->CompressAllFinishedJobs();
106 MA::BehaviorManager->ResumeSystem();
#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.
Body standing bored behavior.
int GetElapsedActivatedStateTime() const
Get the elapsed activated state time.
MA::DesiredConnectionMap DesiredConnections
Desired connection map to other behaviors.
Body sitting bored behavior.
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.
#define MABEHAVIOR_IS_ACTIVATED(_behavior)
Check if a behavior exists and it is in activated state.
virtual void ActivatingActions() override
Perform actions when the behavior is being activated.
Mouth speaking master behavior.
virtual MABehavior::StimulusLevelType GetCurrentStimulus() override
Get the current behavior stimulus.
void StartTransition(MAController &controller, const std::string &transition_name)
Start a transition.
virtual bool IsFinished() override
Whether the behavior is finished.
Body lying bored behavior.
virtual void FinishingActions() override
Perform actions when the behavior is being finished.
virtual void ActivatedStateUpdate() override
Perform actions when the behavior is in activated state.