30 #ifndef TOWR_VARIABLES_NODE_VALUES_H_ 31 #define TOWR_VARIABLES_NODE_VALUES_H_ 73 using Ptr = std::shared_ptr<NodesVariables>;
147 const std::vector<Node>
GetNodes()
const;
232 void AddBounds(
int node_id,
Dx deriv,
const std::vector<int>& dim,
Base class to receive up-to-date values of the NodeVariables.
const std::vector< Node > GetNodes() const
VectorXd GetValues() const override
Pure optimization variables that define the nodes.
int id_
ID of the associated node (0 =< id < number of nodes in spline).
void AddBound(const NodeValueInfo &node_info, double value)
Restricts a specific optimization variables.
NodesVariables(const std::string &variable_name)
void SetVariables(const VectorXd &x) override
Sets some node positions and velocity from the optimization variables.
int dim_
Dimension (x,y,z) of that derivative.
Position and velocity of nodes used to generate a Hermite spline.
virtual ~NodesVariables()=default
static const int NodeValueNotOptimized
std::vector< Node > nodes_
std::shared_ptr< Component > Ptr
static int GetNodeId(int poly_id, Side side)
The node ID that belongs to a specific side of a specific polynomial.
Semantic information associated with a scalar node value.
VecBound GetBounds() const override
int GetPolynomialCount() const
Dx deriv_
Derivative (pos,vel) of the node with that ID.
void UpdateObservers() const
Notifies the subscribed observers that the node values changes.
void AddStartBound(Dx deriv, const std::vector< int > &dimensions, const VectorXd &val)
Restricts the first node in the spline.
virtual std::vector< NodeValueInfo > GetNodeValuesInfo(int opt_idx) const =0
Node values affected by one specific optimization variable.
const std::vector< Node > GetBoundaryNodes(int poly_id) const
std::vector< double > VecDurations
void AddBounds(int node_id, Dx deriv, const std::vector< int > &dim, const VectorXd &values)
Bounds a specific node variables.
int GetOptIndex(const NodeValueInfo &nvi) const
Index in the optimization vector for a specific nodes' pos/vel.
void AddFinalBound(Dx deriv, const std::vector< int > &dimensions, const VectorXd &val)
Restricts the last node in the spline.
void SetByLinearInterpolation(const VectorXd &initial_val, const VectorXd &final_val, double t_total)
Sets nodes pos/vel equally spaced from initial to final position.
VecBound bounds_
the bounds on the node values.
std::vector< Bounds > VecBound
void AddObserver(ObserverPtr const spline)
Adds a dependent observer that gets notified when the nodes change.
std::vector< ObserverPtr > observers_
Dx
< the values or derivative. For motions e.g. position, velocity, ...
int operator==(const NodeValueInfo &right) const