Drake
Curve2< T > Class Template Reference

Curve2 represents a path through two-dimensional Cartesian space. More...

#include <drake/automotive/curve2.h>

## Classes

struct  PositionResult
A result type for the GetPosition method. More...

## Public Types

typedef Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Point2
A two-dimensional Cartesian point that is alignment-safe. More...

typedef Eigen::Matrix< T, 2, 1, Eigen::DontAlign > Point2T

## Public Member Functions

Curve2 (const std::vector< Point2 > &waypoints)
Constructor that traces through the given waypoints in order. More...

const std::vector< Point2 > & waypoints () const

double path_length () const

PositionResult GetPosition (const T &path_distance) const
Returns the Curve's PositionResult::position at path_distance, as well as its first derivative PositionResult::position_dot with respect to path_distance. More...

Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
Curve2 (const Curve2 &)=default

Curve2operator= (const Curve2 &)=default

Curve2 (Curve2 &&)=default

Curve2operator= (Curve2 &&)=default

## Detailed Description

### template<typename T> class drake::automotive::Curve2< T >

Curve2 represents a path through two-dimensional Cartesian space.

Given a list of waypoints, it traces a path between them.

Instantiated templates for the following kinds of T's are provided:

TODO(jwnimmer-tri) We will soon trace the path using a spline, but for now it's easiest to just interpolate straight segments, as a starting point. Callers should not yet rely on how we are traversing between the waypoints.

## ◆ Point2

 typedef Eigen::Matrix Point2

A two-dimensional Cartesian point that is alignment-safe.

## ◆ Point2T

 typedef Eigen::Matrix Point2T

## ◆ Curve2() [1/3]

 Curve2 ( const Curve2< T > & )
default

## ◆ Curve2() [2/3]

 Curve2 ( Curve2< T > && )
default

## ◆ Curve2() [3/3]

 Curve2 ( const std::vector< Point2 > & waypoints )
inlineexplicit

Constructor that traces through the given waypoints in order.

Exceptions
 std::exception if waypoints.size() == 1.

## ◆ GetPosition()

 PositionResult GetPosition ( const T & path_distance ) const
inline

Returns the Curve's PositionResult::position at path_distance, as well as its first derivative PositionResult::position_dot with respect to path_distance.

The path_distance is clipped to the ends of the curve:

• A negative path_distance is interpreted as a path_distance of zero.
• A path_distance that exceeds the path_length() of the curve is interpreted as a path_distance equal to the path_length().

The position_dot derivative, when evaluated exactly at a waypoint, will be congruent with the direction of one of the (max two) segments that neighbor the waypoint. (At the first and last waypoints, there is only one neighboring segment.) TODO(jwnimmer-tri) This will no longer be true once this class uses a spline.

## ◆ operator=() [1/2]

 Curve2& operator= ( Curve2< T > && )
default

## ◆ operator=() [2/2]

 Curve2& operator= ( const Curve2< T > & )
default

## ◆ path_length()

 double path_length ( ) const
inline
Returns
the length of this curve (the total distance traced).

## ◆ waypoints()

 const std::vector& waypoints ( ) const
inline
Returns
the waypoints associated with this curve.

The documentation for this class was generated from the following file: