Point
R2026bDescription
The Point object represents a point in the current RoadRunner scenario. Points define location and orientation data for other scenario
objects, such as actors. You can also use multiple points to design and modify the shape and
position of a route. You can use a Point object to modify the attributes of
points within your scenario.
Creation
To retrieve a Point object from your RoadRunner scenario, extract the InitialPoint or
Point property of an actor or route, respectively. For example,
carPoint = car.InitialPoint extracts the InitialPoint
property of the actor car and assigns it to the variable
carPoint.
You can also use the addPoint function to add a
new point to the end of the specified route at the specified position.
Properties
Name of the point, specified as a string scalar or character vector.
Note
You can specify the Name property of Point
in MATLAB®, but RoadRunner Scenario does not display the Name property of points in the
user interface.
Coordinates of the point in local space, specified as a three-element vector.
Coordinates of the point in world space, specified as a three-element vector.
This property is read-only.
Route containing the point, represented as a Route object.
This property is read-only.
Distance of the point along the route, represented as a numeric scalar.
This property is read-only.
Point to which the point is anchored, represented as one of these objects:
Pointobject — Represents a point in the current scenario.ScenarioAnchorPointobject — Represents a scenario anchor defined in the current scenario.SceneAnchorPointobject — Represents a scene anchor defined in the scene associated to the current scenario.
Lane from which to measure the offset of the point based on its direction of travel, specified as one of these options:
"leftmost"— RoadRunner Scenario measures the offset of the point from the leftmost lane."rightmost"— RoadRunner Scenario measures the offset of the point from the rightmost lane.
Number of lanes to offset the point from the anchor point
AnchorPoint, specified as a positive integer.
Lateral distance to offset the point from the anchor point
AnchorPoint, specified as a numeric scalar.
Reference line that specifies how RoadRunner Scenario measures the ForwardOffset property of the actor
associated to the point, specified as one of these options:
"origin"— RoadRunner Scenario measures theForwardOffsetvalue from the origin of the actor."front"— RoadRunner Scenario measures theForwardOffsetvalue from the front of the actor."back"— RoadRunner Scenario measures theForwardOffsetvalue from the back of the actor.
This property applies only to the point specified by the
InitialPoint property of an actor.
Reference line that specifies how RoadRunner Scenario measures the ForwardOffset property of the point with
respect to the anchored actor, specified as one of these options:
"origin"— RoadRunner Scenario measures theForwardOffsetvalue from the origin of the actor."front"— RoadRunner Scenario measures theForwardOffsetvalue from the front of the actor."back"— RoadRunner Scenario measures theForwardOffsetvalue from the back of the actor.
To use this property, you must anchor the point to an actor.
Longitudinal distance to the anchor point of the associated actor, specified as a
numeric scalar, relative to ReferenceLine. If the anchor is in
front of the actor, this value is negative.
Travel direction of the point with respect to AnchorPoint,
specified as one of these options:
"forward"— The point has the same travel direction asAnchorPoint."backward"— The point has the opposite travel direction ofAnchorPoint."bidirectional"— The point follows both directions of travel."undirected"— The point does not follow any direction of travel.
Point uses route timing data, specified as a logical 1
(true) or 0 (false). When set
to true, the point uses route timing data. For more information on
route timing data, see the Route Timing
Tool (RoadRunner Scenario).
Data Types: logical
Time value of the point, specified as a numeric scalar. To use this property, you
must set the value of the HasTime property to 1
(true) .
Stop duration of the actor at the point, when using route timing data, specified as
a numeric scalar. To use this property, you must set the value of the
HasTime property to 1
(true).
Point uses route speed data, specified as a logical 1
(true) or 0 (false). When set
to true, the point uses route speed data. To use this property, you
must set the value of the HasTime property to 1
(true).
Data Types: logical
Speed value of the point, specified as a numeric scalar. To use this property, you
must set the value of the HasSpeed property to 1
(true).
Vertical distance to offset the point from AnchorPoint,
specified as a numeric scalar.
Point has actor orientation data, specified as a logical 0
(false) or 1 (true). When set
to true, the Point object specifies the Euler
angles heading, pitch, and roll of the associated vehicle actor at the corresponding
point using the values of the ActorWorldHeadingDegrees,
ActorWorldPitchDegrees, and
ActorWorldRollDegrees properties, respectively.
RoadRunner supports orientation data for only vehicle actors.
Heading value of the associated actor, in world coordinates, at this point.
Specified as a numeric scalar in degrees. Specifying this value automatically sets
HasActorOrientation to true.
RoadRunner applies the values of the Euler angles to the actor in this intrinsic
order relative to the RoadRunner world space axes: heading, pitch, and then roll. The Euler angle heading,
pitch, and roll values correspond to the values of
ActorWorldHeadingDegrees,
ActorWorldPitchDegrees, and
ActorWorldRollDegrees, respectively.
Pitch value of the associated actor, in world coordinates, at this point. Specified
as a numeric scalar in degrees. Specifying this value automatically sets
HasActorOrientation to true.
RoadRunner applies the values of the Euler angles to the actor in this intrinsic
order relative to the RoadRunner world space axes: heading, pitch, and then roll. The Euler angle heading,
pitch, and roll values correspond to the values of
ActorWorldHeadingDegrees,
ActorWorldPitchDegrees, and
ActorWorldRollDegrees, respectively.
Roll value of the associated actor, in world coordinates, at this point. Specified
as a numeric scalar in degrees. Specifying this value automatically sets
HasActorOrientation to true.
RoadRunner applies the values of the Euler angles to the actor in this intrinsic
order relative to the RoadRunner world space axes: heading, pitch, and then roll. The Euler angle heading,
pitch, and roll values correspond to the values of
ActorWorldHeadingDegrees,
ActorWorldPitchDegrees, and
ActorWorldRollDegrees, respectively.
Object Functions
anchorToPoint | Set specified point as anchor |
autoAnchor | Anchor point to nearest road |
setActorWorldAnglesDegrees | Specify Euler angle heading, pitch, and roll values of vehicle actor at specified point |
Examples
Use the addPoint function to
add points to the route of an actor.
This example assumes that you have prior knowledge of working with RoadRunner in MATLAB. Before proceeding, follow the steps outlined in Set Up MATLAB Environment for RoadRunner Authoring Functions to set up your scenario using MATLAB functions for scenario authoring.
Use addPoint to Create Route
Extract the route for the actor car from the
Route property of its InitialPoint
property.
rrRoute = car.InitialPoint.Route;
Use the addPoint function to add three points to the route
rrRoute at different positions.
rrPoint = addPoint(rrRoute,[0 -10 0]); rrPoint2 = addPoint(rrRoute,[5 -50 0]); rrPoint3 = addPoint(rrRoute,[-5 -100 0]);
Use autoAnchor to
anchor the new points to the road. Specify the PosePreservation
argument as "reset-pose" to specify for the points to adjust their
positions to align within the nearest lane.
autoAnchor(rrPoint,PosePreservation="reset-pose") autoAnchor(rrPoint2,PosePreservation="reset-pose") autoAnchor(rrPoint3,PosePreservation="reset-pose")
Run the simulation by using the simulateScenario function. The
actor car follows the path specified by the new route until it
reaches the end.
simulateScenario(rrApp)
Version History
Introduced in R2025aAs of R2026b Update 1, you can now use the Point object to
programmatically set and modify orientation data for the associated vehicle actor by
specifying the values of these new properties:
HasActorOrientationActorWorldHeadingDegreesActorWorldPitchDegreesActorWorldRollDegrees
You can use the setActorWorldAnglesDegrees (RoadRunner Scenario) function to simultaneously enable orientation data
and specify all three axes of orientation on the specified Point object.
For more information on modifying actor orientation at points along a route, see Actor Orientation
Tool (RoadRunner Scenario).
See Also
autoAnchor | addPoint | anchorToPoint | Route | RouteSegment
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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)