Main Content

lookupPose

特定時間の姿勢情報を取得する

R2022a 以降

説明

[position,orientation,velocity,acceleration,angularVelocity] = lookupPose(traj,sampleTimes) は、指定されたサンプル時間におけるウェイポイント軌跡の姿勢情報を返します。サンプル時間が軌跡の持続時間を超えている場合、対応する姿勢情報は NaN として返されます。

すべて折りたたむ

2 つのウェイポイントを接続する waypointTrajectory オブジェクトを作成します。2 つのウェイポイントにおける軌跡の速度は、それぞれ 0 m/s と 10 m/s です。加加速度の範囲を 0.5 m/s3 に制限して、台形加速度プロファイルを有効にします。

waypoints = [0  0  0;
            10 50 10];
speeds = [0 10];
jerkLimit = 0.5;
trajectory = waypointTrajectory(waypoints,GroundSpeed=speeds,JerkLimit=jerkLimit);

TimeOfArrival プロパティをクエリして、軌跡の初期時間と最終時間を取得します。タイム スタンプを作成して軌跡をサンプリングします。

t0 = trajectory.TimeOfArrival(1);
tf = trajectory.TimeOfArrival(end);
sampleTimes = linspace(t0,tf,100);

オブジェクト関数 lookupPose を使用して、これらのサンプリングされたタイム スタンプにおける位置、速度、および加速度の情報を取得します。

[position,~,velocity,acceleration,~] = lookupPose(trajectory,sampleTimes);

軌跡をプロットします。

figure()
plot3(position(:,1),position(:,2),position(:,3))
xlabel("x (m)")
ylabel("y (m)")
zlabel("z (m)")
title("Trajectory")

Figure contains an axes object. The axes object with title Trajectory, xlabel x (m), ylabel y (m) contains an object of type line.

速度プロファイルをプロットします。

figure()
subplot(3,1,1)
plot(sampleTimes,velocity(:,1));
ylabel("v_x (m/s)")
title("Velocity Profile")
subplot(3,1,2)
plot(sampleTimes,velocity(:,2));
ylabel("v_y (m/s)")
subplot(3,1,3)
plot(sampleTimes,velocity(:,3));
ylabel("v_z (m/s)")
xlabel("Time (sec)")

Figure contains 3 axes objects. Axes object 1 with title Velocity Profile, ylabel v_x (m/s) contains an object of type line. Axes object 2 with ylabel v_y (m/s) contains an object of type line. Axes object 3 with xlabel Time (sec), ylabel v_z (m/s) contains an object of type line.

加速度プロファイルをプロットします。結果を見ると、平面運動の加速度プロファイルは台形になっています。

figure()
subplot(3,1,1)
plot(sampleTimes,acceleration(:,1));
axis padded
ylabel("a_x (m/s^2)")
title("Acceleration Profile")
subplot(3,1,2)
plot(sampleTimes,acceleration(:,2));
ylabel("a_y (m/s^2)")
axis padded
subplot(3,1,3)
plot(sampleTimes,acceleration(:,3));
ylabel("a_z (m/s^2)")
xlabel("Time (sec)")

Figure contains 3 axes objects. Axes object 1 with title Acceleration Profile, ylabel a_x (m/s^2) contains an object of type line. Axes object 2 with ylabel a_y (m/s^2) contains an object of type line. Axes object 3 with xlabel Time (sec), ylabel a_z (m/s^2) contains an object of type line.

入力引数

すべて折りたたむ

ウェイポイント軌跡。waypointTrajectory オブジェクトとして指定します。

秒単位のサンプル時間。非負のスカラーの M 要素ベクトルとして指定します。

出力引数

すべて折りたたむ

ローカル ナビゲーション座標系における位置 (メートル単位)。M 行 3 列の行列として返されます。

M は sampleTimes 入力で指定します。

データ型: double

ローカル ナビゲーション座標系における方向。M 行 1 列の quaternion 列ベクトルまたは 3×3×M の実数配列として返されます。

各四元数または 3 行 3 列の回転行列は、ローカル ナビゲーション座標系から現在のボディ座標系への座標系の回転です。

M は sampleTimes 入力で指定します。

データ型: double

ローカル ナビゲーション座標系における速度 (メートル/秒単位)。M 行 3 列の行列として返されます。

M は sampleTimes 入力で指定します。

データ型: double

ローカル ナビゲーション座標系における加速度 (メートル毎秒毎秒単位)。M 行 3 列の行列として返されます。

M は sampleTimes 入力で指定します。

データ型: double

ローカル ナビゲーション座標系における角速度 (ラジアン/秒単位)。M 行 3 列の行列として返されます。

M は sampleTimes 入力で指定します。

データ型: double

バージョン履歴

R2022a で導入

参考

オブジェクト

関数