30 #ifndef TOWR_VARIABLES_NODE_VALUES_H_ 31 #define TOWR_VARIABLES_NODE_VALUES_H_ 33 #include <ifopt/variable_set.h> 52 class Nodes :
public ifopt::VariableSet {
54 using Ptr = std::shared_ptr<Nodes>;
88 int Index(
int node_id,
Dx deriv,
int node_dim)
const;
113 virtual VecBound
GetBounds ()
const override;
118 const std::vector<Node>
GetNodes()
const;
173 Nodes (
int n_dim,
const std::string& variable_name);
174 virtual ~Nodes () =
default;
205 void AddBounds(
int node_id,
Dx deriv,
const std::vector<int>& dim,
void AddBound(const IndexInfo &node_info, double value)
Restricts a specific optimization variables.
Base class to receive up-to-date values of the NodeVariables.
std::vector< Node > nodes_
VectorXd GetValues() const override
std::vector< double > VecDurations
void UpdateObservers() const
Notifies the subscribed observers that the node values changes.
void AddObserver(ObserverPtr const spline)
Adds a dependent observer that gets notified when the nodes change.
virtual std::vector< IndexInfo > GetNodeInfoAtOptIndex(int idx) const =0
The node information that the optimization index represents.
void InitializeNodesTowardsGoal(const VectorXd &initial_pos, const VectorXd &final_pos, double t_total)
Sets nodes pos/vel equally spaced from initial to final position.
int node_dim_
the dimension (x,y,z) of that optimization index.
void AddFinalBound(Dx deriv, const std::vector< int > &dimensions, const VectorXd &val)
Restricts the last node in the spline.
Position and velocity of nodes used to generate a Hermite spline.
int Index(const IndexInfo &node_info) const
The index at which a specific node variable is stored.
void AddBounds(int node_id, Dx deriv, const std::vector< int > &dim, const VectorXd &values)
Bounds a specific node variables.
std::shared_ptr< Nodes > Ptr
void InitMembers(int n_nodes, int n_variables)
initializes the member variables.
VecBound bounds_
the bounds on the node values.
static int GetNodeId(int poly_id, Side side)
The node ID that belongs to a specific side of a specific polynomial.
Nodes(int n_dim, const std::string &variable_name)
int GetPolynomialCount() const
std::vector< ObserverPtr > observers_
Dx node_deriv_
The derivative (pos,vel) of that optimziation index.
virtual VecBound GetBounds() const override
Holds information about the node the optimization index represents.
int node_id_
The ID of the node of the optimization index.
void SetVariables(const VectorXd &x) override
Sets the node position and velocity optimization variables.
int operator==(const IndexInfo &right) const
const std::vector< Node > GetBoundaryNodes(int poly_id) const
void AddStartBound(Dx deriv, const std::vector< int > &dimensions, const VectorXd &val)
Restricts the first node in the spline.
Dx
< the values or derivative. For motions e.g. position, velocity, ...
const std::vector< Node > GetNodes() const