Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
mobile_robotics
wolf_projects
wolf_lib
wolf
Commits
4894fdfc
Commit
4894fdfc
authored
6 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Use own implementation for log_R
parent
d70cf85d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!221
Reimplement log_R()
Pipeline
#2253
failed
6 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/rotations.h
+24
-2
24 additions, 2 deletions
src/rotations.h
with
24 additions
and
2 deletions
src/rotations.h
+
24
−
2
View file @
4894fdfc
...
@@ -205,8 +205,30 @@ inline Eigen::Matrix<typename Derived::Scalar, 3, 1> log_R(const Eigen::MatrixBa
...
@@ -205,8 +205,30 @@ inline Eigen::Matrix<typename Derived::Scalar, 3, 1> log_R(const Eigen::MatrixBa
typedef
typename
Derived
::
Scalar
T
;
typedef
typename
Derived
::
Scalar
T
;
Eigen
::
AngleAxis
<
T
>
aa
=
Eigen
::
AngleAxis
<
T
>
(
_R
);
// Eigen::AngleAxis<T> aa(_R);
return
aa
.
axis
()
*
aa
.
angle
();
// return aa.axis() * aa.angle();
/*
*
* phi = ( trace ( R) -1 ) / 2;
*
* u = vee( R - R')/(2 sin phi)
*/
T
phi
=
acos
(
_R
.
trace
()
-
(
T
)
1.0
)
/
(
T
)
2.0
;
if
(
phi
>
(
T
)
1e-8
)
{
Eigen
::
Matrix
<
T
,
3
,
1
>
u
=
vee
(
_R
-
_R
.
transpose
())
/
((
T
)
2
*
sin
(
phi
));
return
phi
*
u
;
}
else
{
// Try a better 1-order approximation instead of this 0-order
// Anyway Eigen AngleAxis was using (1,0,0) too
Eigen
::
Matrix
<
T
,
3
,
1
>
u
(
(
T
)
1.0
,
(
T
)
0.0
,
(
T
)
0.0
);
return
phi
*
u
;
}
}
}
/** \brief Rotation vector to quaternion conversion
/** \brief Rotation vector to quaternion conversion
...
...
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