-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_exp_mapping.m
37 lines (32 loc) · 973 Bytes
/
get_exp_mapping.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function g = get_exp_mapping(exp_coord, group_name)
% get_exp_mapping Get the exponential mapping from Lie algebra
% (exponential coordinates) to Lie group
%
% Input
% exp_coord: exponential coordinates of the form [\omega, v]
% group_name: Name of the group, supports 'SO', 'SE' and 'PCG'
%
% Output
% g: homogeneous transformation matrix
%
% Author
% Sipu Ruan, 2020
%
% See also
% expm_SE, expm_SO
if (nargin == 1) || strcmp(group_name, 'SE')
% Special Euclidean group
g = expm_SE(exp_coord);
elseif strcmp(group_name, 'SO')
% Special orthogonal group
g = expm_SO(exp_coord);
elseif strcmp(group_name, 'PCG')
% Pose change group
if size(exp_coord,1) == 3
g = [expm_SO(exp_coord(1)), exp_coord(2:3); 0, 0, 0, 1];
elseif size(exp_coord,1) == 6
g = [expm_SO(exp_coord(1:3)), exp_coord(4:6); 0, 0, 0, 1];
end
else
error('Group not supported! Currently supports SO, SE and PCG.')
end