distance
설명
예제
SE3에서 두 상태 간의 거리 계산하기
SE(3) 상태공간을 생성합니다.
space = stateSpaceSE3
space = stateSpaceSE3 with properties: Name: 'SE3' StateBounds: [7x2 double] NumStateVariables: 7 WeightXYZ: 1 WeightQuaternion: 0.1000
두 상태 간의 거리를 계산합니다.
dist = distance(space,[2 10 3 0.2 0 0 0.8],[0 -2.5 4 0.7 0.3 0 0])
dist = 12.7269
두 상태 간의 유클리드 거리를 계산합니다.
space.WeightQuaternion = 0; distEuc = distance(space,[2 10 3 0.2 0 0 0.8; 4 5 2 1 2 4 2],[62 5 33 0.2 0 0 0.8; 9 9 3 3 1 3.1 7])
distEuc = 2×1
67.2681
6.4807
입력 인수
space
— state space 객체
stateSpaceSE2
객체 | stateSpaceSE3
객체 | stateSpaceDubins
객체 | stateSpaceReedsShepp
객체
state space 객체로, stateSpaceSE2
객체 또는 stateSpaceSE3
객체, stateSpaceDubins
객체 또는 stateSpaceReedsShepp
객체로 지정됩니다.
states1
— 거리 계산을 위한 초기 상태
실수 값으로 구성된 n×3 행렬 | 실수 값으로 구성된 n×7 행렬
거리 계산을 위한 초기 상태로, 실수 값으로 구성된 n×3 행렬 또는 n×7 행렬로 지정됩니다. n은 지정된 상태의 개수입니다.
2차원 state space 객체 stateSpaceSE2
, stateSpaceDubins
, stateSpaceReedsShepp
의 경우, 각 행은 [x y theta]
형식을 가집니다. 이는 상태공간에서 상태의 xy 위치와 방향 각도 theta
를 정의합니다.
3차원 state space 객체 stateSpaceSE3
의 경우, 각 행은 [x y z qw qx qy qz]
형식을 가집니다. 이는 상태공간에서 상태의 xyz 위치와 쿼터니언 방향 [qw qx qy qz]
를 정의합니다.
함수는 거리 계산을 위해 다음과 같은 조합을 지원합니다.
n-n —
states1
의 n개 상태와states2
의 n개 상태.예:
distance(space,rand(10,7),rand(10,7))
1-n —
states1
의 1개 상태와states2
의 n개 상태.예:
distance(space,rand(1,7),rand(10,7))
n-1 —
states1
의 n개 상태와states2
의 1개 상태.예:
distance(space,rand(10,7),rand(1,7))
데이터형: single
| double
states2
— 거리 계산을 위한 최종 상태
실수 값으로 구성된 n×3 행렬 | 실수 값으로 구성된 n×7 행렬
거리 계산을 위한 최종 상태로, 실수 값으로 구성된 n×3 행렬 또는 n×7 행렬로 지정됩니다. n은 지정된 상태의 개수입니다.
2차원 state space 객체 stateSpaceSE2
, stateSpaceDubins
, stateSpaceReedsShepp
의 경우, 각 행은 [x y theta]
형식을 가집니다. 이는 상태공간에서 상태의 xy 위치와 방향 각도 theta
를 정의합니다.
3차원 state space 객체 stateSpaceSE3
의 경우, 각 행은 [x y z qw qx qy qz]
형식을 가집니다. 이는 상태공간에서 상태의 xyz 위치와 쿼터니언 방향 [qw qx qy qz]
를 정의합니다.
함수는 거리 계산을 위해 다음과 같은 조합을 지원합니다.
n-n —
states1
의 n개 상태와states2
의 n개 상태.예:
distance(space,rand(10,7),rand(10,7))
1-n —
states1
의 1개 상태와states2
의 n개 상태.예:
distance(space,rand(1,7),rand(10,7))
n-1 —
states1
의 n개 상태와states2
의 1개 상태.예:
distance(space,rand(10,7),rand(1,7))
데이터형: single
| double
출력 인수
버전 내역
R2019b에 개발됨
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)