maliput_multilane
|
Convenient builder class which makes it easy to construct a multilane road network.
multilane is a simple road-network implementation:
The Builder class simplifies the assembly of multilane road network components into a valid RoadGeometry. In the Builder model, an Endpoint specifies a point in world coordinates (along with a direction, slope, and superelevation parameters). A Connection is a path from an explicit start Endpoint to an end Endpoint calculated via a linear (LineOffset) or arc displacement (ArcOffset). A Group is a collection of Connections.
Builder::Build() constructs a RoadGeometry. Each Connection yields a Segment bearing multiple Lanes. Each Group yields a Junction containing the Segments associated with the grouped Connections; ungrouped Connections each receive their own Junction.
At Endpoints where theta_dot (i.e. the rate of change of superelevation with respect to an arc-length coordinate t that travels along the Connection curve’s projection over the z = 0 plane) has not been explicitly specified the Builder will automatically calculate theta_dot values to preserve G1 continuity across Connections. theta_dot values can only be explicitly specified for a Connection created from a reference curve with an explicit start or end Endpoint. However, specifying an explicit theta_dot may cause Builder::Build() to throw if it cannot assemble a G1 continuous RoadGeometry.
Specific suffixes are used to name Maliput entities. The following list explains the naming convention:
#include <include/maliput_multilane/builder.h>
Public Member Functions | |
Builder (double lane_width, const api::HBounds &elevation_bounds, double linear_tolerance, double angular_tolerance, double scale_length, ComputationPolicy computation_policy, std::unique_ptr< GroupFactoryBase > group_factory) | |
Constructs a Builder which can be used to specify and assemble a multilane implementation of an api::RoadGeometry. More... | |
double | get_lane_width () const override |
Gets lane_width value. More... | |
const api::HBounds & | get_elevation_bounds () const override |
Gets elevation_bounds value. More... | |
double | get_linear_tolerance () const override |
Gets linear_tolerance value. More... | |
double | get_angular_tolerance () const override |
Gets angular_tolerance value. More... | |
double | get_scale_length () const override |
Gets scale_length value. More... | |
ComputationPolicy | get_computation_policy () const override |
Gets computation_policy value. More... | |
const Connection * | Connect (const std::string &id, const LaneLayout &lane_layout, const StartReference::Spec &start_spec, const LineOffset &line_offset, const EndReference::Spec &end_spec) override |
Connects start_spec 's Endpoint to an end-point linearly displaced from start_spec 's Endpoint. More... | |
const Connection * | Connect (const std::string &id, const LaneLayout &lane_layout, const StartReference::Spec &start_spec, const ArcOffset &arc_offset, const EndReference::Spec &end_spec) override |
Connects start_spec 's Endpoint to an end-point displaced from start_spec 's Endpoint via an arc. More... | |
const Connection * | Connect (const std::string &id, const LaneLayout &lane_layout, const StartLane::Spec &start_spec, const LineOffset &line_offset, const EndLane::Spec &end_spec) override |
Creates a Connection whose planar reference curve is a line. More... | |
const Connection * | Connect (const std::string &id, const LaneLayout &lane_layout, const StartLane::Spec &start_spec, const ArcOffset &arc_offset, const EndLane::Spec &end_spec) override |
Creates a Connection whose planar reference curve is an arc. More... | |
void | SetDefaultBranch (const Connection *in, int in_lane_index, const api::LaneEnd::Which in_end, const Connection *out, int out_lane_index, const api::LaneEnd::Which out_end) override |
Sets the default branch for one end of a connection. More... | |
Group * | MakeGroup (const std::string &id) override |
Creates a new empty connection group with ID string id . More... | |
Group * | MakeGroup (const std::string &id, const std::vector< const Connection * > &connections) override |
Creates a new connection group with ID id , populated with the given connections . More... | |
std::unique_ptr< const api::RoadGeometry > | Build (const api::RoadGeometryId &id) const override |
Produces a RoadGeometry, with the ID id . More... | |
![]() | |
BuilderBase ()=default | |
virtual | ~BuilderBase ()=default |
Builder | ( | double | lane_width, |
const api::HBounds & | elevation_bounds, | ||
double | linear_tolerance, | ||
double | angular_tolerance, | ||
double | scale_length, | ||
ComputationPolicy | computation_policy, | ||
std::unique_ptr< GroupFactoryBase > | group_factory | ||
) |
Constructs a Builder which can be used to specify and assemble a multilane implementation of an api::RoadGeometry.
lane_width
is the width assigned to all Lanes. It must be greater or equal to zero. Lane reference path (which are offsets of parent Segment reference curve) are centered within the Lane. Lane spacing will be lane_width
too. Segment extents will be derived from the composition of left and right shoulders, number of lanes and lane spacing. The elevation_bounds
is applied uniformly to all lanes of every segment. linear_tolerance
and angular_tolerance
specify the respective tolerances for the resulting RoadGeometry. scale_length
constrains the maximum level of detail captured by the resulting RoadGeometry. computation_policy
sets the speed vs. accuracy balance for computations. group_factory
allows to create groups.
|
overridevirtual |
Produces a RoadGeometry, with the ID id
.
maliput::common::assertion_error | if unable to produce a valid (i.e. G1) RoadGeometry. |
Implements BuilderBase.
|
overridevirtual |
Creates a Connection whose planar reference curve is an arc.
start_spec.lane_id()
lane starts at start_spec.endpoint()
and end_spec.lane_id()
lane ends with end_spec.endpoint_z()
which specifies the elevation characteristics.
arc_offset
specifies the shape of the arc.
lane_layout
defines the number of lanes, their width, extra shoulder asphalt extensions and placing with respect to connection's reference curve.
Implements BuilderBase.
|
overridevirtual |
Creates a Connection whose planar reference curve is a line.
start_spec.lane_id()
lane starts at start_spec.endpoint()
and end_spec.lane_id()
lane ends with end_spec.endpoint_z()
which specifies the elevation characteristics.
line_offset
specifies the length of displacement (in the direction of the heading of start_spec
's Endpoint).
lane_layout
defines the number of lanes, their width, extra shoulder asphalt extensions and placing with respect to connection's reference curve.
Implements BuilderBase.
|
overridevirtual |
Connects start_spec
's Endpoint to an end-point displaced from start_spec
's Endpoint via an arc.
arc_offset
specifies the shape of the arc. end_spec
specifies the elevation characteristics at the end-point.
lane_layout
defines the number of lanes, their width, extra shoulder asphalt extensions and placing with respect to connection's reference curve.
Implements BuilderBase.
|
overridevirtual |
Connects start_spec
's Endpoint to an end-point linearly displaced from start_spec
's Endpoint.
line_offset
specifies the length of displacement (in the direction of the heading of start_spec
's Endpoint). end_spec
specifies the elevation characteristics at the end-point.
lane_layout
defines the number of lanes, their width, extra shoulder asphalt extensions and placing with respect to connection's reference curve.
Implements BuilderBase.
|
overridevirtual |
Gets angular_tolerance
value.
Implements BuilderBase.
|
overridevirtual |
Gets computation_policy
value.
Implements BuilderBase.
|
overridevirtual |
Gets elevation_bounds
value.
Implements BuilderBase.
|
overridevirtual |
Gets lane_width
value.
Implements BuilderBase.
|
overridevirtual |
Gets linear_tolerance
value.
Implements BuilderBase.
|
overridevirtual |
Gets scale_length
value.
Implements BuilderBase.
|
overridevirtual |
Creates a new empty connection group with ID string id
.
Implements BuilderBase.
|
overridevirtual |
Creates a new connection group with ID id
, populated with the given connections
.
Implements BuilderBase.
|
overridevirtual |
Sets the default branch for one end of a connection.
The default branch for the in_end
of connection in
at Lane in_lane_index
will set to be out_end
of connection out
at Lane out_lane_index
. The specified connections must actually be joined at the specified ends (i.e., the Endpoint's for those ends must be coincident and (anti)parallel within the tolerances for the Builder).
Implements BuilderBase.