30 #ifndef TOWR_VARIABLES_PHASE_NODES_H_ 31 #define TOWR_VARIABLES_PHASE_NODES_H_ 48 using Ptr = std::shared_ptr<PhaseNodes>;
62 PolyInfo(
int phase,
int poly_in_phase,
int n_polys_in_phase,
bool is_const);
74 PhaseNodes (
int phase_count,
bool in_contact_start,
const std::string& var_name,
75 int n_polys_in_changing_phase,
Type type);
162 static std::map<OptNodeIs, NodeIds>
Nodes that are associated to either swing or stance phases.
virtual bool IsInConstantPhase(int polynomial_id) const
Is the polynomial constant, so not changing the value.
virtual VecDurations ConvertPhaseToPolyDurations(const VecDurations &phase_durations) const
Converts durations of swing and stance phases to polynomial durations.
void SetBoundsEEMotion()
Sets the bounds on the node variables to model foot motions.
virtual ~PhaseNodes()=default
NodeIds GetIndicesOfNonConstantNodes() const
The indices of those nodes that don't belong to a constant phase.
static std::map< OptNodeIs, NodeIds > GetOptNodeToNodeMappings(const std::vector< PolyInfo > &)
std::map< OptNodeIs, NodeIds > optnode_to_node_
void SetBoundsEEForce()
Sets the bounds on the node variables to model foot forces.
int n_polys_in_phase_
the number of polynomials used for this phase.
virtual double GetDerivativeOfPolyDurationWrtPhaseDuration(int polynomial_id) const
How a change in the phase duration affects the polynomial duration.
Eigen::Vector3d GetValueAtStartOfPhase(int phase) const
virtual bool IsConstantNode(int node_id) const
node is constant if either left or right polynomial belongs to a constant phase.
std::vector< double > VecDurations
Holds semantic information each polynomial in spline.
std::vector< PolyInfo > polynomial_info_
int phase_
The phase ID this polynomial represents.
std::vector< int > NodeIds
PhaseNodes(int phase_count, bool in_contact_start, const std::string &var_name, int n_polys_in_changing_phase, Type type)
Constructs a variable set of node variables.
Position and velocity of nodes used to generate a Hermite spline.
PolyInfo(int phase, int poly_in_phase, int n_polys_in_phase, bool is_const)
std::shared_ptr< Nodes > Ptr
bool is_constant_
Does this polynomial represent a constant phase.
std::vector< int > GetAdjacentPolyIds(int node_id) const
int GetPolyIDAtStartOfPhase(int phase) const
int GetPhase(int node_id) const
int GetNodeIDAtStartOfPhase(int phase) const
int poly_in_phase_
is this the 1st, 2nd, ... polynomial or this phase.
virtual std::vector< IndexInfo > GetNodeInfoAtOptIndex(int idx) const override
The node information that the optimization index represents.
virtual int GetNumberOfPrevPolynomialsInPhase(int polynomial_id) const
How many polynomials in the current phase come before.