Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pinocchio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
pinocchio
Commits
d2c4ee3f
Verified
Commit
d2c4ee3f
authored
5 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
spatial/log: improve robustness computations of log3
parent
9b52a47e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/autodiff/cppad/spatial/log.hxx
+2
-2
2 additions, 2 deletions
src/autodiff/cppad/spatial/log.hxx
src/spatial/log.hxx
+4
-4
4 additions, 4 deletions
src/spatial/log.hxx
with
6 additions
and
6 deletions
src/autodiff/cppad/spatial/log.hxx
+
2
−
2
View file @
d2c4ee3f
...
...
@@ -35,9 +35,9 @@ namespace pinocchio
Scalar
(
0
),
math
::
acos
((
tr
-
Scalar
(
1
))
/
Scalar
(
2
))));
const
Scalar
cphi
=
cos
(
theta
-
PI_value
);
const
Scalar
cphi
=
-
(
tr
-
Scalar
(
1
))
/
Scalar
(
2
);
const
Scalar
beta
=
theta
*
theta
/
(
Scalar
(
1
)
+
cphi
);
Vector3
tmp
((
R
.
diagonal
().
array
()
+
cphi
)
*
beta
);
const
Vector3
tmp
((
R
.
diagonal
().
array
()
+
cphi
)
*
beta
);
const
Scalar
t
=
CppAD
::
CondExpGt
<
_Scalar
>
(
theta
,
TaylorSeriesExpansion
<
_Scalar
>::
template
precision
<
3
>(),
theta
/
sin
(
theta
),
...
...
This diff is collapsed.
Click to expand it.
src/spatial/log.hxx
+
4
−
4
View file @
d2c4ee3f
...
...
@@ -26,8 +26,8 @@ namespace pinocchio
static
const
Scalar
PI_value
=
PI
<
Scalar
>
();
const
Scalar
tr
=
R
.
trace
();
if
(
tr
>
Scalar
(
3
))
theta
=
Scalar
(
0
);
// acos((3-1)/2)
else
if
(
tr
<
Scalar
(
-
1
))
theta
=
PI_value
;
// acos((-1-1)/2)
if
(
tr
>
=
Scalar
(
3
))
theta
=
Scalar
(
0
);
// acos((3-1)/2)
else
if
(
tr
<
=
Scalar
(
-
1
))
theta
=
PI_value
;
// acos((-1-1)/2)
else
theta
=
math
::
acos
((
tr
-
Scalar
(
1
))
/
Scalar
(
2
));
assert
(
theta
==
theta
&&
"theta contains some NaN"
);
// theta != NaN
...
...
@@ -40,9 +40,9 @@ namespace pinocchio
// using explicit formula. However, the precision of this method
// is the square root of the precision with the antisymmetric
// method (Nominal case).
const
Scalar
cphi
=
cos
(
theta
-
PI_value
);
const
Scalar
cphi
=
-
(
tr
-
Scalar
(
1
))
/
Scalar
(
2
);
const
Scalar
beta
=
theta
*
theta
/
(
Scalar
(
1
)
+
cphi
);
Vector3
tmp
((
R
.
diagonal
().
array
()
+
cphi
)
*
beta
);
const
Vector3
tmp
((
R
.
diagonal
().
array
()
+
cphi
)
*
beta
);
res_
(
0
)
=
(
R
(
2
,
1
)
>
R
(
1
,
2
)
?
Scalar
(
1
)
:
Scalar
(
-
1
))
*
(
tmp
[
0
]
>
Scalar
(
0
)
?
sqrt
(
tmp
[
0
])
:
Scalar
(
0
));
res_
(
1
)
=
(
R
(
0
,
2
)
>
R
(
2
,
0
)
?
Scalar
(
1
)
:
Scalar
(
-
1
))
*
(
tmp
[
1
]
>
Scalar
(
0
)
?
sqrt
(
tmp
[
1
])
:
Scalar
(
0
));
res_
(
2
)
=
(
R
(
1
,
0
)
>
R
(
0
,
1
)
?
Scalar
(
1
)
:
Scalar
(
-
1
))
*
(
tmp
[
2
]
>
Scalar
(
0
)
?
sqrt
(
tmp
[
2
])
:
Scalar
(
0
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment