Go to the documentation of this file.
25 #ifndef SRC_OPTIMAL_CONTROL_INCLUDE_CORBO_OPTIMAL_CONTROL_STRUCTURED_OCP_DISCRETIZATION_GRIDS_DISCRETIZATION_GRID_INTERFACE_H_
26 #define SRC_OPTIMAL_CONTROL_INCLUDE_CORBO_OPTIMAL_CONTROL_STRUCTURED_OCP_DISCRETIZATION_GRIDS_DISCRETIZATION_GRID_INTERFACE_H_
43 #ifdef MESSAGE_SUPPORT
44 #include <corbo-communication/messages/optimal_control/discretization_grids.pb.h>
52 struct GridUpdateResult
82 class DiscretizationGridInterface :
public VertexSetInterface
85 using Ptr = std::shared_ptr<DiscretizationGridInterface>;
86 using UPtr = std::unique_ptr<DiscretizationGridInterface>;
96 virtual GridUpdateResult
update(
const Eigen::VectorXd& x0, ReferenceTrajectoryInterface& xref, ReferenceTrajectoryInterface& uref,
113 virtual void setN(
int n,
bool try_resample =
true) = 0;
116 virtual int getN()
const = 0;
135 void clear()
override = 0;
137 virtual bool isEmpty()
const = 0;
141 #ifdef MESSAGE_SUPPORT
142 virtual void fromMessage(
const messages::DiscretizationGrid& message, std::stringstream* issues) {}
143 virtual void toMessage(messages::DiscretizationGrid& message)
const {}
149 void getVertices(std::vector<VertexInterface*>& vertices)
override = 0;
174 #define FACTORY_REGISTER_DISCRETIZATION_GRID(type) FACTORY_REGISTER_OBJECT(type, DiscretizationGridInterface)
178 #endif // SRC_OPTIMAL_CONTROL_INCLUDE_CORBO_OPTIMAL_CONTROL_STRUCTURED_OCP_DISCRETIZATION_GRIDS_DISCRETIZATION_GRID_INTERFACE_H_
virtual bool isEmpty() const =0
virtual int getInitialN() const =0
virtual bool hasSingleDt() const =0
std::vector< VertexInterface * > & getActiveVertices() override=0
virtual void setN(int n, bool try_resample=true)=0
Return dimension of the control input dimension in the grid.
Interface class for reference trajectories.
void setPreviousControl(const Eigen::VectorXd &prev_u, double prev_u_dt)
virtual Ptr getInstance() const =0
Return a newly created shared instance of the implemented class.
virtual bool getFirstControlInput(Eigen::VectorXd &u0)=0
void setLastControlRef(const Eigen::VectorXd &last_u_ref)
virtual GridUpdateResult update(const Eigen::VectorXd &x0, ReferenceTrajectoryInterface &xref, ReferenceTrajectoryInterface &uref, NlpFunctions &nlp_fun, OptimizationEdgeSet &edges, SystemDynamicsInterface::Ptr dynamics, bool new_run, const Time &t, ReferenceTrajectoryInterface *sref=nullptr, const Eigen::VectorXd *prev_u=nullptr, double prev_u_dt=0, ReferenceTrajectoryInterface *xinit=nullptr, ReferenceTrajectoryInterface *uinit=nullptr)=0
virtual void getStateAndControlTimeSeries(TimeSeries::Ptr x_sequence, TimeSeries::Ptr u_sequence, double t_max=CORBO_INF_DBL) const =0
Return state and control trajectory as time series object (shared instance)
virtual ~DiscretizationGridInterface()=default
Virtual destructor.
constexpr const double CORBO_INF_DBL
Representation for infinity (double version)
void getVertices(std::vector< VertexInterface * > &vertices) override=0
const Eigen::VectorXd & values() const
Read-access to the underlying value vector.
virtual double getFirstDt() const =0
DiscretizationGridInterface()=default
static Factory< DiscretizationGridInterface > & getFactory()
Get access to the accociated factory.
std::shared_ptr< DiscretizationGridInterface > Ptr
virtual bool providesStateTrajectory() const =0
virtual void setInitialDt(double dt)=0
static Factory & instance()
< Retrieve static instance of the factory
void setFixed(bool fixed)
Set vertex (un)fixed.
virtual bool isTimeVariableGrid() const =0
virtual bool isFixed() const
Check if all components are fixed.
std::shared_ptr< SystemDynamicsInterface > Ptr
virtual double getInitialDt() const =0
const double & value() const
Get underlying value.
void computeActiveVertices() override=0
virtual int getN() const =0
virtual bool isUniformGrid() const =0
virtual double getFinalTime() const =0
Representation of time stamps.
std::unique_ptr< DiscretizationGridInterface > UPtr
Factory< DiscretizationGridInterface > DiscretizationGridFactory
std::shared_ptr< TimeSeries > Ptr
virtual void setFixed(bool fixed)
Set complete vertex to fixed (and hence skip during optimization)
void setModified(bool modified)
virtual bool hasConstantControls() const =0
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:05:45