Main Content

trajectoryGeneratorFrenet

기준 경로를 따르는 대안 궤적 찾기

R2020b 이후

설명

trajectoryGeneratorFrenet 객체는 주어진 기준 경로를 기준으로 4차 다항식 또는 5차 다항식을 사용해 대안 궤적을 생성합니다. 각 궤적은 지정된 시간 길이 동안의 Frenet 상태 간 모션을 정의합니다.

Frenet 상태는 정적 기준 경로를 기준으로 하는 위치, 속도, 가속도를 설명하며 referencePathFrenet 객체로 지정됩니다.

이 객체는 Frenet 상태를 [S dS ddS L dL ddL] 형식의 벡터로 표현합니다. 여기서 S는 호 길이이고 L은 기준 경로 방향으로부터의 직교 편차입니다. S의 도함수는 시간에 대해 상대적입니다. L의 도함수는 호 길이 S에 대해 상대적입니다.

Depiction of Frenet states relative to a reference path

대안 궤적을 생성하려면 connect 객체 함수에 초기 Frenet 상태와 최종 Frenet 상태를 주어진 시간 길이와 함께 지정하십시오.

생성

설명

예제

connectorFrenet = trajectoryGeneratorFrenet(refPath)referencePathFrenet 객체로 지정된 기준 경로 refPath를 기준으로 초기 상태와 최종 상태 사이의 궤적을 생성합니다. refPath 입력 인수는 ReferencePath 속성을 설정합니다.

connectorFrenet = trajectoryGeneratorFrenet(refPath,'TimeResolution',timeValue)는 이산화를 위한 시간 간격을 지정합니다. timeValue 인수는 TimeResolution 속성을 설정합니다.

속성

모두 확장

샘플링된 Frenet 상태 간의 이산화 시간 간격으로, 초 단위를 사용하여 양의 스칼라로 지정됩니다. connect 객체 함수를 사용할 때, 이 속성은 생성된 궤적 구조체인 frenetTrajectoryglobalTrajectoryTimes 필드의 분해능을 결정합니다.

데이터형: double

Frenet 좌표의 기준 경로로, referencePathFrenet 객체로 지정됩니다.

객체 함수

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

예제

모두 축소

Frenet 좌표를 사용하여 기준 경로를 바탕으로 대안 궤적을 생성합니다. 궤적에 대해 서로 다른 초기 상태와 최종 상태를 지정하십시오. 생성된 궤적을 기반으로 상태를 조정합니다.

일련의 웨이포인트에서 기준 경로를 생성합니다. 기준 경로로부터 trajectoryGeneratorFrenet 객체를 만듭니다.

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

경로 원점과 경로 아래쪽 30미터 지점 사이에 5초 궤적을 Frenet 상태로 생성합니다.

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.

–3m와 3m 사이의 횡방향 편차로 최종 상태의 행렬을 만듭니다. 동일한 호 길이를 포함하되, 기준 경로에서 좌우로 벗어나는 궤적을 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.

새로운 최종 상태를 지정하여 새로운 궤적을 생성합니다. 이 궤적은 10m/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에 개발됨