actorPoses

Positions, velocities, and orientations of actors in driving scenario

Description

example

poses= actorPoses(scenario)returns the current poses (positions, velocities, and orientations) for all actors in the driving scenario,scenario. Actors includeActorVehicleobjects, which you can create using theactorvehiclefunctions, respectively. Actor poses are in scenario coordinates.

Examples

collapse all

Create a driving scenario containing a curved road, two straight roads, and two actors: a car and a bicycle. Both actors move along the road for 60 seconds.

Create the driving scenario object.

scenario = drivingScenario('SampleTime',0.1','StopTime',60);

Create the curved road using road center points following the arc of a circle with an 800-meter radius. The arc starts at 0°, ends at 90°, and is sampled at 5° increments.

angs = [0:5:90]'; R = 800; roadcenters = R*[cosd(angs) sind(angs) zeros(size(angs))]; roadwidth = 10; road(scenario,roadcenters,roadwidth);

使用两端的道路中心点添加两条默认宽度的直线道路。

Roadcenters = [700 0 0;100 0 0];路(场景,公路中心)
ans = Road with properties: Name: "" RoadID: 2 RoadCenters: [2x3 double] RoadWidth: 6 BankAngle: [2x1 double]
Roadcenters = [400 400 0;0 0 0];路(场景,公路中心)
ANS =带有财产的道路:名称:“” ROADID:3 Roadcenters:[2x3 double] Roadwidth:6 Bankangle:[2x1 double]

获得道路界限。

rbdry = Roadbouldaries(方案);

Add a car and a bicycle to the scenario. Position the car at the beginning of the first straight road.

car = vehicle(scenario,'ClassID',1,'位置',[700 0 0],...'长度',3,'Width',2,'高度',1.6);

Position the bicycle farther down the road.

bicycle = actor(scenario,'ClassID',3,'位置',[706 376 0]',...'长度',2,'Width',0.45,'高度',1.5);

Plot the scenario.

plot(scenario,'Centerline','on',“公路中心”,'on');标题('设想');

Display the actor poses and profiles.

姿势= actorposes(场景)
poses=2×1 struct array with fields:ActorID Position Velocity Roll Pitch Yaw AngularVelocity
profiles = actorProfiles(scenario)
profiles=2×1 struct array with fields:ActorID ClassID Length Width Height OriginOffset MeshVertices MeshFaces RCSPattern RCSAzimuthAngles RCSElevationAngles

Input Arguments

collapse all

驾驶场景,指定为drivingScenario目的。

Output Arguments

collapse all

Actor poses, in scenario coordinates, returned as a structure or an array of structures.Posesare the positions, velocities, and orientations of actors.

每个结构在poses有这些字段。

Field Description
ActorID

Scenario-defined actor identifier, specified as a positive integer.

Position

Position of actor, specified as a real-valued vector of the form [x,y,z]. Units are in meters.

速度

速度(v) of actor in thex- ,,y- ,,和z- 方向,指定为表格的实价向量[vx,vy,vz]. Units are in meters per second.

Roll

Roll angle of actor, specified as a real-valued scalar. Units are in degrees.

沥青

沥青angle of actor, specified as a real-valued scalar. Units are in degrees.

Yaw

偏航角的演员,指定as a real-valued scalar. Units are in degrees.

AngularVelocity

Angular velocity (ω) of actor in thex- ,,y- ,,和z- 方向,指定为表格的实价向量[ωx,ωy,ωz]. Units are in degrees per second.

有关这些结构字段的完整定义,请参见actorvehicle功能。

Introduced in R2017a