22 #include "MAWalkSwingForward.hpp" 24 #include "types/MAComplexIndicators.hpp" 25 #include "types/MARobotState.hpp" 26 #include "controllers/MALegController.hpp" 27 #include "MAWalkBalanceToLeft.hpp" 28 #include "MAWalkBalanceToRight.hpp" 29 #include "MAWalkPushBackward.hpp" 31 MAWalkSwingForward::MAWalkSwingForward(MA::Leg::LegTypes leg_type) :
35 if (!AnyLegSwingForward())
37 float WalkPeriodQuarter = (float)MA::RobotState->ComplexIndicators->WalkPeriod / 11.0;
39 if (leg_type == MA::Leg::RF)
41 if (leg_type == MA::Leg::RH)
43 if (leg_type == MA::Leg::LF)
45 if (leg_type == MA::Leg::LH)
81 bool MAWalkSwingForward::AnyLegSwingForward()
Balances the body to left.
MA::DesiredConnectionMap DesiredConnections
Desired connection map to other behaviors.
MALegController * Controller
Leg controller.
virtual void ActivatingActions() override
Perform actions when the behavior is being activated.
Base behavior for leg movement primitives during walk.
void SetSelfActivationDuration(const int new_duration)
Set the self-activation duration.
MA::Leg::LegTypes Type
The leg type.
StateType GetState() const
Get the behavior state.
#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.
const MALeg & LegState
Leg state.
MABehavior * GetMaster()
Get the master behavior.
static MABehavior * GetBehavior(const std::string &type_name)
Get an existing behavior by type name.
void StartTransition(MAController &controller, const std::string &transition_name)
Start a transition.
Balances the body to Right.
virtual MABehavior::StimulusLevelType GetCurrentStimulus() override
Get the current behavior stimulus.