maliput_multilane
Connection Class Reference

Detailed Description

Representation of a reference path connecting two endpoints.

Upon building the RoadGeometry, a Connection yields a Segment bearing multiple Lanes with offsets from the reference path. The Segment will belong to its own Junction, unless the Connection was grouped with other Connections into a Group.

Two connection geometries are supported: line and arc. These primitives determine the projection of the reference path onto the (locally-flat) plane of the earth. The out-of-plane shape of the path will be determined by the EndpointZ (elevation) parameters of the endpoints.

#include <include/maliput_multilane/connection.h>

Public Types

enum  Type { kLine, kArc }
 Possible connection geometries: line- or arc-segment. More...
 

Public Member Functions

 ~Connection ()
 
 Connection (const std::string &id, const Endpoint &start, const EndpointZ &end_z, int num_lanes, double r0, double lane_width, double left_shoulder, double right_shoulder, const LineOffset &line_offset, double linear_tolerance, double scale_length, ComputationPolicy computation_policy)
 Constructs a line-segment connection. More...
 
 Connection (const std::string &id, const Endpoint &start, const EndpointZ &end_z, int num_lanes, double r0, double lane_width, double left_shoulder, double right_shoulder, const ArcOffset &arc_offset, double linear_tolerance, double scale_length, ComputationPolicy computation_policy)
 Constructs an arc-segment connection. More...
 
Type type () const
 Returns the geometric type of the path. More...
 
const std::string & id () const
 Returns the ID string. More...
 
const Endpointstart () const
 Returns the parameters of the start point. More...
 
const Endpointend () const
 Returns the parameters of the endpoint. More...
 
double line_length () const
 Returns the length of the line (for line connections only). More...
 
double radius () const
 Returns the radius of the arc (for arc connections only). More...
 
double d_theta () const
 Returns the angle of the arc (for arc connections only). More...
 
int num_lanes () const
 Returns the number of lanes the Segment will contain. More...
 
double r0 () const
 Returns the lateral offset from the reference curve to the first Lane centerline. More...
 
double lane_width () const
 Returns lanes' width. More...
 
double left_shoulder () const
 Returns the left shoulder distance of the segment. More...
 
double right_shoulder () const
 Returns the right shoulder distance of the segment. More...
 
double lane_offset (int lane_index) const
 Returns lane_index lane lateral distance to the reference curve. More...
 
double r_min () const
 Returns the distance from the reference curve to the right extent of the Segment. More...
 
double r_max () const
 Returns the distance from the reference curve to the left extent of the Segment. More...
 
double linear_tolerance () const
 Returns the linear tolerance, in meters, that applies to RoadCurve instances as constructed by this Connection. More...
 
double scale_length () const
 Returns the scale length, in meters, that applies to RoadCurve instances as constructed by this Connection. More...
 
ComputationPolicy computation_policy () const
 Returns the computation policy that applies to RoadCurve instances as constructed by this Connection. More...
 
Endpoint LaneStart (int lane_index) const
 Returns an Endpoint describing the start of the lane_index lane. More...
 
Endpoint LaneEnd (int lane_index) const
 Returns an Endpoint describing the end of the lane_index lane. More...
 

Member Enumeration Documentation

◆ Type

enum Type

Possible connection geometries: line- or arc-segment.

Enumerator
kLine 
kArc 

Constructor & Destructor Documentation

◆ ~Connection()

~Connection ( )

◆ Connection() [1/2]

Connection ( const std::string &  id,
const Endpoint start,
const EndpointZ end_z,
int  num_lanes,
double  r0,
double  lane_width,
double  left_shoulder,
double  right_shoulder,
const LineOffset line_offset,
double  linear_tolerance,
double  scale_length,
ComputationPolicy  computation_policy 
)

Constructs a line-segment connection.

Segment's reference curve begins at start and extends on the plane z=0 line_offset.length() distance with start.xy().heading() heading angle. end_z will be used to build elevation and superelevation information of the road.

line_offset holds the length of the line.

Segments will contain num_lanes lanes, which must be greater than zero. First Lane centerline will be placed at r0 distance from the reference curve. Each lane's width will be lane_width, which should be greater or equal to zero.

left_shoulder and right_shoulder are extra spaces added to the right and left side of the first and last lanes of the Segment. They will be added to Segment's bounds and must be greater or equal to zero.

scale_length constrains the maximum level of detail captured by the underlying RoadCurve.

linear_tolerance and computation_policy set the efficiency vs. speed balance for computations in the underlying RoadCurve.

◆ Connection() [2/2]

Connection ( const std::string &  id,
const Endpoint start,
const EndpointZ end_z,
int  num_lanes,
double  r0,
double  lane_width,
double  left_shoulder,
double  right_shoulder,
const ArcOffset arc_offset,
double  linear_tolerance,
double  scale_length,
ComputationPolicy  computation_policy 
)

Constructs an arc-segment connection.

Segment's reference curve begins at start and extends on the plane z=0 with arc_offset.radius() and angle span of arc_offset.d_theta(). end_z will be used to build elevation and superelevation information of the road.

arc_offset.radius() must be positive. arc_offset.d_theta() > 0 indicates a counterclockwise arc from start with initial heading angle start.heading().

Segments will contain num_lanes lanes, which must be greater than zero. First Lane centerline will be placed at r0 distance from the reference curve. Each lane's width will be lane_width, which should be greater or equal to zero.

left_shoulder and right_shoulder are extra spaces added to the right and left side of the first and last lanes of the Segment. They will be added to Segment's bounds and must be greater or equal to zero.

linear_tolerance applies to all RoadCurve-level computations. It must be positive.

scale_length constrains the maximum level of detail captured by the underlying RoadCurve. It must be positive.

computation_policy sets the speed vs. accuracy for computations in the underlying RoadCurve.

Member Function Documentation

◆ computation_policy()

ComputationPolicy computation_policy ( ) const

Returns the computation policy that applies to RoadCurve instances as constructed by this Connection.

Refer to RoadCurve class documentation for further details.

◆ d_theta()

double d_theta ( ) const

Returns the angle of the arc (for arc connections only).

◆ end()

const Endpoint & end ( ) const

Returns the parameters of the endpoint.

◆ id()

const std::string & id ( ) const

Returns the ID string.

◆ lane_offset()

double lane_offset ( int  lane_index) const

Returns lane_index lane lateral distance to the reference curve.

lane_index must be non-negative and smaller than the number of lanes of this connection.

◆ lane_width()

double lane_width ( ) const

Returns lanes' width.

◆ LaneEnd()

Endpoint LaneEnd ( int  lane_index) const

Returns an Endpoint describing the end of the lane_index lane.

◆ LaneStart()

Endpoint LaneStart ( int  lane_index) const

Returns an Endpoint describing the start of the lane_index lane.

◆ left_shoulder()

double left_shoulder ( ) const

Returns the left shoulder distance of the segment.

◆ line_length()

double line_length ( ) const

Returns the length of the line (for line connections only).

◆ linear_tolerance()

double linear_tolerance ( ) const

Returns the linear tolerance, in meters, that applies to RoadCurve instances as constructed by this Connection.

Refer to RoadCurve class documentation for further details.

◆ num_lanes()

int num_lanes ( ) const

Returns the number of lanes the Segment will contain.

◆ r0()

double r0 ( ) const

Returns the lateral offset from the reference curve to the first Lane centerline.

◆ r_max()

double r_max ( ) const

Returns the distance from the reference curve to the left extent of the Segment.

◆ r_min()

double r_min ( ) const

Returns the distance from the reference curve to the right extent of the Segment.

◆ radius()

double radius ( ) const

Returns the radius of the arc (for arc connections only).

◆ right_shoulder()

double right_shoulder ( ) const

Returns the right shoulder distance of the segment.

◆ scale_length()

double scale_length ( ) const

Returns the scale length, in meters, that applies to RoadCurve instances as constructed by this Connection.

Refer to RoadCurve class documentation for further details.

◆ start()

const Endpoint & start ( ) const

Returns the parameters of the start point.

◆ type()

Connection::Type type ( ) const

Returns the geometric type of the path.


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