addSuperElevation
Description
addSuperElevation(
adds or updates road banking (superelevation) at a specified point along a road. When you
use the road,distance,angle)addSuperElevation, RoadRunner checks whether a superelevation
node already exists at each specified distance. If a node exists, the function updates its
banking angle. If no node exists, the function inserts a new superelevation node.
Examples
Create a roadrunner object, specifying the path to an existing project. For example,
this code shows the path to a project, on a Windows® machine, located at "C:\RR\MyProject". This code assumes
that RoadRunner is installed in the default location, and returns an object,
rrApp, that provides functions for performing basic tasks such as
opening, closing, and saving scenes and projects.
rrApp = roadrunner(ProjectFolder="C:\RR\MyProject");newScene function, specifying the roadrunner object rrApp.
newScene(rrApp)
Create a RoadRunner authoring API object, rrAPi, that references the object
for the current RoadRunner instance rrApp. The rrApi object
enables you to programmatically author scenes, such as by adding and modifying road and
lane components, using MATLAB®.
rrApi = roadrunnerAPI(rrApp);
Extract the object for your scene from the Scene property of the authoring API object
rrApi. The extracted Scene object enables you to
specify the scene in which to add scene components, such as roads and lanes.
scn = rrApi.Scene;
Extract the object for your RoadRunner project from the Project property of the authoring API object
rrApi. The extracted Project object enables you
to specify the project folder for the current RoadRunner session from which to retrieve asset objects. You can use the asset
objects to add lane markings to the lanes in your
scene.
prj = rrApi.Project;
Use the addClothoidFitRoad function to add a new road.
Specify the position of the road by specifying the positions of its start point
startPt and end point
endPt.
startPt = [0 0 0]; endPt = [50 0 0]; rrRoad = addClothoidFitRoad(scn,[startPt; endPt]);
Extract the reference lane from the ReferenceLane property of the road
rrRoad. The extracted property ReferenceLane
defines the center line of the
road.
refLane = rrRoad.ReferenceLane;
Use the extracted refLane object to add lanes on either side of
the reference lane of the road using the addLaneToLeft and addLaneToRight
functions.
leftLane = addLaneToLeft(refLane); rightLane = addLaneToRight(refLane);
Use the getAsset function to retrieve the LaneMarkingStyle objects for a dashed solid yellow
lane marking. These objects define the lane marking assets used to mark the spans in the
lane marking profile of the reference
lane.
dashedWhiteMarkingStyle = prj.getAsset("<PROJECT>/Assets/Markings/DashedSingleWhite.rrlms","LaneMarkingStyle"); solidWhiteMarkingStyle = prj.getAsset("<PROJECT>/Assets/Markings/SolidSingleWhite.rrlms","LaneMarkingStyle");
Mark the boundaries of the lanes.
leftLaneSpan = leftLane.LaneMarkingProfile.Spans(1); leftLaneSpan.LaneMarkingStyle = solidWhiteMarkingStyle; rightLaneSpan = rightLane.LaneMarkingProfile.Spans(1); rightLaneSpan.LaneMarkingStyle = solidWhiteMarkingStyle; referenceLaneSpan = refLane.LaneMarkingProfile.Spans(1); referenceLaneSpan.LaneMarkingStyle = dashedWhiteMarkingStyle;

Access the superelevation definition of the road by extracting its property.
seCurve = rrRoad.SuperElevationCurve;
Inspect the default superelevation nodes of the road. By default, the SuperElevationCurve contains two nodes: one at the
start of the road and one at the end of the
road.
nodes = seCurve.Nodes
Apply Uniform Banking Along the Entire Road
Set the same banking angle along the entire length of a road using a single call to
addSuperElevation.
addSuperElevation(rrRoad,50,10); % 50 indicates total length of the road
Define Non-Uniform Banking Using Start and End Nodes
Assign different banking angles at the start and end of the road to create a continuous banking transition.
nodes(1).Angle = 15; nodes(end).Angle = -15;

You can also use the addSuperElevation function to define
different banking angles at the start and end of the
road.
addSuperElevation(rrRoad,0,15) % 0 indicates the start position of the road addSuperElevation(rrRoad,50,-15) % 50 indicates the end position of the road
Insert Intermediate Superelevation Nodes
Insert a new superelevation control point at a specified distance along the road.
midNode = insertNode(seCurve,25); midNode.Angle = -10;
Insert another superelevation node between the start node and your new midpoint node.
addSuperElevation(rrRoad,12,-10);

Create Multiple Banking Transitions Along the Road
Insert multiple nodes to define several banking transitions.
distances = [10 20 35]; angles = [5 -10 15]; addSuperElevation(rrRoad,distances,angles);

Input Arguments
Road to which to apply banking, specified as a Road object. The road must be a valid RoadRunner road
that supports superelevation.
Distance along the road at which to define the superelevation angle, specified as a
numeric scalar or numeric vector. Units are in meters. Distances are measured relative
to the start of the road reference line, and must lie within the range [0,
Length], where 0 is the start of the road and
Length is the total length of the road.
Specify this value as a vector to specify locations for multiple superelevation nodes at once.
Data Types: single | double
Superelevation angle, specified as a numeric scalar or numeric vector. Units are in
degrees. Valid values must lie within the range −60 to
60 degrees.
If angle is a scalar, the function applies the same banking angle
to every node indicated by distance.
If angle is a vector, it must be the same size as
distance, and each value defines the banking angle at the
corresponding distance.
Data Types: double
Version History
Introduced in R2026a
See Also
SuperElevationCurve | SuperElevationNode | SuperElevationSpan | insertNode
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)