Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ale
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aflab
astrogeology
Ale
Commits
52003c59
Commit
52003c59
authored
5 years ago
by
Kaitlyn Lee
Committed by
Jesse Mapel
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Capitalized enum values.
parent
41a32cb9
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/Rotation.h
+2
-2
2 additions, 2 deletions
include/Rotation.h
src/Rotation.cpp
+2
-2
2 additions, 2 deletions
src/Rotation.cpp
tests/ctests/RotationTest.cpp
+4
-4
4 additions, 4 deletions
tests/ctests/RotationTest.cpp
with
8 additions
and
8 deletions
include/Rotation.h
+
2
−
2
View file @
52003c59
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
namespace
ale
{
namespace
ale
{
enum
RotationInterpolation
{
enum
RotationInterpolation
{
slerp
,
// Spherical interpolation
SLERP
,
// Spherical interpolation
nlerp
// Normalized linear interpolation
NLERP
// Normalized linear interpolation
};
};
/**
/**
...
...
This diff is collapsed.
Click to expand it.
src/Rotation.cpp
+
2
−
2
View file @
52003c59
...
@@ -249,10 +249,10 @@ namespace ale {
...
@@ -249,10 +249,10 @@ namespace ale {
)
const
{
)
const
{
Eigen
::
Quaterniond
interpQuat
;
Eigen
::
Quaterniond
interpQuat
;
switch
(
interpType
)
{
switch
(
interpType
)
{
case
slerp
:
case
SLERP
:
interpQuat
=
m_impl
->
quat
.
slerp
(
t
,
nextRotation
.
m_impl
->
quat
);
interpQuat
=
m_impl
->
quat
.
slerp
(
t
,
nextRotation
.
m_impl
->
quat
);
break
;
break
;
case
nlerp
:
case
NLERP
:
interpQuat
=
Eigen
::
Quaterniond
(
interpQuat
=
Eigen
::
Quaterniond
(
linearInterpolate
(
m_impl
->
quat
.
w
(),
nextRotation
.
m_impl
->
quat
.
w
(),
t
),
linearInterpolate
(
m_impl
->
quat
.
w
(),
nextRotation
.
m_impl
->
quat
.
w
(),
t
),
linearInterpolate
(
m_impl
->
quat
.
x
(),
nextRotation
.
m_impl
->
quat
.
x
(),
t
),
linearInterpolate
(
m_impl
->
quat
.
x
(),
nextRotation
.
m_impl
->
quat
.
x
(),
t
),
...
...
This diff is collapsed.
Click to expand it.
tests/ctests/RotationTest.cpp
+
4
−
4
View file @
52003c59
...
@@ -390,7 +390,7 @@ TEST(RotationTest, MultiplyRotation) {
...
@@ -390,7 +390,7 @@ TEST(RotationTest, MultiplyRotation) {
TEST
(
RotationTest
,
Slerp
)
{
TEST
(
RotationTest
,
Slerp
)
{
Rotation
rotationOne
(
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
rotationOne
(
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
rotationTwo
(
-
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
rotationTwo
(
-
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
interpRotation
=
rotationOne
.
interpolate
(
rotationTwo
,
0.125
,
ale
::
slerp
);
Rotation
interpRotation
=
rotationOne
.
interpolate
(
rotationTwo
,
0.125
,
ale
::
SLERP
);
vector
<
double
>
quat
=
interpRotation
.
toQuaternion
();
vector
<
double
>
quat
=
interpRotation
.
toQuaternion
();
ASSERT_EQ
(
quat
.
size
(),
4
);
ASSERT_EQ
(
quat
.
size
(),
4
);
EXPECT_NEAR
(
quat
[
0
],
cos
(
M_PI
*
3.0
/
8.0
),
1e-10
);
EXPECT_NEAR
(
quat
[
0
],
cos
(
M_PI
*
3.0
/
8.0
),
1e-10
);
...
@@ -402,7 +402,7 @@ TEST(RotationTest, Slerp) {
...
@@ -402,7 +402,7 @@ TEST(RotationTest, Slerp) {
TEST
(
RotationTest
,
SlerpExtrapolate
)
{
TEST
(
RotationTest
,
SlerpExtrapolate
)
{
Rotation
rotationOne
(
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
rotationOne
(
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
rotationTwo
(
-
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
rotationTwo
(
-
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
interpRotation
=
rotationOne
.
interpolate
(
rotationTwo
,
1.125
,
ale
::
slerp
);
Rotation
interpRotation
=
rotationOne
.
interpolate
(
rotationTwo
,
1.125
,
ale
::
SLERP
);
vector
<
double
>
quat
=
interpRotation
.
toQuaternion
();
vector
<
double
>
quat
=
interpRotation
.
toQuaternion
();
ASSERT_EQ
(
quat
.
size
(),
4
);
ASSERT_EQ
(
quat
.
size
(),
4
);
EXPECT_NEAR
(
quat
[
0
],
cos
(
M_PI
*
17.0
/
24.0
),
1e-10
);
EXPECT_NEAR
(
quat
[
0
],
cos
(
M_PI
*
17.0
/
24.0
),
1e-10
);
...
@@ -414,7 +414,7 @@ TEST(RotationTest, SlerpExtrapolate) {
...
@@ -414,7 +414,7 @@ TEST(RotationTest, SlerpExtrapolate) {
TEST
(
RotationTest
,
Nlerp
)
{
TEST
(
RotationTest
,
Nlerp
)
{
Rotation
rotationOne
(
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
rotationOne
(
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
rotationTwo
(
-
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
rotationTwo
(
-
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
interpRotation
=
rotationOne
.
interpolate
(
rotationTwo
,
0.125
,
ale
::
nlerp
);
Rotation
interpRotation
=
rotationOne
.
interpolate
(
rotationTwo
,
0.125
,
ale
::
NLERP
);
double
scaling
=
8.0
/
sqrt
(
57.0
);
double
scaling
=
8.0
/
sqrt
(
57.0
);
vector
<
double
>
quat
=
interpRotation
.
toQuaternion
();
vector
<
double
>
quat
=
interpRotation
.
toQuaternion
();
ASSERT_EQ
(
quat
.
size
(),
4
);
ASSERT_EQ
(
quat
.
size
(),
4
);
...
@@ -427,7 +427,7 @@ TEST(RotationTest, Nlerp) {
...
@@ -427,7 +427,7 @@ TEST(RotationTest, Nlerp) {
TEST
(
RotationTest
,
NlerpExtrapolate
)
{
TEST
(
RotationTest
,
NlerpExtrapolate
)
{
Rotation
rotationOne
(
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
rotationOne
(
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
rotationTwo
(
-
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
rotationTwo
(
-
0.5
,
0.5
,
0.5
,
0.5
);
Rotation
interpRotation
=
rotationOne
.
interpolate
(
rotationTwo
,
1.125
,
ale
::
nlerp
);
Rotation
interpRotation
=
rotationOne
.
interpolate
(
rotationTwo
,
1.125
,
ale
::
NLERP
);
double
scaling
=
8.0
/
sqrt
(
73.0
);
double
scaling
=
8.0
/
sqrt
(
73.0
);
vector
<
double
>
quat
=
interpRotation
.
toQuaternion
();
vector
<
double
>
quat
=
interpRotation
.
toQuaternion
();
ASSERT_EQ
(
quat
.
size
(),
4
);
ASSERT_EQ
(
quat
.
size
(),
4
);
...
...
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