23 #ifndef FULL_DISCRETIZATION_GRID_BASE_H_ 24 #define FULL_DISCRETIZATION_GRID_BASE_H_ 67 using Ptr = std::shared_ptr<FullDiscretizationGridBaseSE2>;
68 using UPtr = std::unique_ptr<FullDiscretizationGridBaseSE2>;
117 return _x_seq[k].values();
124 void clear()
override;
132 void setN(
int n,
bool try_resample =
true)
override;
232 #endif // FULL_DISCRETIZATION_GRID_BASE_H_
bool isTimeVariableGrid() const override
int getInitialN() const override
std::unique_ptr< DiscretizationGridInterface > UPtr
int findClosestPose(double x_ref, double y_ref, int start_idx=0, double *distance=nullptr) const
Find the closest pose (first part of the state vector) on the grid w.r.t. to a provided reference poi...
PartiallyFixedVectorVertexSE2 _xf
virtual bool isDtFixedIntended() const
bool providesStateTrajectory() const override
virtual bool isValid() const
void computeActiveVertices() override
virtual bool adaptGrid(bool new_run, NlpFunctions &nlp_fun)
Eigen::Matrix< bool, -1, 1 > _xf_fixed
void setNRef(int n)
set reference horizon length
corbo::DiscretizationGridInterface::Ptr getInstance() const override=0
Return a newly created shared instance of the implemented class.
void getVertices(std::vector< VertexInterface *> &vertices) override
std::vector< VectorVertex > _u_seq
void updateBounds(const NlpFunctions &nlp_fun)
virtual ~FullDiscretizationGridBaseSE2()=default
double getFirstDt() const override
void setCostIntegrationRule(CostIntegrationRule integration)
Set cost integration rule.
geometry_msgs::TransformStamped t
virtual void warmStartShifting(const Eigen::VectorXd &x0)
VectorVertexSE2 with support for partially fixed components.
void setXfFixed(const Eigen::Matrix< bool, -1, 1 > &xf_fixed)
Set individual components of the final state to fixed or unfixed.
FullDiscretizationGridBaseSE2()=default
std::vector< VectorVertexSE2 > _x_seq
const NlpFunctions * _nlp_fun
double distance(double x0, double y0, double x1, double y1)
virtual void createEdges(NlpFunctions &nlp_fun, OptimizationEdgeSet &edges, SystemDynamicsInterface::Ptr dynamics)=0
int getN() const override
get current horizon length
virtual void resampleTrajectory(int n_new)
CostIntegrationRule _cost_integration
bool isUniformGrid() const override
void setModified(bool modified)
constexpr const double CORBO_INF_DBL
void setWarmStart(bool active)
activate or deactive warmstart
void setInitialDt(double dt) override
bool isEmpty() const override
const double & value() const
corbo::GridUpdateResult update(const Eigen::VectorXd &x0, ReferenceTrajectoryInterface &xref, ReferenceTrajectoryInterface &uref, NlpFunctions &nlp_fun, OptimizationEdgeSet &edges, SystemDynamicsInterface::Ptr dynamics, bool new_run, const corbo::Time &t, ReferenceTrajectoryInterface *sref=nullptr, const Eigen::VectorXd *prev_u=nullptr, double prev_u_dt=0, ReferenceTrajectoryInterface *xinit=nullptr, ReferenceTrajectoryInterface *uinit=nullptr) override
std::vector< VertexInterface * > _active_vertices
double getFinalTime() const override
corbo::FiniteDifferencesCollocationInterface::Ptr _fd_eval
std::shared_ptr< DiscretizationGridInterface > Ptr
int findNearestState(const Eigen::VectorXd &x0)
Full discretization grid specialization for SE2.
virtual bool isGridAdaptActive() const
bool getFirstControlInput(Eigen::VectorXd &u0) override
bool hasSingleDt() const override
bool hasConstantControls() const override
const Eigen::VectorXd & getState(int k) const
Return state at time stamp k.
double getDt() const
get current temporal resolution
virtual void initializeSequences(const Eigen::VectorXd &x0, const Eigen::VectorXd &xf, ReferenceTrajectoryInterface &uref, NlpFunctions &nlp_fun)
virtual bool isMovingHorizonWarmStartActive() const
bool checkAndInitializeXfFixedFlags(int dim_x)
const Eigen::VectorXd & values() const
void setDtRef(double dt)
set reference temporal resolution
double getInitialDt() const override
std::shared_ptr< TimeSeries > Ptr
void setFiniteDifferencesCollocationMethod(corbo::FiniteDifferencesCollocationInterface::Ptr fd_eval)
Set finite differences collocation method.
int getNRef() const
get reference horizon length
std::shared_ptr< FiniteDifferencesCollocationInterface > Ptr
void getStateAndControlTimeSeries(TimeSeries::Ptr x_sequence, TimeSeries::Ptr u_sequence, double t_max=corbo::CORBO_INF_DBL) const override
void setN(int n, bool try_resample=true) override
std::shared_ptr< SystemDynamicsInterface > Ptr
std::vector< VertexInterface * > & getActiveVertices() override
double getDtRef() const
get current reference temporal resolution