29 #include <corbo-optimal-control/structured_ocp/discretization_grids/full_discretization_grid.h> 37 bool FullDiscretizationGrid::initialize(
const Eigen::VectorXd& x0,
const Eigen::VectorXd& u0,
DynamicsEvalInterface::Ptr dynamics_eval)
39 return initialize(x0, x0, u0, dynamics_eval);
42 bool FullDiscretizationGrid::initialize(
const Eigen::VectorXd& x0,
const Eigen::VectorXd& xf,
const Eigen::VectorXd& u0,
47 DiscretizationGrid::initialize(x0.size(), u0.size());
49 if (_num_desired_states < 2)
51 PRINT_ERROR(
"FullDiscretizationGrid::initialize(): number of desired states > 1 required. Please call setHorizon() first.");
55 int num_intervals = _num_desired_states - 1;
58 Eigen::VectorXd dir = xf - x0;
59 double dist = dir.norm();
60 if (dist != 0) dir /= dist;
61 double step = dist / num_intervals;
63 for (
int k = 0; k < num_intervals; ++k)
66 appendShootingInterval(x0 + (
double)k * step * dir, u0, _dt);
70 getShootingIntervalsRaw().front().shooting_node->setFixed(
true);
73 if (_xf_fixed.size() == 0)
74 xf_node->setFixed(
false);
76 xf_node->setFixed(_xf_fixed);
77 getFinalStateRaw() = xf_node;
84 bool FullDiscretizationGrid::initialize(
const Eigen::VectorXd& x0, ReferenceTrajectoryInterface& xref, ReferenceTrajectoryInterface& uref,
87 DiscretizationGrid::initialize(x0.size(), uref.getDimension());
91 if (xref.isStatic() && uref.isStatic())
93 return initialize(x0, xref.getReferenceCached(0), uref.getReferenceCached(0), dynamics_eval);
98 if (_num_desired_states < 2)
100 PRINT_ERROR(
"FullDiscretizationGrid::initialize(): number of desired states > 1 required. Please call setHorizon() first.");
106 uref.precompute(_dt, _num_desired_states, t);
110 DiscretizationGrid::initialize(xref.getDimension(), uref.getDimension());
112 int num_intervals = _num_desired_states - 1;
115 Eigen::VectorXd dir = xref.getReferenceCached(num_intervals) - x0;
116 double dist = dir.norm();
117 if (dist != 0) dir /= dist;
118 double step = dist / num_intervals;
120 for (
int k = 0; k < num_intervals; ++k)
123 appendShootingInterval(x0 + (
double)k * step * dir, uref.getReferenceCached(k), _dt);
127 getShootingIntervalsRaw().front().shooting_node->setFixed(
true);
130 std::make_shared<PartiallyFixedVectorVertex>(xref.getReferenceCached(num_intervals), _x_lower, _x_upper);
131 if (_xf_fixed.size() == 0)
132 xf_node->setFixed(
false);
134 xf_node->setFixed(_xf_fixed);
135 getFinalStateRaw() = xf_node;
140 xref.precompute(_dt, _num_desired_states, t);
141 uref.precompute(_dt, _num_desired_states, t);
143 if ((x0 - xref.getReferenceCached(0)).norm() > _non_static_ref_dist_threshold)
144 return initialize(x0, xref.getReferenceCached(_num_desired_states - 1), uref.getReferenceCached(_num_desired_states - 1),
150 DiscretizationGrid::initialize(xref.getDimension(), uref.getDimension());
152 int num_intervals = _num_desired_states - 1;
154 appendShootingInterval(x0, uref.getReferenceCached(0), _dt);
156 for (
int k = 1; k < num_intervals; ++k)
159 appendShootingInterval(xref.getReferenceCached(k), uref.getReferenceCached(k), _dt);
163 getShootingIntervalsRaw().front().shooting_node->setFixed(
true);
166 std::make_shared<PartiallyFixedVectorVertex>(xref.getReferenceCached(num_intervals), _x_lower, _x_upper);
167 if (_xf_fixed.size() == 0)
168 xf_node->setFixed(
false);
170 xf_node->setFixed(_xf_fixed);
171 getFinalStateRaw() = xf_node;
179 bool FullDiscretizationGrid::update(
const Eigen::VectorXd& x0, ReferenceTrajectoryInterface& xref, ReferenceTrajectoryInterface& uref,
bool new_run,
182 if (_shooting_intervals.empty() || !_warm_start)
189 initialize(x0, xref, uref, t);
194 Eigen::VectorXd xf(x0.rows());
195 xref.getReference(Time(getFinalTime()), xf);
198 if (_current_xf_values.rows() > 0 && (xf - _current_xf_values).norm() > _warm_start_goal_dist_reinit)
200 initialize(x0, xref, uref, t);
201 _current_xf_values = xf;
210 if (!_prune_trajectory)
220 if (_shooting_intervals.empty())
222 PRINT_ERROR_NAMED(
"warm-start failed. No grid intervals found. Reinitializing...");
223 initialize(x0, xref, uref, t);
227 _shooting_intervals.front().shooting_node->values() = x0;
234 if (_current_xf_values.rows() == 0) _current_xf_values = xf;
237 if (!new_run) resizeTrajectory();
243 int FullDiscretizationGrid::pruneTrajectory(
const Eigen::VectorXd& x0)
245 int nearest_idx = findNewInitialShootingInterval(x0);
251 _shooting_intervals.erase(_shooting_intervals.begin(),
252 _shooting_intervals.begin() + nearest_idx);
255 getShootingIntervalsRaw().front().shooting_node->setFixed(
true);
261 _shooting_intervals.front().shooting_node->values() = x0;
266 void FullDiscretizationGrid::appendShootingInterval(
const Eigen::VectorXd&
x,
const Eigen::VectorXd& u,
double dt_if_not_single)
268 getShootingIntervalsRaw().emplace_back();
269 ShootingInterval& interval = getShootingIntervalsRaw().back();
272 ShootingVertex::Ptr xk_node = std::make_shared<ShootingVertex>(
x, _x_lower, _x_upper);
273 interval.shooting_node = xk_node;
276 interval.num_controls = 1;
279 interval.controls.push_back(std::make_shared<ControlVertex>(u, _u_lower, _u_upper));
284 if (_shooting_intervals.size() == 1)
285 interval.dts.push_back(std::make_shared<DtVertex>(_dt, _dt_lower, _dt_upper, _dt_fixed));
287 interval.dts.push_back(getFirstDtVertex());
291 interval.dts.push_back(std::make_shared<DtVertex>(dt_if_not_single, _dt_lower, _dt_upper, _dt_fixed));
297 void FullDiscretizationGrid::insertShootingInterval(
int k,
const Eigen::VectorXd& x,
const Eigen::VectorXd& u,
double dt_if_not_single)
300 assert(k <= (
int)_shooting_intervals.size());
302 if (k == _shooting_intervals.size())
304 appendShootingInterval(x, u, dt_if_not_single);
308 auto new_interv_it = _shooting_intervals.insert(_shooting_intervals.begin() + k, ShootingInterval());
309 ShootingInterval& interval = *new_interv_it;
312 ShootingVertex::Ptr xk_node = std::make_shared<ShootingVertex>(
x, _x_lower, _x_upper);
313 interval.shooting_node = xk_node;
316 interval.num_controls = 1;
319 interval.controls.push_back(std::make_shared<ControlVertex>(u, _u_lower, _u_upper));
324 if (_shooting_intervals.size() == 1)
325 interval.dts.push_back(std::make_shared<DtVertex>(_dt, _dt_lower, _dt_upper, _dt_fixed));
327 interval.dts.push_back(getFirstDtVertex());
331 interval.dts.push_back(std::make_shared<DtVertex>(dt_if_not_single, _dt_lower, _dt_upper, _dt_fixed));
337 void FullDiscretizationGrid::eraseShootingInterval(
int k)
340 assert(k < (
int)_shooting_intervals.size());
341 _shooting_intervals.erase(_shooting_intervals.begin() + k);
343 if (k == 0 && !_shooting_intervals.empty())
346 getShootingIntervalsRaw().front().shooting_node->setFixed(
true);
351 void FullDiscretizationGrid::extrapolateTrajectory(
int num_new_intervals)
353 if (num_new_intervals < 1)
return;
355 if (_shooting_intervals.empty())
357 PRINT_ERROR(
"FullDiscretizationGrid::extrapolateTrajectory(): cannot extrapolate with less than states");
362 appendShootingInterval(_xf->values(), _shooting_intervals.back().controls.front()->values(), _dt);
365 for (
int i = 0; i < num_new_intervals; ++i)
369 auto it_back = std::prev(_shooting_intervals.end());
370 Eigen::VectorXd xi = it_back->shooting_node->values() +
371 (it_back->shooting_node->values() -
372 std::prev(it_back)->shooting_node->values());
374 if (i < num_new_intervals - 1)
376 appendShootingInterval(xi, it_back->controls.front()->values(), _dt);
386 bool FullDiscretizationGrid::shiftGridValues(
const Eigen::VectorXd& x0)
388 int nearest_idx = findNewInitialShootingInterval(x0);
389 return shiftGridValues(nearest_idx);
392 bool FullDiscretizationGrid::shiftGridValues(
int num_shift)
396 else if (num_shift < 0)
399 if (num_shift > getN() - 2)
406 for (
int i = 0; i < getN() - num_shift; ++i)
408 int idx = i + num_shift;
409 if (idx == getN() - 1)
413 _shooting_intervals[i].shooting_node->values() = _xf->values();
417 _shooting_intervals[i].shooting_node->values() = _shooting_intervals[idx].shooting_node->values();
419 for (
int j = 0; j < _shooting_intervals[i].controls.size(); ++j)
421 assert(_shooting_intervals[i].controls.size() == _shooting_intervals[idx].controls.size());
422 _shooting_intervals[i].controls[j]->values() = _shooting_intervals[idx].controls[j]->values();
425 for (
int j = 0; j < _shooting_intervals[i].dts.size(); ++j)
427 assert(_shooting_intervals[i].dts.size() == _shooting_intervals[idx].dts.size());
428 _shooting_intervals[i].dts[j]->values() = _shooting_intervals[idx].dts[j]->values();
431 assert(_shooting_intervals[i].additional_states.empty() &&
"No additional states allowed in full discretization grid.");
438 int idx = getN() - num_shift;
444 for (
int i = 0; i < num_shift; ++i, ++idx)
450 if (i == num_shift - 1)
452 _xf->values() = _shooting_intervals[idx - 2].shooting_node->values() +
453 2.0 * (_shooting_intervals[idx - 1].shooting_node->values() - _shooting_intervals[idx - 2].shooting_node->values());
457 _shooting_intervals[idx].shooting_node->values() =
458 _shooting_intervals[idx - 2].shooting_node->values() +
459 2.0 * (_shooting_intervals[idx - 1].shooting_node->values() - _shooting_intervals[idx - 2].shooting_node->values());
463 for (
int j = 0; j < _shooting_intervals[idx - 1].controls.size(); ++j)
465 assert(_shooting_intervals[idx - 1].controls.size() == _shooting_intervals[idx - 2].controls.size());
466 _shooting_intervals[idx - 1].controls[j]->values() = _shooting_intervals[idx - 2].controls[j]->values();
469 for (
int j = 0; j < _shooting_intervals[idx - 1].dts.size(); ++j)
471 assert(_shooting_intervals[idx - 1].dts.size() == _shooting_intervals[idx - 2].dts.size());
472 _shooting_intervals[idx - 1].dts[j]->values() = _shooting_intervals[idx - 2].dts[j]->values();
475 assert(_shooting_intervals[i].additional_states.empty() &&
"No additional states allowed in full discretization grid.");
481 int FullDiscretizationGrid::findNewInitialShootingInterval(
const Eigen::VectorXd& x0)
483 assert(!_shooting_intervals.empty());
484 assert(_shooting_intervals.front().shooting_node);
487 if (x0 == _shooting_intervals.front().shooting_node->values())
return 0;
493 int num_interv = (
int)_shooting_intervals.size();
495 double dist_cache = (x0 - _shooting_intervals.front().shooting_node->values()).norm();
497 int num_keep_interv =
std::max(1, _num_states_min - 1);
498 int lookahead =
std::min(num_interv - num_keep_interv, 20);
502 for (
int i = 1; i <= lookahead; ++i)
504 dist = (x0 - _shooting_intervals[i].shooting_node->values()).norm();
505 if (dist < dist_cache)
517 bool FullDiscretizationGrid::resizeTrajectory()
520 switch (_auto_resize)
522 case AutoResizeStrategy::NoAutoResize:
526 case AutoResizeStrategy::TimeBased:
528 success = resizeTrajectoryTimeBased();
531 case AutoResizeStrategy::RedundantControls:
533 success = resizeTrajectoryRedundantControls();
538 PRINT_ERROR(
"FullDiscretizationGrid::resizeTrajectory(): selected auto resize strategy not implemented.");
545 bool FullDiscretizationGrid::resizeTrajectoryTimeBased()
549 PRINT_WARNING(
"FullDiscretizationGrid::resizeTrajectoryTimeBased(): time based resize might only be used with an unfixed dt.");
556 assert(getFirstDtVertexRaw());
557 double dt = getFirstDtVertexRaw()->value();
569 if (dt > _dt * (1.0 + _dt_hyst_ratio) && n < _num_states_max)
571 resampleTrajectory(n + 1);
573 else if (dt < _dt * (1.0 - _dt_hyst_ratio) && n > _num_states_min)
575 resampleTrajectory(n - 1);
582 bool changed =
false;
584 for (
int i = 0; i < (
int)_shooting_intervals.size() - 1; ++i)
586 ShootingInterval& interv = _shooting_intervals[i];
587 ShootingInterval& interv_next = _shooting_intervals[i + 1];
589 double dt = interv.dts.front()->value();
591 if (dt > _dt * (1.0 + _dt_hyst_ratio) && n < _num_states_max)
593 double new_dt = 0.5 * dt;
595 insertShootingInterval(i + 1, 0.5 * (interv.shooting_node->values() + interv_next.shooting_node->values()),
596 interv.controls.front()->values(), new_dt);
603 else if (dt < _dt * (1.0 - _dt_hyst_ratio) && n > _num_states_min)
607 interv_next.dts.front()->value() += dt;
608 eraseShootingInterval(i);
620 bool FullDiscretizationGrid::resizeTrajectoryRedundantControls()
623 std::vector<std::size_t> non_unique_indices;
624 for (std::size_t idx = 0; idx < (
int)_shooting_intervals.size() - 1; ++idx)
626 ShootingInterval& interv = _shooting_intervals[idx];
627 ShootingInterval& interv_next = _shooting_intervals[idx + 1];
631 if (interv.dts.front()->value() < 1e-6)
633 non_unique_indices.emplace_back(idx);
641 Eigen::VectorXd& u_k = interv.controls.front()->values();
642 Eigen::VectorXd& u_kp1 = interv_next.controls.front()->values();
643 if (((u_kp1 - u_k).
cwiseAbs().array() <= _redundant_ctrl_epsilon).all()) non_unique_indices.emplace_back(idx);
648 bool changed =
false;
650 int backup_diff = (
int)non_unique_indices.size() - _redundant_ctrl_backup;
655 backup_diff =
std::abs(backup_diff);
656 for (
int i = 0; i < backup_diff && getN() < _num_states_max; ++i)
663 auto end_it = _shooting_intervals.end();
664 std::advance(end_it, -1);
665 auto max_elem = std::max_element(_shooting_intervals.begin(), end_it, [](
const ShootingInterval& si1,
const ShootingInterval& si2) {
666 return si1.dts.front()->value() < si2.dts.front()->value();
668 if (max_elem == end_it)
670 PRINT_INFO(
"Invalid time max element in resizeTrajectoryRedundantControls(). break...");
673 dt_max_idx = std::distance(_shooting_intervals.begin(), max_elem);
675 assert(dt_max_idx + 1 < (
int)_shooting_intervals.size());
676 ShootingInterval& interv = _shooting_intervals[dt_max_idx];
677 ShootingInterval& interv_next = _shooting_intervals[dt_max_idx + 1];
679 double new_dt = 0.5 * interv.dts.front()->value();
680 interv.dts.front()->value() = new_dt;
681 insertShootingInterval(dt_max_idx + 1, 0.5 * (interv.shooting_node->values() + interv_next.shooting_node->values()),
682 interv.controls.front()->values(), new_dt);
686 else if (backup_diff > 0)
689 auto idx_it = non_unique_indices.rbegin();
690 for (
int i = 0; i < backup_diff && getN() > _num_states_min; ++i)
692 int k = (
int)*idx_it;
693 if (k >= getN() - 2) --k;
695 assert(k + 1 < (
int)_shooting_intervals.size());
696 ShootingInterval& interv = _shooting_intervals[k];
697 ShootingInterval& interv_next = _shooting_intervals[k + 1];
699 interv.dts.front()->value() += interv_next.dts.front()->value();
700 eraseShootingInterval(k + 1);
708 void FullDiscretizationGrid::resampleTrajectory(
int n_new)
711 if (n == n_new)
return;
718 getShootingNodeTimeSeries(ts_states_old);
719 getControlInputTimeSeries(ts_controls_old);
724 int num_interv = n - 1;
728 assert(getFirstDtVertexRaw() !=
nullptr);
729 double dt_old = getFirstDtVertexRaw()->value();
731 double dt_new = dt_old * double(n - 1) / double(n_new - 1);
735 double t_old_p1 = dt_old;
737 for (
int idx_new = 1; idx_new < n_new - 1; ++idx_new)
741 t_new = dt_new * double(idx_new);
742 while (t_new >
double(idx_old) * dt_old && idx_old < n)
746 t_old_p1 = double(idx_old) * dt_old;
748 const Eigen::VectorXd& x_prev = states_old.col(idx_old - 1);
749 const Eigen::VectorXd& x_cur = (idx_old < n - 1) ? states_old.col(idx_old) : _xf->values();
751 if (idx_new < num_interv)
754 _shooting_intervals[idx_new].shooting_node->values() = x_prev + (t_new - (t_old_p1 - dt_old)) / dt_old * (x_cur - x_prev);
758 _shooting_intervals[idx_new].controls.front()->values() = controls_old.col(idx_old - 1);
763 appendShootingInterval(x_prev + (t_new - (t_old_p1 - dt_old)) / dt_old * (x_cur - x_prev), controls_old.col(idx_old - 1), _dt);
770 _shooting_intervals.resize(n_new - 1);
774 getFirstDtVertexRaw()->value() = dt_new;
781 PRINT_ERROR(
"FullDiscretizationGrid::resampleTrajectory(): not yet implemented for multiple dts");
788 double FullDiscretizationGrid::getFinalTime()
const 790 if (_dt_fixed && _single_dt)
return (
double)_shooting_intervals.size() * _dt;
791 if (_single_dt)
return (
double)_shooting_intervals.size() * getFirstDt();
793 return DiscretizationGrid::getFinalTime();
796 void FullDiscretizationGrid::setGridResizeTimeBased(
int num_states_max,
double dt_hyst_ratio)
798 _auto_resize = AutoResizeStrategy::TimeBased;
799 _num_states_max = num_states_max;
800 _dt_hyst_ratio = dt_hyst_ratio;
803 void FullDiscretizationGrid::setGridResizeRedundControls(
int num_states_max,
int num_backup_nodes,
double epsilon)
805 _auto_resize = AutoResizeStrategy::RedundantControls;
806 _num_states_max = num_states_max;
807 _redundant_ctrl_backup = num_backup_nodes;
808 _redundant_ctrl_epsilon = epsilon;
811 void FullDiscretizationGrid::computeActiveVertices()
813 _active_vertices.clear();
816 for (ShootingInterval& interv : _shooting_intervals)
818 if (!interv.shooting_node->isFixed()) _active_vertices.push_back(interv.shooting_node.get());
819 if (!interv.controls.front()->isFixed()) _active_vertices.push_back(interv.controls.front().get());
821 if (!_xf->isFixed()) _active_vertices.push_back(_xf.get());
822 if (!getFirstDtVertexRaw()->isFixed()) _active_vertices.push_back(getFirstDtVertexRaw());
826 for (ShootingInterval& interv : _shooting_intervals)
828 if (!interv.shooting_node->isFixed()) _active_vertices.push_back(interv.shooting_node.get());
829 if (!interv.controls.front()->isFixed()) _active_vertices.push_back(interv.controls.front().get());
830 if (!interv.dts.front()->isFixed()) _active_vertices.push_back(interv.dts.front().get());
832 if (!_xf->isFixed()) _active_vertices.push_back(_xf.get());
836 void FullDiscretizationGrid::updateDtsFixedFlag()
838 if (_single_dt && !_shooting_intervals.empty() && !_shooting_intervals.front().dts.empty())
840 getFirstDtVertexRaw()->setFixed(_dt_fixed);
844 for (ShootingInterval& interv : _shooting_intervals)
848 dt_vtx->setFixed(_dt_fixed);
854 void FullDiscretizationGrid::updateDts()
859 for (
const ShootingInterval& interv : _shooting_intervals) dt += interv.getTotalTimeInterval();
861 if (!_shooting_intervals.empty()) dt /= (
double)_shooting_intervals.size();
866 for (ShootingInterval& interv : _shooting_intervals)
876 for (ShootingInterval& interv : _shooting_intervals)
878 if (interv.dts.empty())
continue;
879 double local_dt = dt / (double)interv.dts.size();
882 dt_vtx = std::make_shared<ScalarVertex>(local_dt, _dt_fixed);
888 #ifdef MESSAGE_SUPPORT 889 void FullDiscretizationGrid::fromMessage(
const messages::FullDiscretizationGrid& message, std::stringstream* issues)
891 if (message.n() < 2 && issues) *issues <<
"FullDiscretizationGrid: Number of states must be greater than or equal 2.\n";
893 if (message.dt() <= 0 && issues) *issues <<
"FullDiscretizationGrid: Dt must be greater than 0.0.\n";
899 setSingleDt(message.single_dt());
900 setDtFixed(message.fixed_dt());
903 int dim_controls = 0;
909 dim_states = _xf_fixed.
rows();
912 if (message.x_min_size() != dim_states && issues)
914 *issues <<
"FullDiscretizationGrid: x_min size does not match dimension of xf_fixed " << dim_states <<
".\n";
921 if (message.x_max_size() != dim_states && issues)
923 *issues <<
"FullDiscretizationGrid: x_max size does not match dimension of xf_fixed " << dim_states <<
".\n";
934 dim_controls = message.u_min_size();
935 if (message.u_max_size() != dim_controls && issues)
936 *issues <<
"FullDiscretizationGrid: u_max size does not match dimension of u_min " << dim_controls <<
".\n";
941 setDtBounds(message.dt_min(), message.dt_max());
944 if (message.has_resize_strategy())
946 if (message.resize_strategy().has_no_auto_resize())
950 else if (message.resize_strategy().has_time_based())
952 setGridResizeTimeBased(message.resize_strategy().time_based().n_max(), message.resize_strategy().time_based().dt_hyst_ratio());
954 else if (message.resize_strategy().has_redundant_controls())
956 setGridResizeRedundControls(message.resize_strategy().redundant_controls().n_max(),
957 message.resize_strategy().redundant_controls().num_backup(),
958 message.resize_strategy().redundant_controls().epsilon());
963 _warm_start = message.warm_start();
964 _prune_trajectory = message.prune_trajectory();
965 _num_states_min = message.n_min();
967 _include_intermediate_constr = message.intermediate_collocation_constr();
969 DiscretizationGrid::initialize(dim_states, dim_controls);
972 void FullDiscretizationGrid::toMessage(messages::FullDiscretizationGrid& message)
const 974 message.set_n(_num_desired_states);
978 message.set_fixed_dt(_dt_fixed);
979 message.set_single_dt(_single_dt);
982 if (_xf_fixed.size() > 0)
984 message.mutable_xf_fixed()->Resize(_xf_fixed.size(),
false);
985 Eigen::Map<
Eigen::Matrix<bool, -1, 1>>(message.mutable_xf_fixed()->mutable_data(), _xf_fixed.size()) = _xf_fixed;
989 message.mutable_x_min()->Resize(_x_lower.size(), 0);
991 message.mutable_x_max()->Resize(_x_upper.size(), 0);
993 message.mutable_u_min()->Resize(_u_lower.size(), 0);
995 message.mutable_u_max()->Resize(_u_upper.size(), 0);
999 message.set_dt_min(_dt_lower);
1000 message.set_dt_max(_dt_upper);
1003 switch (_auto_resize)
1005 case AutoResizeStrategy::NoAutoResize:
1007 message.mutable_resize_strategy()->mutable_no_auto_resize();
1010 case AutoResizeStrategy::TimeBased:
1012 message.mutable_resize_strategy()->mutable_time_based()->set_n_max(_num_states_max);
1013 message.mutable_resize_strategy()->mutable_time_based()->set_dt_hyst_ratio(_dt_hyst_ratio);
1016 case AutoResizeStrategy::RedundantControls:
1018 message.mutable_resize_strategy()->mutable_redundant_controls()->set_n_max(_num_states_max);
1019 message.mutable_resize_strategy()->mutable_redundant_controls()->set_num_backup(_redundant_ctrl_backup);
1020 message.mutable_resize_strategy()->mutable_redundant_controls()->set_epsilon(_redundant_ctrl_epsilon);
1025 PRINT_ERROR(
"FullDiscretizationGrid::toMessage(): exporting of the selected auto resize strategy not implemented.");
1030 message.set_n_min(_num_states_min);
1031 message.set_warm_start(_warm_start);
1032 message.set_prune_trajectory(_prune_trajectory);
1033 message.set_intermediate_collocation_constr(_include_intermediate_constr);
Eigen::Map< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > > ValuesMatMap
#define PRINT_ERROR_NAMED(msg)
std::shared_ptr< ScalarVertex > Ptr
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const
#define PRINT_WARNING_NAMED(msg)
std::shared_ptr< PartiallyFixedVectorVertex > Ptr
#define PRINT_WARNING(msg)
Print msg-stream.
A matrix or vector expression mapping an existing array of data.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const AbsReturnType abs() const
std::shared_ptr< DynamicsEvalInterface > Ptr
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseAbsReturnType cwiseAbs() const
std::shared_ptr< TimeSeries > Ptr
The matrix class, also used for vectors and row-vectors.
#define PRINT_INFO(msg)
Print msg-stream.
#define PRINT_ERROR(msg)
Print msg-stream as error msg.