주요 콘텐츠

lookupPose

특정 시간의 자세 정보 가져오기

설명

[position,orientation,velocity,acceleration,angularVelocity] = lookupPose(traj,sampleTimes)는 지정된 샘플 시간에서 웨이포인트 궤적의 자세 정보를 반환합니다. 샘플 시간이 궤적의 지속 시간을 초과하는 경우 해당 자세 정보는 NaN으로 반환됩니다.

예제

예제

모두 축소

두 웨이포인트를 연결하는 waypointTrajectory 객체를 만듭니다. 두 웨이포인트에서 궤적의 속도는 각각 0m/s와 10m/s입니다. 저크 제한을 0.5m/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 행렬로 반환됩니다.

MsampleTimes 입력값으로 지정됩니다.

데이터형: double

로컬 내비게이션 좌표계의 방향으로, M×1 quaternion 열 벡터 또는 3×3×M 실수형 배열로 반환됩니다.

각 쿼터니언 또는 3×3 회전 행렬은 로컬 내비게이션 좌표계에서 현재 바디 좌표계로의 프레임 회전을 나타냅니다.

MsampleTimes 입력값으로 지정됩니다.

데이터형: double

로컬 내비게이션 좌표계의 속도(단위: 초당 미터)로, M×3 행렬로 반환됩니다.

MsampleTimes 입력값으로 지정됩니다.

데이터형: double

로컬 내비게이션 좌표계의 가속도(단위: 제곱 초당 미터)로, M×3 행렬로 반환됩니다.

MsampleTimes 입력값으로 지정됩니다.

데이터형: double

로컬 내비게이션 좌표계의 각속도(단위: 초당 라디안)로, M×3 행렬로 반환됩니다.

MsampleTimes 입력값으로 지정됩니다.

데이터형: double

버전 내역

R2020b에 개발됨