Drake
trajectory.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 
5 #include <Eigen/Core>
6 
8 
9 namespace drake {
10 
11 /**
12  * A Trajectory represents a time-varying matrix of doubles.
13  */
14 class Trajectory {
15  public:
16  virtual ~Trajectory() {}
17 
18  /**
19  *
20  * @return A deep copy of this Trajectory.
21  */
22  virtual std::unique_ptr<Trajectory> Clone() const = 0;
23 
24  /**
25  * Evaluates the trajectory at the given time \p t.
26  * @param t The time at which to evaluate the trajectory.
27  * @return The matrix of evaluated values.
28  */
29  virtual drake::MatrixX<double> value(double t) const = 0;
30 
31  /**
32  * Takes the derivative of this Trajectory.
33  * @param derivative_order The number of times to take the derivative before
34  * returning.
35  * @return The nth derivative of this object.
36  */
37  virtual std::unique_ptr<Trajectory> derivative(
38  int derivative_order = 1) const = 0;
39 
40  /**
41  * @return The number of rows in the matrix returned by value().
42  */
43  virtual Eigen::Index rows() const = 0;
44 
45  /**
46  * @return The number of columns in the matrix returned by value().
47  */
48  virtual Eigen::Index cols() const = 0;
49 
50  virtual double get_start_time() const = 0;
51  virtual double get_end_time() const = 0;
52 };
53 
54 } // namespace drake
virtual drake::MatrixX< double > value(double t) const =0
Evaluates the trajectory at the given time t.
virtual Eigen::Index rows() const =0
This file contains abbreviated definitions for certain specializations of Eigen::Matrix that are comm...
virtual Eigen::Index cols() const =0
A Trajectory represents a time-varying matrix of doubles.
Definition: trajectory.h:14
Definition: automotive_demo.cc:88
virtual std::unique_ptr< Trajectory > Clone() const =0
virtual ~Trajectory()
Definition: trajectory.h:16
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > MatrixX
A matrix of dynamic size, templated on scalar type.
Definition: eigen_types.h:87
virtual double get_start_time() const =0
virtual std::unique_ptr< Trajectory > derivative(int derivative_order=1) const =0
Takes the derivative of this Trajectory.
virtual double get_end_time() const =0