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
aa6b5178
Commit
aa6b5178
authored
8 years ago
by
Joseph Mirabel
Committed by
Joseph Mirabel
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Minor][C++] Clean code and fix conversion issue.
parent
b6c3684b
Branches
Branches containing commit
Tags
v1.0.2
Tags containing commit
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/math/quaternion.hpp
+6
-6
6 additions, 6 deletions
src/math/quaternion.hpp
with
6 additions
and
6 deletions
src/math/quaternion.hpp
+
6
−
6
View file @
aa6b5178
...
...
@@ -94,7 +94,7 @@ namespace se3
const
Scalar
alpha
=
((
Scalar
)
3
-
N2
)
/
2
;
const_cast
<
Eigen
::
QuaternionBase
<
D
>
&>
(
q
).
coeffs
()
*=
alpha
;
#ifndef NDEBUG
const
Scalar
M
=
3
*
std
::
pow
((
Scalar
)
1
-
epsilon
,
(
Scalar
)
-
5
/
2
)
/
4
;
const
Scalar
M
=
3
*
std
::
pow
((
Scalar
)
1
.
-
epsilon
,
(
(
Scalar
)
-
5
)
/
2
)
/
4
;
assert
(
std
::
fabs
(
q
.
norm
()
-
1
)
<=
std
::
max
(
M
*
sqrt
(
N2
)
*
(
N2
-
1
)
*
(
N2
-
1
)
/
2
,
Eigen
::
NumTraits
<
Scalar
>::
epsilon
()));
#endif
...
...
@@ -104,8 +104,8 @@ namespace se3
template
<
typename
D
>
void
uniformRandom
(
const
Eigen
::
QuaternionBase
<
D
>
&
q
)
{
// EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(D, 4);
typedef
typename
D
::
Scalar
Scalar
;
typedef
Eigen
::
QuaternionBase
<
D
>
Base
;
// Rotational part
const
Scalar
u1
=
(
Scalar
)
rand
()
/
RAND_MAX
;
...
...
@@ -118,10 +118,10 @@ namespace se3
Scalar
s2
,
c2
;
SINCOS
(
2.
*
PI
*
u2
,
&
s2
,
&
c2
);
Scalar
s3
,
c3
;
SINCOS
(
2.
*
PI
*
u3
,
&
s3
,
&
c3
);
const_cast
<
Eigen
::
Quaternion
Base
<
D
>
&>
(
q
).
w
()
=
mult1
*
s2
;
const_cast
<
Eigen
::
Quaternion
Base
<
D
>
&>
(
q
).
x
()
=
mult1
*
c2
;
const_cast
<
Eigen
::
Quaternion
Base
<
D
>
&>
(
q
).
y
()
=
mult2
*
s3
;
const_cast
<
Eigen
::
Quaternion
Base
<
D
>
&>
(
q
).
z
()
=
mult2
*
c3
;
const_cast
<
Base
&>
(
q
).
w
()
=
mult1
*
s2
;
const_cast
<
Base
&>
(
q
).
x
()
=
mult1
*
c2
;
const_cast
<
Base
&>
(
q
).
y
()
=
mult2
*
s3
;
const_cast
<
Base
&>
(
q
).
z
()
=
mult2
*
c3
;
}
}
#endif //#ifndef __math_quaternion_hpp__
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