43 bool is_first_phase_in_contact,
47 :VariableSet(timings.size()-1, id::
EESchedule(ee))
50 t_total_ = std::accumulate(timings.begin(), timings.end(), 0.0);
65 spline->UpdatePolynomialDurations();
73 for (
int i=0; i<x.rows(); ++i)
107 for (
int i=0; i<
GetRows(); ++i)
131 int n_dim = xd.rows();
132 Eigen::MatrixXd jac = Eigen::MatrixXd::Zero(n_dim,
GetRows());
134 bool in_last_phase = (current_phase ==
durations_.size()-1);
138 jac.col(current_phase) = dx_dT;
140 for (
int phase=0; phase<current_phase; ++phase) {
142 jac.col(phase) = -1*xd;
147 jac.col(phase) -= dx_dT;
153 return jac.sparseView(1.0, -1.0);
Jacobian GetJacobianOfPos(int phase, const VectorXd &dx_dT, const VectorXd &xd) const
How a change in the phase durations affect the position of a spline.
ifopt::Bounds phase_duration_bounds_
Base class to receive up-to-date values of the ContactSchedule.
static std::string EESchedule(uint ee)
VectorXd GetValues() const override
VecBound GetBounds() const override
bool IsContactPhase(double t) const
Whether the endeffector is in contact with the environment.
static int GetSegmentID(double t_global, const VecTimes &durations)
PhaseDurations(EndeffectorID ee, const VecDurations &initial_durations, bool is_first_phase_in_contact, double min_phase_duration, double max_phase_duration)
Constructs a variable set for a specific endeffector.
Eigen::SparseMatrix< double, Eigen::RowMajor > Jacobian
void UpdateObservers() const
std::vector< double > VecDurations
VecDurations GetPhaseDurations() const
void SetVariables(const VectorXd &x) override
Sets the phase durations from pure Eigen optimization variables.
bool initial_contact_state_
true if first phase in contact
void AddObserver(PhaseDurationsObserver *const spline)
Adds observer that is updated every time new variables are set.
std::vector< Bounds > VecBound
std::vector< PhaseDurationsObserver * > observers_