Drake
piecewise_polynomial_trajectory.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <vector>
5 
6 #include <Eigen/Core>
7 
10 
11 namespace drake {
12 
18  public:
23  : pp_(pp) {}
24 
25  std::unique_ptr<Trajectory> Clone() const override {
26  return std::make_unique<PiecewisePolynomialTrajectory>(pp_);
27  }
28 
35  drake::MatrixX<double> value(double t) const override {
36  return pp_.value(t);
37  }
38 
47  std::unique_ptr<Trajectory> derivative(
48  int derivative_order = 1) const override {
49  return std::make_unique<PiecewisePolynomialTrajectory>(
50  pp_.derivative(derivative_order));
51  }
52 
57  Eigen::Index rows() const override { return pp_.rows(); }
58 
63  Eigen::Index cols() const override { return pp_.cols(); }
64 
65 
66  double get_start_time() const override { return pp_.getStartTime(); }
67 
68  double get_end_time() const override { return pp_.getEndTime(); }
69 
74  return pp_;
75  }
76 
77  private:
79 };
80 
81 } // namespace drake
A PiecewisePolynomialTrajectory is a Trajectory that is represented by (implemented in terms of) a Pi...
Definition: piecewise_polynomial_trajectory.h:17
Eigen::Index rows() const override
Definition: piecewise_polynomial_trajectory.h:57
double getStartTime(int segment_number) const
Definition: piecewise_function.cc:37
double get_start_time() const override
Definition: piecewise_polynomial_trajectory.h:66
const PiecewisePolynomial< double > & get_piecewise_polynomial() const
Definition: piecewise_polynomial_trajectory.h:73
A Trajectory represents a time-varying matrix of doubles.
Definition: trajectory.h:14
Definition: automotive_demo.cc:88
PiecewisePolynomialTrajectory(const PiecewisePolynomial< double > &pp)
Construct a PiecewisePolynomialTrajectory from a PiecewisePolynomial.
Definition: piecewise_polynomial_trajectory.h:22
drake::MatrixX< double > value(double t) const override
Evaluate this PiecewisePolynomial at a particular time.
Definition: piecewise_polynomial_trajectory.h:35
double getEndTime(int segment_number) const
Definition: piecewise_function.cc:42
std::unique_ptr< Trajectory > derivative(int derivative_order=1) const override
Takes the derivative of this PiecewisePolynomialTrajectory.
Definition: piecewise_polynomial_trajectory.h:47
Eigen::Index cols() const override
Definition: piecewise_polynomial.cc:321
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > MatrixX
A matrix of dynamic size, templated on scalar type.
Definition: eigen_types.h:87
Eigen::Index rows() const override
Definition: piecewise_polynomial.cc:312
std::unique_ptr< Trajectory > Clone() const override
Definition: piecewise_polynomial_trajectory.h:25
double get_end_time() const override
Definition: piecewise_polynomial_trajectory.h:68
PiecewisePolynomial derivative(int derivative_order=1) const
Takes the derivative of this PiecewisePolynomial.
Definition: piecewise_polynomial.cc:49
drake::MatrixX< double > value(double t) const
Evaluates the PiecewisePolynomial at the given time t.
Definition: piecewise_polynomial.cc:109
Eigen::Index cols() const override
Definition: piecewise_polynomial_trajectory.h:63