maliput_malidrive
|
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>
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::RoadCurve * | road_curve () const |
const road_curve::Function * | reference_line_offset () const |
Lane * | AddLane (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 Junction * | junction () const |
int | num_lanes () const |
const Lane * | lane (int index) const |
Additional Inherited Members | |
Protected Member Functions inherited from Segment | |
Segment ()=default | |
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
.
id | The id of the Segment. |
road_curve | The reference curve of the Segment shared by all Lanes. It must not be nullptr. |
reference_line_offset | The road reference line offset function of the Segment shared by all Lanes. It must not be nullptr. |
p0 | The value of the \( p \) parameter of road_curve that matches the start of the Segment. |
p1 | The value of the \( p \) parameter of road_curve that matches the finish of the Segment. |
maliput::common::assertion_error | When road_curve is nullptr. |
maliput::common::assertion_error | When reference_line_offset is nullptr. |
maliput::common::assertion_error | When p0 is negative. |
maliput::common::assertion_error | When p0 is greater than p1 . |
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.
lane
s raw pointer. double p0 | ( | ) | const |
double p1 | ( | ) | const |
const road_curve::Function* reference_line_offset | ( | ) | const |
const road_curve::RoadCurve* road_curve | ( | ) | const |