Drake
Connection Class Reference

A container that holds the information needed by a Builder to construct one or more Lane objects. More...

#include <drake/automotive/maliput/rndf/connection.h>

## Public Member Functions

Connection (const std::string &id, const std::vector< DirectedWaypoint > &waypoints, double width, bool inverse_direction)
Constructs a Connection. More...

const std::string & id () const
Getter of the ID. More...

const DirectedWaypointstart () const
Getter of the first item in the vector returned by waypoints(). More...

const DirectedWaypointend () const
Getter of the last item in the vector returned by waypoints(). More...

const std::vector< DirectedWaypoint > & waypoints () const
Getter of the DirectedWaypoint vector. More...

void set_waypoints (const std::vector< DirectedWaypoint > &waypoints)
Setter of the DirectedWaypoint vector. More...

void AddWaypoint (const DirectedWaypoint &waypoint, int position)
Adds a waypoint to the DirectedWaypoint vector at position index. More...

double width () const
Getter for the width. More...

void set_width (double width)
Setter for the width. More...

bool inverse_direction () const
Getter of inverse_direction. More...

void set_inverse_direction (bool inverse_direction)
Setter of inverse_direction. More...

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

Connectionoperator= (const Connection &)=default

Connection (Connection &&)=default

Connectionoperator= (Connection &&)=default

## Detailed Description

A container that holds the information needed by a Builder to construct one or more Lane objects.

This class will be created from a vector of DirectedWaypoint objects (based on RNDF waypoints that belong to the same RNDF lane).

A Connection object derives one or multiple Lane objects. Consequently the list of waypoints must have at least two valid (related to the DirectedWaypoint's ignition::rndf::UniqueId) waypoints to derive an interpolated geometry from them. The order the waypoints are set is the way they will be used so create an interpolated curve (base line of the Lane). Lane's width is fixed along the complete path length. Builder class will receive a group of Connections that belong to the same RNDF segment. Note that RNDF, unlike Maliput, has no constraint on lane direction inside a segment, so Connections should be marked (using the constructor's inverse_direction parameter) so they can be grouped by sense of direction. To define the direction, one of the Connections in the group will be flagged as the reference, and an interpolated spline is computed from the the DirectedWaypoints within the reference Connection to obtain the tangent information.

## Constructor & Destructor Documentation

 Connection ( const Connection & )
default
 Connection ( Connection && )
default
 Connection ( const std::string & id, const std::vector< DirectedWaypoint > & waypoints, double width, bool inverse_direction )
inline

Constructs a Connection.

Parameters
 id Connection's ID. waypoints A DirectedWaypoints vector that determines the lane path. width The Lane's width. inverse_direction False if this Connection belongs to a group of Connections and the sense of direction of this Connection is the same as the first Connection in the group. The first Connection will be set False as default.
Exceptions
 std::runtime_error When the number of waypoints items, whose ignition::rndf::UniqueId is valid, is less than 2. std::runtime_error When the width is less or equal to 0.0.

## Member Function Documentation

 void AddWaypoint ( const DirectedWaypoint & waypoint, int position )

Adds a waypoint to the DirectedWaypoint vector at position index.

Parameters
 waypoint A DirectedWaypoint to add. position The index in the DirectedWaypoint vector at which waypoint should be added.
Exceptions
 std::runtime_error When position is less than 0. std::runtime_error When position is greater than the size of the DirectedWaypoint vector.

Here is the caller graph for this function:

 const DirectedWaypoint& end ( ) const
inline

Getter of the last item in the vector returned by waypoints().

Returns
A constant reference to the last item in the vector returned by waypoints().

Here is the caller graph for this function:

 const std::string& id ( ) const
inline

Getter of the ID.

Returns
The ID.
 bool inverse_direction ( ) const
inline

Getter of inverse_direction.

Returns
true when this Connection has inverse direction relative to the base Lane in the RNDF segment to which this Connection belongs, and false otherwise.

Here is the caller graph for this function:

 Connection& operator= ( Connection && )
default
 Connection& operator= ( const Connection & )
default
 void set_inverse_direction ( bool inverse_direction )
inline

Setter of inverse_direction.

inverse_direction The relative direction regarding another Connection which will be considered as the reference direction for the RNDF segment.

Here is the call graph for this function:

Here is the caller graph for this function:

 void set_waypoints ( const std::vector< DirectedWaypoint > & waypoints )
inline

Setter of the DirectedWaypoint vector.

Parameters
 waypoints A vector of DirectedWaypoints.
Exceptions
 std::runtime_error When waypoints holds less than two valid DirectedWaypoints.

Here is the call graph for this function:

Here is the caller graph for this function:

 void set_width ( double width )
inline

Setter for the width.

Parameters
 width The absolute span from one lateral extent to the other of the api::Lane that the Builder will make from this Connection.
Exceptions
 std::runtime_error When width is less or equal to zero.

Here is the call graph for this function:

Here is the caller graph for this function:

 const DirectedWaypoint& start ( ) const
inline

Getter of the first item in the vector returned by waypoints().

Returns
A constant reference to the first item in the vector returned by waypoints().

Here is the caller graph for this function:

 const std::vector& waypoints ( ) const
inline

Getter of the DirectedWaypoint vector.

Returns
The DirectedWaypoint vector.

Here is the caller graph for this function:

 double width ( ) const
inline

Getter for the width.

Returns
The width.

Here is the caller graph for this function:

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