Class Motion

Class Documentation

class Motion

Pure abstract interface for describing a continuous motion.

Public Functions

virtual Time start_time() const = 0

Get the lower bound on the time range where this motion is valid.

virtual Time finish_time() const = 0

Get the upper bound on the time range where this motion is valid.

virtual Eigen::Vector3d compute_position(Time t) const = 0

Get the position of this motion at a point in time.

Parameters:

t[in] The time of interest. This time must be in the range [start_time(), finish_time()], or else the output is undefined and may result in an exception.

virtual Eigen::Vector3d compute_velocity(Time t) const = 0

Get the velocity of this motion at a point in time.

Parameters:

t[in] The time of interest. This time must be in the range [start_time(), finish_time()], or else the output is undefined and may result in an exception.

virtual Eigen::Vector3d compute_acceleration(Time t) const = 0

Get the acceleration of this motion at a point in time.

Parameters:

t[in] The time of interest. This time must be in the range [start_time(), finish_time()], or else the output is undefined and may result in an exception.

virtual ~Motion() = default

Public Static Functions

static std::unique_ptr<Motion> compute_cubic_splines(const Trajectory::const_iterator &begin, const Trajectory::const_iterator &end)

Compute a piecewise cubic spline motion object for a Trajectory from the begin iterator up to (but not including) the end iterator.

Parameters:
  • begin[in] The iterator of the first waypoint to include in the motion. It is undefined behavior to pass in Trajectory::end() for this argument.

  • end[in] The iterator of the first waypoint to exclude from the motion. To include all the way to the end of the trajectory, pass in Trajectory::end(). An exception will be thrown if begin == end.

static std::unique_ptr<Motion> compute_cubic_splines(const Trajectory &trajectory)

Compute a piecewise cubic spline motion object for an entire Trajectory.