maliput_malidrive
Segment Class Reference

Detailed Description

Segment implementation that holds a road_curve::RoadCurve.

Child MalidriveLanes of this segment will be constructed as offsets of the reference curve.

#include <src/maliput_malidrive/base/segment.h>

Inheritance diagram for Segment:
[legend]

Public Member Functions

 Segment (const maliput::api::SegmentId &id, const road_curve::RoadCurve *road_curve, const road_curve::Function *reference_line_offset, double p0, double p1)
 Constructs a Segment. More...
 
double p0 () const
 
double p1 () const
 
const road_curve::RoadCurveroad_curve () const
 
const road_curve::Functionreference_line_offset () const
 
LaneAddLane (std::unique_ptr< Lane > lane, bool hide_lane)
 Adds lane to the segment. More...
 
- Public Member Functions inherited from Segment
 MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN (Segment)
 
 Segment (const api::SegmentId &id)
 
T * AddLane (std::unique_ptr< T > lane)
 
void AttachToJunction (common::Passkey< Junction >, const api::Junction *junction)
 
void SetLaneIndexingCallback (common::Passkey< Junction >, const std::function< void(const api::Lane *)> &callback)
 
 ~Segment () override=default
 
- Public Member Functions inherited from Segment
SegmentId id () const
 
const Junctionjunction () const
 
int num_lanes () const
 
const Lanelane (int index) const
 

Additional Inherited Members

- Protected Member Functions inherited from Segment
 Segment ()=default
 

Constructor & Destructor Documentation

◆ Segment()

Segment ( const maliput::api::SegmentId id,
const road_curve::RoadCurve road_curve,
const road_curve::Function reference_line_offset,
double  p0,
double  p1 
)

Constructs a Segment.

The incidence region of the Segment on the road_curve will be delimited by the range composed by p0 and p1.

Parameters
idThe id of the Segment.
road_curveThe reference curve of the Segment shared by all Lanes. It must not be nullptr.
reference_line_offsetThe road reference line offset function of the Segment shared by all Lanes. It must not be nullptr.
p0The value of the \( p \) parameter of road_curve that matches the start of the Segment.
p1The value of the \( p \) parameter of road_curve that matches the finish of the Segment.
Exceptions
maliput::common::assertion_errorWhen road_curve is nullptr.
maliput::common::assertion_errorWhen reference_line_offset is nullptr.
maliput::common::assertion_errorWhen p0 is negative.
maliput::common::assertion_errorWhen p0 is greater than p1.

Member Function Documentation

◆ AddLane()

Lane* AddLane ( std::unique_ptr< Lane lane,
bool  hide_lane 
)

Adds lane to the segment.

If hide_lane is false, the call is forwarded to maliput::geometry_base::Segment::AddLane. If hide_lane is true, the segment becomes the lane's owner but the lane is hidden. This behavior is needed to correctly compute the offset of the lanes when the non-drivable lanes are omitted from the Road Network.

Returns
lanes raw pointer.

◆ p0()

double p0 ( ) const
Returns
The lower bound range of \( p \).

◆ p1()

double p1 ( ) const
Returns
The upper bound range of \( p \).

◆ reference_line_offset()

const road_curve::Function* reference_line_offset ( ) const
Returns
The reference line offset function.

◆ road_curve()

const road_curve::RoadCurve* road_curve ( ) const
Returns
The reference curve.

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