22 #include "MABodyStandingBored.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 "MABodyLieDownFromStanding.hpp" 31 #include "MABodySitDownFromStanding.hpp" 32 #include "MABodyStroked.hpp" 33 #include "MABodyTurnLeft.hpp" 34 #include "MABodyTurnRight.hpp" 35 #include "MAGoodFloorTalk.hpp" 36 #include "MAHeadLookAround.hpp" 37 #include "MAHeadTurnAhead.hpp" 38 #include "MAHeavyCalculations.hpp" 39 #include "MASoftCarpetReaction.hpp" 40 #include "MAStandFunnySkitMaster.hpp" 41 #include "MAWalkMaster.hpp" 42 #include "MAWrongFloorSkit.hpp" 53 MA::RobotState->Goals->StandPostureDesire = 0;
63 if (MA::RobotState->ComplexIndicators->IsStandingPosture &&
64 !MA::LegLF->IsAnyActiveTransition() && !MA::LegLH->IsAnyActiveTransition() &&
65 !MA::LegRF->IsAnyActiveTransition() && !MA::LegRH->IsAnyActiveTransition() &&
68 if (MA::RobotState->Goals->LiePostureDesire != 0 ||
69 MA::RobotState->Goals->SitPostureDesire != 0 ||
70 MA::RobotState->Goals->DesiredLeftTurnDuration != 0 ||
71 MA::RobotState->Goals->DesiredRightTurnDuration != 0 ||
72 MA::RobotState->Goals->DesiredBackwardWalkDuration != 0 ||
73 MA::RobotState->Goals->DesiredForwardWalkDuration != 0 ||
74 MA::RobotState->BodyMotion->Floor.OwnerFeedback >= 0 ||
75 MA::RobotState->Goals->HappyOnCarpetFeedback != 0)
89 if (MA::RobotState->BodyMotion->Floor.OwnerFeedback >= 0)
91 if ((
int)MA::RobotState->BodyMotion->Floor.OwnerFeedback == (
int)MA::RobotState->BodyMotion->Floor.Surface)
97 ResetFloorOwnerFeedback =
true;
100 if (MA::RobotState->Goals->HappyOnCarpetFeedback == 1)
104 MA::RobotState->Goals->HappyOnCarpetFeedback = 0;
105 if (HappyReaction == 1)
112 if (MA::RobotState->Goals->DesiredLeftTurnDuration-
113 MA::RobotState->ComplexIndicators->ElapsedLeftTurnTime > 1000)
119 if (MA::RobotState->Goals->DesiredRightTurnDuration-
120 MA::RobotState->ComplexIndicators->ElapsedRightTurnTime > 1000)
126 if (MA::RobotState->Goals->DesiredForwardWalkDuration != 0 ||
127 MA::RobotState->Goals->DesiredBackwardWalkDuration != 0)
133 if (MA::RobotState->Goals->MotionControl == 1)
136 if (MA::RobotState->Goals->LiePostureDesire != 0)
141 if (MA::RobotState->Goals->SitPostureDesire != 0)
149 if (RandomFunnyAction == 1)
162 MA::RobotState->Goals->DesiredLeftTurnDuration = NewDuration;
172 MA::RobotState->Goals->DesiredRightTurnDuration = NewDuration;
182 if (NewAction >= 4 && NewAction <= 6)
199 if (unlikely(ResetFloorOwnerFeedback))
201 ResetFloorOwnerFeedback =
false;
virtual void ActivatingActions() override
Perform actions when the behavior is being activated.
#define MABEHAVIOR_IS_NORMAL(_behavior)
Check if a behavior exists and it is in normal state.
virtual MABehavior::StimulusLevelType GetCurrentStimulus() override
Get the current behavior stimulus.
#define MA_RANDOM_POINT_1(_variable_name, _min, _max)
Set a random point with one value.
#define MABEHAVIOR_DELETE(_behavior)
Delete a behavior safely (mark it dirty if exists)
The head looks around behavior.
Run heavy calculations during inactivity.
Indicate the floor surface recognition period.
Sad skit when the floor surface was recognized incorrectly.
Body sits down from standing behavior.
void SetSelfActivationDuration(const int new_duration)
Set the self-activation duration.
static void RegisterUpdater(MARobotStateUpdater &updater)
Register a robot state updater.
#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.
#define MABEHAVIOR_IS_ACTIVATED(_behavior)
Check if a behavior exists and it is in activated state.
Master behavior for a funny skit while standing.
Happy talk when the floor surface was recognized correctly.
boost::scoped_ptr< MABodyMotion > BodyMotion
Body motion.
Robot state updater base class.
Body lie down from standing behavior.
virtual void UpdateRobotState(MARobotState &state) override
Update the robot state.