このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
actorPoses
ドライビング シナリオにおけるアクターの位置、速度、および向き
説明
例
複数のアクターと道路を使用したドライビング シナリオの作成
1 つの曲線道路、2 つの直線道路、2 つのアクター (車と自転車) が含まれたドライビング シナリオを作成します。どちらのアクターも 60 秒間道路に沿って移動します。
ドライビング シナリオ オブジェクトを作成します。
scenario = drivingScenario('SampleTime',0.1','StopTime',60);
半径 800 メートルの円弧に従う道路中心点を使用して、曲線道路を作成します。円弧は 0 度から開始して 90 度で終了し、5 度のインクリメントでサンプリングされます。
angs = [0:5:90]'; R = 800; roadcenters = R*[cosd(angs) sind(angs) zeros(size(angs))]; roadwidth = 10; cr = road(scenario,roadcenters,roadwidth);
両端の道路中央点を使用して、既定の幅をもつ 2 本の直線道路を追加します。最初の直線道路の両エッジに障壁を追加します。
roadcenters = [700 0 0; 100 0 0]; sr1 = road(scenario,roadcenters); barrier(scenario,sr1) barrier(scenario,sr1,'RoadEdge','left') roadcenters = [400 400 0; 0 0 0]; road(scenario,roadcenters);
道路の境界を取得します。
rbdry = roadBoundaries(scenario);
車と自転車をシナリオに追加します。1 つ目の直線道路の最初の位置に車を配置します。
car = vehicle(scenario,'ClassID',1,'Position',[700 0 0], ... 'Length',3,'Width',2,'Height',1.6);
道路を進んだ先に自転車を配置します。
bicycle = actor(scenario,'ClassID',3,'Position',[706 376 0]', ... 'Length',2,'Width',0.45,'Height',1.5);
シナリオをプロットします。
plot(scenario,'Centerline','on','RoadCenters','on'); title('Scenario');
アクターの姿勢とプロファイルを表示します。
allActorPoses = actorPoses(scenario)
allActorPoses=242×1 struct array with fields:
ActorID
Position
Velocity
Roll
Pitch
Yaw
AngularVelocity
allActorProfiles = actorProfiles(scenario)
allActorProfiles=242×1 struct array with fields:
ActorID
ClassID
Length
Width
Height
OriginOffset
MeshVertices
MeshFaces
RCSPattern
RCSAzimuthAngles
RCSElevationAngles
このシナリオには障壁があり、各障壁セグメントがアクターと見なされているため、関数 actorPoses
および関数 actorProfiles
は、すべての静止アクターと非静止アクターの姿勢を返します。車両や二輪車など非静止アクターの姿勢とプロファイルのみを取得するには、まず scenario.Actors.ActorID
プロパティを使用して、それらの対応するアクター ID を取得します。
movableActorIDs = [scenario.Actors.ActorID];
次に、それらの ID を使用して、非静止アクターの姿勢とプロファイルのみをフィルター処理します。
movableActorPoseIndices = ismember([allActorPoses.ActorID],movableActorIDs); movableActorPoses = allActorPoses(movableActorPoseIndices)
movableActorPoses=2×1 struct array with fields:
ActorID
Position
Velocity
Roll
Pitch
Yaw
AngularVelocity
movableActorProfiles = allActorProfiles(movableActorPoseIndices)
movableActorProfiles=2×1 struct array with fields:
ActorID
ClassID
Length
Width
Height
OriginOffset
MeshVertices
MeshFaces
RCSPattern
RCSAzimuthAngles
RCSElevationAngles
入力引数
scenario
— ドライビング シナリオ
drivingScenario
オブジェクト
ドライビング シナリオ。drivingScenario
オブジェクトとして指定します。
出力引数
poses
— アクターの姿勢
構造体 | 構造体の配列
アクターの姿勢 (シナリオ座標)。構造体、または構造体の配列として返されます。"姿勢" とは、アクターの位置、速度、および向きです。
poses
の各構造体には以下のフィールドが含まれます。
フィールド | 説明 |
---|---|
ActorID | シナリオで定義されているアクター識別子。正の整数として指定します。 |
Position | アクターの位置。[x y z] という形式の実数値ベクトルとして指定します。単位はメートルです。 |
Velocity | x 方向、y 方向、z 方向のアクターの速度 (v)。[vx vy vz] という形式の実数値ベクトルとして指定します。単位はメートル/秒です。 |
Roll | アクターのロール角。実数値スカラーとして指定します。単位は度です。 |
Pitch | アクターのピッチ角。実数値スカラーとして指定します。単位は度です。 |
Yaw | アクターのヨー角。実数値スカラーとして指定します。単位は度です。 |
AngularVelocity | x 方向、y 方向、z 方向のアクターの角速度 (ω)。[ωx ωy ωz] という形式の実数値ベクトルとして指定します。単位は度/秒です。 |
これらの構造体フィールドの完全な定義については、関数 actor
、vehicle
、および barrier
を参照してください。
バージョン履歴
R2017a で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)