Aikido
KunzRetimer.hpp
Go to the documentation of this file.
1 #ifndef AIKIDO_PLANNER_KUNZRETIMER_KUNZRETIMER_HPP_
2 #define AIKIDO_PLANNER_KUNZRETIMER_KUNZRETIMER_HPP_
3 
4 #include <Eigen/Dense>
5 
9 
10 namespace aikido {
11 namespace planner {
12 namespace kunzretimer {
13 
14 constexpr double DEFAULT_MAX_DEVIATION = 1e-2;
15 constexpr double DEFAULT_TIME_STEP = 0.1;
16 
38 std::unique_ptr<aikido::trajectory::Spline> computeKunzTiming(
39  const aikido::trajectory::Interpolated& inputTrajectory,
40  const Eigen::VectorXd& maxVelocity,
41  const Eigen::VectorXd& maxAcceleration,
42  double maxDeviation = DEFAULT_MAX_DEVIATION,
43  double timeStep = DEFAULT_TIME_STEP);
44 
48 {
49 public:
51  struct Params
52  {
57  double _maxDeviation = DEFAULT_MAX_DEVIATION,
58  double _timeStep = DEFAULT_TIME_STEP)
59  : mMaxDeviation(_maxDeviation), mTimeStep(_timeStep)
60  {
61  // Do nothing.
62  }
63 
64  double mMaxDeviation;
65  double mTimeStep;
66  };
67 
74  const Eigen::VectorXd& velocityLimits,
75  const Eigen::VectorXd& accelerationLimits,
76  double maxDeviation = DEFAULT_MAX_DEVIATION,
77  double timeStep = DEFAULT_TIME_STEP);
78 
83  const Eigen::VectorXd& velocityLimits,
84  const Eigen::VectorXd& accelerationLimits,
85  const Params& params);
86 
89  std::unique_ptr<aikido::trajectory::Spline> postprocess(
90  const aikido::trajectory::Interpolated& inputTraj,
91  const aikido::common::RNG& rng,
92  const aikido::constraint::TestablePtr& constraint = nullptr) override;
93 
96  std::unique_ptr<aikido::trajectory::Spline> postprocess(
97  const aikido::trajectory::Spline& inputTraj,
98  const aikido::common::RNG& rng,
99  const aikido::constraint::TestablePtr& constraint = nullptr) override;
100 
102  const Eigen::VectorXd& getVelocityLimits() const;
103 
105  const Eigen::VectorXd& getAccelerationLimits() const;
106 
108  void setVelocityLimits(const Eigen::VectorXd& velocityLimits);
109 
111  void setAccelerationLimits(const Eigen::VectorXd& accelerationLimits);
112 
114  double getTimeStep() const;
115 
117  void setTimeStep(double timeStep);
118 
120  double getMaxDeviation() const;
121 
123  void setMaxDeviation(double maxDeviation);
124 
125 private:
127  Eigen::VectorXd mVelocityLimits;
128 
130  Eigen::VectorXd mAccelerationLimits;
131 
134 
136  double mTimeStep;
137 };
138 
139 } // namespace kunzretimer
140 } // namespace planner
141 } // namespace aikido
142 
143 #endif // ifndef AIKIDO_PLANNER_KUNZRETIMER_KUNZRETIMER_HPP_
TrajectoryPostProcessor.hpp
aikido::planner::kunzretimer::KunzRetimer::getAccelerationLimits
const Eigen::VectorXd & getAccelerationLimits() const
Returns the acceleration limits of the dimensions.
aikido::planner::kunzretimer::KunzRetimer
Class for performing time-optimal trajectory retiming following subject to velocity and acceleration ...
Definition: KunzRetimer.hpp:47
aikido::planner::kunzretimer::KunzRetimer::mAccelerationLimits
Eigen::VectorXd mAccelerationLimits
Set to the value of accelerationLimits.
Definition: KunzRetimer.hpp:130
aikido::planner::kunzretimer::KunzRetimer::setMaxDeviation
void setMaxDeviation(double maxDeviation)
Sets the max deviation of circular blending.
aikido::planner::kunzretimer::KunzRetimer::Params::Params
Params(double _maxDeviation=DEFAULT_MAX_DEVIATION, double _timeStep=DEFAULT_TIME_STEP)
Definition: KunzRetimer.hpp:56
aikido::planner::kunzretimer::KunzRetimer::Params
Kunz postprocessor parameters.
Definition: KunzRetimer.hpp:51
aikido
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
aikido::planner::kunzretimer::KunzRetimer::getTimeStep
double getTimeStep() const
Returns the time step in following a path.
aikido::planner::kunzretimer::KunzRetimer::getMaxDeviation
double getMaxDeviation() const
Returns the max deviation of circular blending.
aikido::planner::kunzretimer::KunzRetimer::mTimeStep
double mTimeStep
Set to the value of timeStep.
Definition: KunzRetimer.hpp:136
Spline.hpp
aikido::planner::kunzretimer::KunzRetimer::getVelocityLimits
const Eigen::VectorXd & getVelocityLimits() const
Returns the velocity limits of the dimensions.
aikido::planner::kunzretimer::KunzRetimer::setVelocityLimits
void setVelocityLimits(const Eigen::VectorXd &velocityLimits)
Sets the velocity limits of the dimensions.
aikido::planner::kunzretimer::KunzRetimer::postprocess
std::unique_ptr< aikido::trajectory::Spline > postprocess(const aikido::trajectory::Interpolated &inputTraj, const aikido::common::RNG &rng, const aikido::constraint::TestablePtr &constraint=nullptr) override
Performs parabolic retiming on an input trajectory.
Interpolated.hpp
aikido::planner::kunzretimer::KunzRetimer::mVelocityLimits
Eigen::VectorXd mVelocityLimits
Set to the value of velocityLimits.
Definition: KunzRetimer.hpp:127
aikido::common::RNG
Implementation of the C++11 "random engine" concept that uses virtual function calls to erase the typ...
Definition: RNG.hpp:24
aikido::planner::kunzretimer::DEFAULT_TIME_STEP
constexpr double DEFAULT_TIME_STEP
Definition: KunzRetimer.hpp:15
aikido::planner::kunzretimer::computeKunzTiming
std::unique_ptr< aikido::trajectory::Spline > computeKunzTiming(const aikido::trajectory::Interpolated &inputTrajectory, const Eigen::VectorXd &maxVelocity, const Eigen::VectorXd &maxAcceleration, double maxDeviation=DEFAULT_MAX_DEVIATION, double timeStep=DEFAULT_TIME_STEP)
Computes the time-optimal timing of a trajectory consisting of a sequence Geodesic interpolations bet...
aikido::planner::kunzretimer::DEFAULT_MAX_DEVIATION
constexpr double DEFAULT_MAX_DEVIATION
Definition: KunzRetimer.hpp:14
aikido::planner::kunzretimer::KunzRetimer::Params::mTimeStep
double mTimeStep
Definition: KunzRetimer.hpp:65
aikido::planner::TrajectoryPostProcessor
Definition: TrajectoryPostProcessor.hpp:12
aikido::constraint::TestablePtr
std::shared_ptr< Testable > TestablePtr
Definition: Testable.hpp:13
aikido::planner::kunzretimer::KunzRetimer::Params::mMaxDeviation
double mMaxDeviation
Definition: KunzRetimer.hpp:64
aikido::planner::kunzretimer::KunzRetimer::setTimeStep
void setTimeStep(double timeStep)
Sets the time step in following a path.
aikido::planner::kunzretimer::KunzRetimer::mMaxDeviation
double mMaxDeviation
Set to the value of maxDeviation.
Definition: KunzRetimer.hpp:133
aikido::trajectory::Interpolated
Trajectory that uses an Interpolator to interpolate between waypoints.
Definition: Interpolated.hpp:14
aikido::trajectory::Spline
Polynomial spline trajectory defined in a StateSpace.
Definition: Spline.hpp:25
aikido::planner::kunzretimer::KunzRetimer::setAccelerationLimits
void setAccelerationLimits(const Eigen::VectorXd &accelerationLimits)
Sets the acceleration limits of the dimensions.
aikido::planner::kunzretimer::KunzRetimer::KunzRetimer
KunzRetimer(const Eigen::VectorXd &velocityLimits, const Eigen::VectorXd &accelerationLimits, double maxDeviation=DEFAULT_MAX_DEVIATION, double timeStep=DEFAULT_TIME_STEP)