Main Content

referencePathFrenet

웨이포인트에 피팅된 평활한 기준 경로

R2020b 이후

설명

referencePathFrenet 객체는 [x y] 또는 [x y theta]로 주어진 일련의 웨이포인트에 대해 평활하고 연속적인 조각별 곡선을 피팅합니다. 피팅 후 곡선을 따르는 점, 즉 경로 점은 [x y theta kappa dkappa s]로 표현됩니다. 각 요소는 다음과 같습니다.

  • x y, theta — 전역 좌표로 표현된 SE(2) 상태(x와 y의 단위는 미터이고 theta의 단위는 라디안임)

  • kappa — 곡률, 또는 반경의 역수(단위: m-1)

  • dkappa — 호 길이에 대한 곡률의 도함수(단위: m-2)

  • s — 호 길이, 또는 경로상에서 경로 원점으로부터의 거리(단위: 미터)

Depiction of global Frenet coordinates

이 객체를 사용하여 전역 좌표계와 Frenet 좌표계 간에 궤적을 변환하고, 호 길이를 기준으로 경로를 따르는 상태를 보간하고, 전역 상태에서 가장 가까운 경로상의 점을 쿼리합니다.

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

Depiction of Frenet states relative to a reference path

생성

설명

예제

refPathObj = referencePathFrenet(waypoints)는 지정된 웨이포인트에 대해 일련의 연속적인 조각별 곡선을 피팅합니다. waypoints 인수는 Waypoints 속성을 설정합니다.

refPathObj = referencePathFrenet(___,Name,Value)는 위에 열거된 구문의 입력 인수 외에 하나 이상의 이름-값 입력 쌍 인수를 사용하여 속성을 설정합니다. DiscretizationDistance 속성과 MaxNumWaypoints 속성을 이름-값 인수로 지정할 수 있습니다.

속성

모두 확장

경로를 따라 미리 샘플링된 점으로, 행 형식이 [x y]인 P×2 행렬 또는 행 형식이 [x y theta]인 P×3 행렬로 지정됩니다. x와 y는 미터로 지정하고 theta는 라디안으로 지정합니다. P는 미리 샘플링된 점의 개수이며 2개 이상이어야 합니다.

데이터형: single | double

읽기 전용 속성입니다.

경로를 따른 호 길이의 총계로, 단위는 미터입니다.

데이터형: single | double

읽기 전용 속성입니다.

세그먼트 시작 시 클로소이드 파라미터로, N×6 행렬로 지정됩니다. 여기서 N은 총 웨이포인트 개수입니다. 각 행은 다음 연속 웨이포인트에 연결하기 위해 해당 클로소이드 세그먼트의 파라미터를 포함하며 [x y theta kappa dkappa s] 형식입니다. 각 요소는 다음과 같습니다.

  • x, y, theta — 전역 좌표로 표현된 SE(2) 상태(x와 y의 단위는 미터이고 theta의 단위는 라디안임)

  • kappa — 곡률, 또는 반경의 역수(단위: m-1)

  • dkappa — 호 길이에 대한 곡률의 도함수(단위: m-2)

  • s — 호 길이, 또는 경로상에서 경로 원점으로부터의 거리(단위: 미터)

데이터형: single | double

보간된 경로 점 사이의 호 길이로, 양의 스칼라로 지정됩니다(단위: 미터). 이 객체는 보간된 경로 점을 사용하여 변환 함수 frenet2globalglobal2frenet의 성능을 가속화합니다. 이산화 거리가 짧을수록 메모리와 계산 효율성을 희생하며 정확도를 향상시킬 수 있습니다.

예: refPath = referencePathFrenet(waypoints,'DiscretizationDistance',0.4)

데이터형: single | double

경로에 허용되는 웨이포인트의 최대 개수로, 크기 조정이 가능한 경로의 경우 Inf로 지정될 수도 있고, 정적 제한을 적용하기 위해 양의 정수로 지정될 수도 있습니다.

MaxNumWaypointsInf로 설정된 경우 코드를 생성하기 위해서는 DynamicMemoryAllocation'on'으로 설정해야 합니다.

예: refPath = referencePathFrenet(waypoints,'MaxNumWaypoints',10)

데이터형: single | double

객체 함수

closestPointFind closest point on reference path to global point
closestPointsToSequenceProjects sequence of points onto path
closestProjectionsFind orthogonal projections between path tangent vector and query point
curvature호 길이에서 곡률 반환
changeInCurvatureReturn change-in-curvature at arclength
frenet2globalConvert Frenet states to global states
global2frenetConvert global states to Frenet states
interpolateInterpolate reference path at provided arc lengths
position호 길이에서 xy 위치 반환
tangentAngle호 길이에서 탄젠트 각도 반환
showDisplay reference path in figure
copyCopy reference path

예제

모두 축소

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.

[2] Bertolazzi, Enrico, and Marco Frego. “Fast and Accurate Clothoid Fitting.” Mathematical Methods in the Applied Sciences 38, no. 5 (March 30, 2015): 881–97. https://doi.org/10.1002/mma.3114.

확장 기능

버전 내역

R2020b에 개발됨