Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
Usgscsm
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aflab
astrogeology
Usgscsm
Commits
07f3e5b0
Commit
07f3e5b0
authored
6 years ago
by
Jesse Mapel
Committed by
Kristin
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed some docs (#192)
* Fixed some docs * Fixed typos
parent
a64aa21c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Utilities.cpp
+22
-0
22 additions, 0 deletions
src/Utilities.cpp
tests/LineScanCameraTests.cpp
+0
-4
0 additions, 4 deletions
tests/LineScanCameraTests.cpp
with
22 additions
and
4 deletions
src/Utilities.cpp
+
22
−
0
View file @
07f3e5b0
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
using
json
=
nlohmann
::
json
;
using
json
=
nlohmann
::
json
;
// Calculates a rotation matrix from Euler angles
// Calculates a rotation matrix from Euler angles
// in - euler[3]
// out - rotationMatrix[9]
void
calculateRotationMatrixFromEuler
(
void
calculateRotationMatrixFromEuler
(
double
euler
[],
double
euler
[],
double
rotationMatrix
[])
double
rotationMatrix
[])
...
@@ -27,6 +29,8 @@ void calculateRotationMatrixFromEuler(
...
@@ -27,6 +29,8 @@ void calculateRotationMatrixFromEuler(
// uses a quaternion to calclate a rotation matrix.
// uses a quaternion to calclate a rotation matrix.
// in - q[4]
// out - rotationMatrix[9]
void
calculateRotationMatrixFromQuaternions
(
void
calculateRotationMatrixFromQuaternions
(
double
q
[
4
],
double
q
[
4
],
double
rotationMatrix
[
9
])
double
rotationMatrix
[
9
])
...
@@ -48,6 +52,16 @@ void calculateRotationMatrixFromQuaternions(
...
@@ -48,6 +52,16 @@ void calculateRotationMatrixFromQuaternions(
rotationMatrix
[
8
]
=
-
q
[
0
]
*
q
[
0
]
-
q
[
1
]
*
q
[
1
]
+
q
[
2
]
*
q
[
2
]
+
q
[
3
]
*
q
[
3
];
rotationMatrix
[
8
]
=
-
q
[
0
]
*
q
[
0
]
-
q
[
1
]
*
q
[
1
]
+
q
[
2
]
*
q
[
2
]
+
q
[
3
]
*
q
[
3
];
}
}
// Compue the distorted focal plane coordinate for a given image pixel
// in - line
// in - sample
// in - sampleOrigin - the origin of the ccd coordinate system relative to the top left of the ccd
// in - lineOrigin - the origin of the ccd coordinate system relative to the top left of the ccd
// in - sampleSumming
// in - startingSample - first ccd sample for the image
// in - iTransS[3] - the transformation from focal plane to ccd samples
// in - iTransL[3] - the transformation from focal plane to ccd lines
// out - natFocalPlane
void
computeDistortedFocalPlaneCoordinates
(
void
computeDistortedFocalPlaneCoordinates
(
const
double
&
line
,
const
double
&
line
,
const
double
&
sample
,
const
double
&
sample
,
...
@@ -77,6 +91,11 @@ void computeDistortedFocalPlaneCoordinates(
...
@@ -77,6 +91,11 @@ void computeDistortedFocalPlaneCoordinates(
};
};
// Define imaging ray in image space (In other words, create a look vector in camera space)
// Define imaging ray in image space (In other words, create a look vector in camera space)
// in - undistortedFocalPlaneX
// in - undistortedFocalPlaneY
// in - zDirection - Either 1 or -1. The direction of the boresight
// in - focalLength
// out - cameraLook[3]
void
createCameraLookVector
(
void
createCameraLookVector
(
const
double
&
undistortedFocalPlaneX
,
const
double
&
undistortedFocalPlaneX
,
const
double
&
undistortedFocalPlaneY
,
const
double
&
undistortedFocalPlaneY
,
...
@@ -95,6 +114,7 @@ void createCameraLookVector(
...
@@ -95,6 +114,7 @@ void createCameraLookVector(
cameraLook
[
2
]
/=
magnitude
;
cameraLook
[
2
]
/=
magnitude
;
}
}
// convert a measurement
double
metric_conversion
(
double
val
,
std
::
string
from
,
std
::
string
to
)
{
double
metric_conversion
(
double
val
,
std
::
string
from
,
std
::
string
to
)
{
json
typemap
=
{
json
typemap
=
{
{
"m"
,
0
},
{
"m"
,
0
},
...
@@ -551,6 +571,8 @@ double getSemiMinorRadius(json isd, csm::WarningList *list) {
...
@@ -551,6 +571,8 @@ double getSemiMinorRadius(json isd, csm::WarningList *list) {
return
radius
;
return
radius
;
}
}
// Gets the type of distortion model from the isd. If none is specified defaults
// to transverse
DistortionType
getDistortionModel
(
json
isd
,
csm
::
WarningList
*
list
)
{
DistortionType
getDistortionModel
(
json
isd
,
csm
::
WarningList
*
list
)
{
json
distoriton_subset
=
isd
.
at
(
"optical_distortion"
);
json
distoriton_subset
=
isd
.
at
(
"optical_distortion"
);
...
...
This diff is collapsed.
Click to expand it.
tests/LineScanCameraTests.cpp
+
0
−
4
View file @
07f3e5b0
...
@@ -12,10 +12,6 @@
...
@@ -12,10 +12,6 @@
using
json
=
nlohmann
::
json
;
using
json
=
nlohmann
::
json
;
// TODO all commented out expects are failing and need to either have updated numbers
// for the line scanner test cases, or we need to figure out why the line scanner
// is not honoring this functionality.
TEST_F
(
ConstVelocityLineScanSensorModel
,
State
)
{
TEST_F
(
ConstVelocityLineScanSensorModel
,
State
)
{
std
::
string
modelState
=
sensorModel
->
getModelState
();
std
::
string
modelState
=
sensorModel
->
getModelState
();
...
...
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