Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rugged
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
Orekit
Rugged
Commits
3aae8e86
Commit
3aae8e86
authored
10 years ago
by
Luc Maisonobe
Browse files
Options
Downloads
Patches
Plain Diff
Ensure sensor mean plane normal has a deterministic orientation.
parent
08ad7cf3
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/main/java/org/orekit/rugged/core/Sensor.java
+16
-4
16 additions, 4 deletions
src/main/java/org/orekit/rugged/core/Sensor.java
src/test/java/org/orekit/rugged/core/SensorTest.java
+4
-4
4 additions, 4 deletions
src/test/java/org/orekit/rugged/core/SensorTest.java
with
20 additions
and
8 deletions
src/main/java/org/orekit/rugged/core/Sensor.java
+
16
−
4
View file @
3aae8e86
...
...
@@ -114,7 +114,14 @@ public class Sensor {
// extract the left singular vector corresponding to least singular value
// (i.e. last vector since Apache Commons Math returns the values
// in non-increasing order)
normal
=
new
Vector3D
(
svd
.
getU
().
getColumn
(
2
)).
normalize
();
final
Vector3D
singularVector
=
new
Vector3D
(
svd
.
getU
().
getColumn
(
2
)).
normalize
();
// check rotation order
if
(
Vector3D
.
dotProduct
(
singularVector
,
Vector3D
.
crossProduct
(
los
.
get
(
0
),
los
.
get
(
los
.
size
()
-
1
)))
>=
0
)
{
normal
=
singularVector
;
}
else
{
normal
=
singularVector
.
negate
();
}
}
...
...
@@ -165,16 +172,21 @@ public class Sensor {
}
/** Get the mean plane normal.
* <p>
* The normal is oriented such traversing pixels in increasing indices
* order corresponds is consistent with trigonometric order (i.e.
* counterclockwise).
* </p>
* @return mean plane normal
*/
public
Vector3D
getMeanPlaneNormal
()
{
return
normal
;
}
/** Get the
mean plane
reference point.
* @return
mean plane
reference point
/** Get the
sensor
reference point.
* @return reference point
*/
public
Vector3D
get
MeanPlane
ReferencePoint
()
{
public
Vector3D
getReferencePoint
()
{
return
referencePoint
;
}
...
...
This diff is collapsed.
Click to expand it.
src/test/java/org/orekit/rugged/core/SensorTest.java
+
4
−
4
View file @
3aae8e86
...
...
@@ -52,8 +52,8 @@ public class SensorTest {
Assert
.
assertEquals
(
"perfect line"
,
sensor
.
getName
());
Assert
.
assertEquals
(
AbsoluteDate
.
J2000_EPOCH
,
sensor
.
getDate
(
0.0
));
Assert
.
assertEquals
(
0.0
,
Vector3D
.
dotProduct
(
normal
,
center
.
subtract
(
sensor
.
get
MeanPlane
ReferencePoint
())),
1.0
e
-
15
);
Assert
.
assertEquals
(
0.0
,
FastMath
.
sin
(
Vector3D
.
angle
(
normal
,
sensor
.
getMeanPlaneNormal
())
)
,
1.0
e
-
15
);
Assert
.
assertEquals
(
0.0
,
Vector3D
.
dotProduct
(
normal
,
center
.
subtract
(
sensor
.
getReferencePoint
())),
1.0
e
-
15
);
Assert
.
assertEquals
(
0.0
,
Vector3D
.
angle
(
normal
,
sensor
.
getMeanPlaneNormal
()),
1.0
e
-
15
);
}
...
...
@@ -85,8 +85,8 @@ public class SensorTest {
Assert
.
assertEquals
(
"noisy line"
,
sensor
.
getName
());
Assert
.
assertEquals
(
AbsoluteDate
.
J2000_EPOCH
,
sensor
.
getDate
(
0.0
));
Assert
.
assertEquals
(
0.0
,
Vector3D
.
dotProduct
(
normal
,
center
.
subtract
(
sensor
.
get
MeanPlane
ReferencePoint
())),
1.0
e
-
5
);
Assert
.
assertEquals
(
0.0
,
FastMath
.
sin
(
Vector3D
.
angle
(
normal
,
sensor
.
getMeanPlaneNormal
())
)
,
3.0
e
-
7
);
Assert
.
assertEquals
(
0.0
,
Vector3D
.
dotProduct
(
normal
,
center
.
subtract
(
sensor
.
getReferencePoint
())),
1.0
e
-
5
);
Assert
.
assertEquals
(
0.0
,
Vector3D
.
angle
(
normal
,
sensor
.
getMeanPlaneNormal
()),
3.0
e
-
7
);
}
...
...
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