22 #include "MAWaitFloorFeedback.hpp" 24 #include "types/MABodyMotion.hpp" 25 #include "types/MAComplexIndicators.hpp" 26 #include "types/MAGoals.hpp" 27 #include "types/MARobotState.hpp" 28 #include "ml/MAClassifierModels.hpp" 29 #include "ml/MADataCollector.hpp" 30 #include "MABehaviorManager.hpp" 31 #include "MABodyStandingBored.hpp" 32 #include "MAWalkInitialPosition.hpp" 38 RegisterUpdater(*
this);
54 MA::RobotState->Goals->DesiredForwardWalkDuration > 2000;
60 return (
int)MA::RobotState->BodyMotion->Floor.OwnerFeedback >= 0;
68 DataCollectionStopped =
true;
69 MA::DataCollector->StopActiveJobToCollectAType(MA::FloorSurfaceModelID,
"RobotState");
70 MA::DataCollector->StopActiveJobToCollectAType(MA::FloorSurfaceModelID,
"LogMessage");
79 if ((
int)Floor.OwnerFeedback == (
int)MA::WoodFlooring)
80 MC_LOG(
"Owner feedback arrived: wood flooring");
81 if ((
int)Floor.OwnerFeedback == (
int)MA::Field)
82 MC_LOG(
"Owner feedback arrived: field");
83 if ((
int)Floor.OwnerFeedback == (
int)MA::Carpet)
84 MC_LOG(
"Owner feedback arrived: carpet");
85 if ((
int)Floor.OwnerFeedback == (
int)MA::FoamMat)
86 MC_LOG(
"Owner feedback arrived: foam mat");
87 if ((
int)Floor.OwnerFeedback == (
int)MA::Vinyl)
88 MC_LOG(
"Owner feedback arrived: vinyl");
89 if ((
int)Floor.OwnerFeedback == (
int)MA::Tiles)
90 MC_LOG(
"Owner feedback arrived: tiles");
91 if ((
int)Floor.OwnerFeedback == (
int)MA::CarpetedFloor)
92 MC_LOG(
"Owner feedback arrived: carpeted floor");
93 if ((
int)Floor.OwnerFeedback == (
int)MA::UserDefinedFloor)
94 MC_LOG(
"Owner feedback arrived: user defined");
98 if ((MA::RobotState->ComplexIndicators->IsStandingPosture > 0 ||
101 MA::RobotState->Goals->StandPostureDesire = 1;
102 MA::RobotState->Goals->ArousalFeedbackNeeded = MA::RobotState->Goals->ArousalFeedbackNeeded.GetMax();
109 if (unlikely(!Initialized))
virtual void ActivatedStateUpdate() override
Perform actions when the behavior is in activated state.
virtual void FinishingActions() override
Perform actions when the behavior is being finished.
virtual bool IsFailed() override
Whether the behavior is failed.
#define MABEHAVIOR_EXISTS(_behavior)
Check if a behavior exists.
Body standing bored behavior.
int GetElapsedActivatedStateTime() const
Get the elapsed activated state time.
virtual void UpdateRobotState(MARobotState &state) override
Update the robot state.
void SetActivatedStateExpirationTime(const unsigned int expiration_time)
Set the activated state expiration time.
std::string MCGetClassName(T *instance=nullptr, const std::string &name_suffix="")
Get a class name.
Initial balance of the body before walk.
virtual bool IsFinished() override
Whether the behavior is finished.
#define MABEHAVIOR_IS_ACTIVATED(_behavior)
Check if a behavior exists and it is in activated state.
boost::scoped_ptr< MABodyMotion > BodyMotion
Body motion.
Robot state updater base class.
virtual MABehavior::StimulusLevelType GetCurrentStimulus() override
Get the current behavior stimulus.
#define MC_LOG(...)
Debug macro.