Skip to content

Commit c4690c8

Browse files
committed
allow symbolic operations
1 parent 34bf91f commit c4690c8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

trlog.m

+7-3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555

5656
function [o1,o2] = trlog(T)
5757

58+
if isa(T, 'symfun')
59+
T = formula(T);
60+
end
61+
5862
if isrot(T)
5963
% deal with rotation matrix
6064

@@ -65,13 +69,13 @@
6569

6670
R = T;
6771

68-
if abs(trace(R) - 3) < 100*eps
72+
if ~isa(R, 'sym') && abs(trace(R) - 3) < 100*eps
6973
% matrix is identity
7074

7175
w = [0 0 0]';
7276
theta = 0;
7377

74-
elseif abs(trace(R) + 1) < 100*eps
78+
elseif ~isa(R, 'sym') && abs(trace(R) + 1) < 100*eps
7579
% tr R = -1
7680
% rotation by +/- pi, +/- 3pi etc
7781

@@ -106,7 +110,7 @@
106110

107111
[R,t] = tr2rt(T);
108112

109-
if abs(trace(R) - 3) < 100*eps
113+
if ~isa(R, 'sym') && abs(trace(R) - 3) < 100*eps
110114
% rotation matrix is identity, theta=0
111115
w = [0 0 0]';
112116
v = t;

0 commit comments

Comments
 (0)