1#ifndef ROBOTOC_SOLUTION_INTERPOLATOR_HPP_
2#define ROBOTOC_SOLUTION_INTERPOLATOR_HPP_
80 bool has_stored_solution_;
82 int findStoredGridIndexAtImpactByTime(
const double t)
const {
83 const int N = stored_time_discretization_.
size() - 1;
84 constexpr double eps = 1.0e-06;
85 for (
int i=1; i<N; ++i) {
94 int findStoredGridIndexAtLiftByTime(
const double t)
const {
95 const int N = stored_time_discretization_.
size() - 1;
96 constexpr double eps = 1.0e-06;
97 for (
int i=1; i<N; ++i) {
106 int findStoredGridIndexBeforeTime(
const double t)
const {
107 if (t < stored_time_discretization_[0].t)
return -1;
108 const int N = stored_time_discretization_.
size() - 1;
109 for (
int i=0; i<N; ++i) {
110 if (t < stored_time_discretization_[i+1].t) {
122 static void interpolate(
const Robot& robot,
const SplitSolution& s1,
123 const SplitSolution& s2,
const double alpha,
126 static void interpolatePartial(
const Robot& robot,
const SplitSolution& s1,
127 const SplitSolution& s2,
const double alpha,
130 static void initEventSolution(
const Robot& robot,
const SplitSolution& s1,
131 const SplitSolution& s2,
const double alpha,
134 static void modifyImpactSolution(SplitSolution& s);
136 static void modifyTerminalSolution(SplitSolution& s);
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
Solution interpolator.
Definition: solution_interpolator.hpp:17
bool hasStoredSolution() const
Check if this has a stored solution.
Definition: solution_interpolator.hpp:74
~SolutionInterpolator()=default
Default destructor.
SolutionInterpolator(const SolutionInterpolator &)=default
Default copy constructor.
void store(const TimeDiscretization &time_discretization, const Solution &solution)
Stores the current time discretization and solution.
SolutionInterpolator(SolutionInterpolator &&) noexcept=default
Default move constructor.
SolutionInterpolator & operator=(const SolutionInterpolator &)=default
Default copy assign operator.
void setInterpolationOrder(const InterpolationOrder order)
void interpolate(const Robot &robot, const TimeDiscretization &time_discretization, Solution &solution) const
Interpolates the solution.
SolutionInterpolator(const InterpolationOrder order=InterpolationOrder::Linear)
Constructor.
Time discretization of the optimal control problem.
Definition: time_discretization.hpp:20
int size() const
Returns the number of grids.
Definition: time_discretization.hpp:75
bool isApprox(const double x, const double y, const double eps=std::sqrt(std::numeric_limits< double >::epsilon()))
Definition: numerics.hpp:10
Definition: constraint_component_base.hpp:17
aligned_vector< SplitSolution > Solution
Solution to the optimal control problem.
Definition: solution.hpp:16
InterpolationOrder
Order of the interpolation.
Definition: interpolation_order.hpp:10