Main Content

trajectoryGeneratorFrenet

参照パスに沿った最適な軌跡の検索

R2020b 以降

説明

trajectoryGeneratorFrenet オブジェクトは、4 次多項式または 5 次多項式を使用して、与えられた参照パスを基準とする別の軌跡を生成します。それぞれの軌跡で、フレネ状態間の指定した時間範囲の動きが定義されます。

フレネ状態は、静的な参照パスを基準とする相対的な位置、速度、加速度を示します。参照パスは referencePathFrenet オブジェクトとして指定します。

オブジェクトはフレネ状態を [S dS ddS L dL ddL] の形式のベクトルとして表します。ここで、S は弧の長さ、L は参照パスの方向からの垂直な偏差です。S の微分は時間を基準とします。L の微分は弧の長さ S を基準とします。

Depiction of Frenet states relative to a reference path

別の軌跡を生成するには、オブジェクト関数 connect に特定の時間範囲の開始と終了のフレネ状態を指定します。

作成

説明

connectorFrenet = trajectoryGeneratorFrenet(refPath) は、referencePathFrenet オブジェクトとして指定される参照パス refPath を基準とする初期状態と終了状態の間の軌跡を生成します。入力引数 refPathReferencePath プロパティを設定します。

connectorFrenet = trajectoryGeneratorFrenet(refPath,'TimeResolution',timeValue) は、離散時間間隔を指定します。引数 timeValueTimeResolution プロパティを設定します。

プロパティ

すべて展開する

サンプリングされるフレネ状態間の離散時間間隔 (秒単位)。正のスカラーとして指定します。オブジェクト関数 connect を使用する際、このプロパティにより、生成される軌跡の構造体 frenetTrajectory および globalTrajectoryTimes フィールドの分解能が決まります。

データ型: double

フレネ座標での参照パス。referencePathFrenet オブジェクトとして指定します。

オブジェクト関数

connectConnect initial and terminal Frenet states
createParallelStateCreate states using Frenet and global parameters

すべて折りたたむ

フレネ座標を使用して参照パスの別の軌跡を生成します。軌跡に対して異なる初期状態と終了状態を指定します。生成された軌跡に基づいて状態を調整します。

一連のウェイポイントから参照パスを生成します。この参照パスから trajectoryGeneratorFrenet オブジェクトを作成します。

waypoints = [0 0; ...
	50 20; ...
	100 0; ...
	150 10];
refPath = referencePathFrenet(waypoints);
connector = trajectoryGeneratorFrenet(refPath);

パスの原点と、パスに沿って 30 m のポイントとの間の 5 秒の軌跡を、フレネ状態として生成します。

initState = [0 0 0 0 0 0];  % [S ds ddS L dL ddL]
termState = [30 0 0 0 0 0]; % [S ds ddS L dL ddL]
[~,trajGlobal] = connect(connector,initState,termState,5);

軌跡をグローバル座標で表示します。

show(refPath);
hold on
axis equal
plot(trajGlobal.Trajectory(:,1),trajGlobal.Trajectory(:,2),'b')
legend(["Waypoints","Reference Path","Trajectory to 30m"])

Figure contains an axes object. The axes object contains 3 objects of type line. One or more of the lines displays its values using only markers These objects represent Waypoints, Reference Path, Trajectory to 30m.

横方向の偏差を –3 m から 3 m までにして終了状態の行列を作成します。同じ弧の長さを 10 秒で進むが参照パスから横方向に逸脱する軌跡を生成します。新しい代替パスを表示します。

termStateDeviated = termState + ([-3:3]' * [0 0 0 1 0 0]);
[~,trajGlobal] = connect(connector,initState,termStateDeviated,10);

clf
show(refPath);
hold on
axis equal
for i = 1:length(trajGlobal)
    plot(trajGlobal(i).Trajectory(:,1),trajGlobal(i).Trajectory(:,2),'g')
end
legend(["Waypoints","Reference Path","Alternative Trajectories"])
hold off

Figure contains an axes object. The axes object contains 9 objects of type line. One or more of the lines displays its values using only markers These objects represent Waypoints, Reference Path, Alternative Trajectories.

新しい終了状態を指定して新しい軌跡を生成します。この軌跡は、縦方向の 10 m/s の速度を得るために後退運動を必要とするため望ましくありません。

newTermState = [5 10 0 5 0 0];
[~,newTrajGlobal] = connect(connector,initState,newTermState,3);

clf
show(refPath);
hold on
axis equal
plot(newTrajGlobal.Trajectory(:,1),newTrajGlobal.Trajectory(:,2),'b');
legend(["Waypoint","Reference Path","New Trajectory"])
hold off

Figure contains an axes object. The axes object contains 3 objects of type line. One or more of the lines displays its values using only markers These objects represent Waypoint, Reference Path, New Trajectory.

弧の長さとして NaN を指定して、縦方向の状態の制限を緩和します。軌跡を再度生成して表示します。参照パスから逸脱した適切な別の軌跡が新しい位置に表示されます。

relaxedTermState = [NaN 10 0 5 0 0];
[~,trajGlobalRelaxed] = connect(connector,initState,relaxedTermState,3);

clf
show(refPath);
hold on
axis equal
plot(trajGlobalRelaxed.Trajectory(:,1),trajGlobalRelaxed.Trajectory(:,2),'g');
hold off

Figure contains an axes object. The axes object contains 3 objects of type line. One or more of the lines displays its values using only markers

参照

[1] Werling, Moritz, Julius Ziegler, Sören Kammel, and Sebastian Thrun. "Optimal Trajectory Generation for Dynamic Street Scenarios in a Frenet Frame." 2010 IEEE International Conference on Robotics and Automation. 2010, pp. 987–993.

拡張機能

バージョン履歴

R2020b で導入