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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aflab
astrogeology
Usgscsm
Commits
d8434c15
Commit
d8434c15
authored
6 years ago
by
Jesse Mapel
Committed by
jlaura
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Made framer inherit from settable ellipsoid (#228)
* Made framer inherit from settable ellipsoid * Added radii tests
parent
9598b19b
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/usgscsm/UsgsAstroFrameSensorModel.h
+12
-1
12 additions, 1 deletion
include/usgscsm/UsgsAstroFrameSensorModel.h
src/UsgsAstroFrameSensorModel.cpp
+15
-0
15 additions, 0 deletions
src/UsgsAstroFrameSensorModel.cpp
tests/FrameCameraTests.cpp
+14
-0
14 additions, 0 deletions
tests/FrameCameraTests.cpp
with
41 additions
and
1 deletion
include/usgscsm/UsgsAstroFrameSensorModel.h
+
12
−
1
View file @
d8434c15
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
#include
<iostream>
#include
<iostream>
#include
<vector>
#include
<vector>
#include
"RasterGM.h"
#include
"RasterGM.h"
#include
<SettableEllipsoid.h>
#include
"CorrelationModel.h"
#include
"CorrelationModel.h"
#include
"Distortion.h"
#include
"Distortion.h"
#include
"Utilities.h"
#include
"Utilities.h"
...
@@ -18,7 +19,7 @@
...
@@ -18,7 +19,7 @@
using
json
=
nlohmann
::
json
;
using
json
=
nlohmann
::
json
;
class
UsgsAstroFrameSensorModel
:
public
csm
::
RasterGM
{
class
UsgsAstroFrameSensorModel
:
public
csm
::
RasterGM
,
virtual
public
csm
::
SettableEllipsoid
{
// UsgsAstroFramePlugin needs to access private members
// UsgsAstroFramePlugin needs to access private members
friend
class
UsgsAstroFramePlugin
;
friend
class
UsgsAstroFramePlugin
;
...
@@ -288,6 +289,16 @@ class UsgsAstroFrameSensorModel : public csm::RasterGM {
...
@@ -288,6 +289,16 @@ class UsgsAstroFrameSensorModel : public csm::RasterGM {
// If the argument state string is empty, the model remains unchanged.
// If the argument state string is empty, the model remains unchanged.
//<
//<
// Implement methods from the SettableEllipsoid class
virtual
csm
::
Ellipsoid
getEllipsoid
()
const
;
//> This method returns the planetary ellipsoid.
//<
virtual
void
setEllipsoid
(
const
csm
::
Ellipsoid
&
ellipsoid
);
//> This method sets the planetary ellipsoid.
//<
// IMPLEMENT GEOMETRICMODEL PURE VIRTUALS
// IMPLEMENT GEOMETRICMODEL PURE VIRTUALS
// See GeometricModel.h for documentation
// See GeometricModel.h for documentation
virtual
csm
::
EcefCoord
getReferencePoint
()
const
;
virtual
csm
::
EcefCoord
getReferencePoint
()
const
;
...
...
This diff is collapsed.
Click to expand it.
src/UsgsAstroFrameSensorModel.cpp
+
15
−
0
View file @
d8434c15
...
@@ -1170,6 +1170,21 @@ std::vector<double> UsgsAstroFrameSensorModel::getCrossCovarianceMatrix(
...
@@ -1170,6 +1170,21 @@ std::vector<double> UsgsAstroFrameSensorModel::getCrossCovarianceMatrix(
}
}
csm
::
Ellipsoid
UsgsAstroFrameSensorModel
::
getEllipsoid
()
const
{
MESSAGE_LOG
(
this
->
m_logger
,
"Accessing ellipsoid radii {} {}"
,
m_majorAxis
,
m_minorAxis
);
return
csm
::
Ellipsoid
(
m_majorAxis
,
m_minorAxis
);
}
void
UsgsAstroFrameSensorModel
::
setEllipsoid
(
const
csm
::
Ellipsoid
&
ellipsoid
)
{
MESSAGE_LOG
(
this
->
m_logger
,
"Setting ellipsoid radii {} {}"
,
ellipsoid
.
getSemiMajorRadius
(),
ellipsoid
.
getSemiMinorRadius
());
m_majorAxis
=
ellipsoid
.
getSemiMajorRadius
();
m_minorAxis
=
ellipsoid
.
getSemiMinorRadius
();
}
void
UsgsAstroFrameSensorModel
::
calcRotationMatrix
(
void
UsgsAstroFrameSensorModel
::
calcRotationMatrix
(
double
m
[
3
][
3
])
const
{
double
m
[
3
][
3
])
const
{
MESSAGE_LOG
(
this
->
m_logger
,
"Calculating rotation matrix"
);
MESSAGE_LOG
(
this
->
m_logger
,
"Calculating rotation matrix"
);
...
...
This diff is collapsed.
Click to expand it.
tests/FrameCameraTests.cpp
+
14
−
0
View file @
d8434c15
...
@@ -95,6 +95,20 @@ TEST_F(OrbitalFrameSensorModel, Center) {
...
@@ -95,6 +95,20 @@ TEST_F(OrbitalFrameSensorModel, Center) {
EXPECT_DOUBLE_EQ
(
groundPt
.
z
,
0
);
EXPECT_DOUBLE_EQ
(
groundPt
.
z
,
0
);
}
}
TEST_F
(
FrameSensorModel
,
Radii
)
{
csm
::
Ellipsoid
ellipsoid
=
sensorModel
->
getEllipsoid
();
EXPECT_DOUBLE_EQ
(
ellipsoid
.
getSemiMajorRadius
(),
10
);
EXPECT_DOUBLE_EQ
(
ellipsoid
.
getSemiMinorRadius
(),
10
);
}
TEST_F
(
FrameSensorModel
,
SetRadii
)
{
csm
::
Ellipsoid
ellipsoid1
(
1000
,
1500
);
sensorModel
->
setEllipsoid
(
ellipsoid1
);
csm
::
Ellipsoid
ellipsoid2
=
sensorModel
->
getEllipsoid
();
EXPECT_DOUBLE_EQ
(
ellipsoid2
.
getSemiMajorRadius
(),
1000
);
EXPECT_DOUBLE_EQ
(
ellipsoid2
.
getSemiMinorRadius
(),
1500
);
}
TEST_F
(
OrbitalFrameSensorModel
,
GroundPartials
)
{
TEST_F
(
OrbitalFrameSensorModel
,
GroundPartials
)
{
csm
::
EcefCoord
groundPt
(
1000000.0
,
0.0
,
0.0
);
csm
::
EcefCoord
groundPt
(
1000000.0
,
0.0
,
0.0
);
std
::
vector
<
double
>
partials
=
sensorModel
->
computeGroundPartials
(
groundPt
);
std
::
vector
<
double
>
partials
=
sensorModel
->
computeGroundPartials
(
groundPt
);
...
...
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