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
48ca006c
Commit
48ca006c
authored
9 years ago
by
Luc Maisonobe
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Improved expected line in slowFind."
This reverts commit
294d3a57
.
parent
d4ecf2e8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/orekit/rugged/api/Rugged.java
+4
-0
4 additions, 0 deletions
src/main/java/org/orekit/rugged/api/Rugged.java
src/main/java/org/orekit/rugged/linesensor/SensorMeanPlaneCrossing.java
+21
-40
21 additions, 40 deletions
...org/orekit/rugged/linesensor/SensorMeanPlaneCrossing.java
with
25 additions
and
40 deletions
src/main/java/org/orekit/rugged/api/Rugged.java
+
4
−
0
View file @
48ca006c
...
...
@@ -453,6 +453,10 @@ public class Rugged {
crossingResult
.
getTargetDirection
().
toVector3D
(),
MAX_EVAL
,
COARSE_INVERSE_LOCATION_ACCURACY
);
final
double
coarsePixel
=
pixelCrossing
.
locatePixel
(
crossingResult
.
getDate
());
if
(
Double
.
isNaN
(
coarsePixel
))
{
// target is out of search interval
return
null
;
}
// fix line by considering the closest pixel exact position and line-of-sight
// (this pixel might point towards a direction slightly above or below the mean sensor plane)
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/orekit/rugged/linesensor/SensorMeanPlaneCrossing.java
+
21
−
40
View file @
48ca006c
...
...
@@ -496,6 +496,23 @@ public class SensorMeanPlaneCrossing {
public
CrossingResult
slowFind
(
final
PVCoordinates
targetPV
,
final
double
initialGuess
)
throws
RuggedException
{
// set up function evaluating to 0.0 where target matches line
final
UnivariateFunction
f
=
new
UnivariateFunction
()
{
/** {@inheritDoc} */
@Override
public
double
value
(
final
double
x
)
throws
RuggedExceptionWrapper
{
try
{
final
AbsoluteDate
date
=
sensor
.
getDate
(
x
);
final
FieldVector3D
<
DerivativeStructure
>
targetDirection
=
evaluateLine
(
x
,
targetPV
,
scToBody
.
getBodyToInertial
(
date
),
scToBody
.
getScToInertial
(
date
));
final
DerivativeStructure
beta
=
FieldVector3D
.
angle
(
targetDirection
,
meanPlaneNormal
);
return
0.5
*
FastMath
.
PI
-
beta
.
getValue
();
}
catch
(
RuggedException
re
)
{
throw
new
RuggedExceptionWrapper
(
re
);
}
}
};
try
{
// safety check
...
...
@@ -506,19 +523,6 @@ public class SensorMeanPlaneCrossing {
startValue
=
initialGuess
;
}
// set up function evaluating to 0.0 where target matches line
final
UnivariateFunction
f
=
new
UnivariateFunction
()
{
/** {@inheritDoc} */
@Override
public
double
value
(
final
double
x
)
throws
RuggedExceptionWrapper
{
try
{
return
targetOffset
(
x
,
targetPV
).
getValue
();
}
catch
(
RuggedException
re
)
{
throw
new
RuggedExceptionWrapper
(
re
);
}
}
};
final
UnivariateSolver
solver
=
new
BracketingNthOrderBrentSolver
(
accuracy
,
5
);
final
double
crossingLine
=
solver
.
solve
(
maxEval
,
f
,
minLine
,
maxLine
,
startValue
);
...
...
@@ -528,39 +532,16 @@ public class SensorMeanPlaneCrossing {
return
new
CrossingResult
(
sensor
.
getDate
(
crossingLine
),
crossingLine
,
targetPV
.
getPosition
(),
targetDirection
);
}
catch
(
NoBracketingException
nbe
)
{
final
DerivativeStructure
fMinLine
=
targetOffset
(
minLine
,
targetPV
);
final
DerivativeStructure
fMaxLine
=
targetOffset
(
maxLine
,
targetPV
);
final
double
linearExpectedLine
=
(
fMaxLine
.
getValue
()
*
minLine
-
fMinLine
.
getValue
()
*
maxLine
)
/
(
fMaxLine
.
getValue
()
-
fMinLine
.
getValue
());
final
double
newtonExpectedLine
;
if
(
linearExpectedLine
<
midLine
)
{
newtonExpectedLine
=
minLine
-
fMinLine
.
getPartialDerivative
(
1
)
/
fMinLine
.
getValue
();
}
else
{
newtonExpectedLine
=
maxLine
-
fMaxLine
.
getPartialDerivative
(
1
)
/
fMaxLine
.
getValue
();
}
throw
new
InverseLocOutOfLineRangeException
(
newtonExpectedLine
,
minLine
,
maxLine
);
final
double
fMinLine
=
f
.
value
(
minLine
);
final
double
fMaxLine
=
f
.
value
(
maxLine
);
final
double
expectedLine
=
(
fMaxLine
*
minLine
-
fMinLine
*
maxLine
)
/
(
fMaxLine
-
fMinLine
);
throw
new
InverseLocOutOfLineRangeException
(
expectedLine
,
minLine
,
maxLine
);
}
catch
(
RuggedExceptionWrapper
rew
)
{
throw
rew
.
getException
();
}
}
/** Target offset.
* @param lineNumber current line number
* @param targetPV target ground point
* @return target direction in spacecraft frame, with its first derivative
* with respect to line number
* @exception RuggedException if geometry cannot be computed
*/
private
DerivativeStructure
targetOffset
(
final
double
lineNumber
,
final
PVCoordinates
targetPV
)
throws
RuggedException
{
final
AbsoluteDate
date
=
sensor
.
getDate
(
lineNumber
);
final
FieldVector3D
<
DerivativeStructure
>
targetDirection
=
evaluateLine
(
lineNumber
,
targetPV
,
scToBody
.
getBodyToInertial
(
date
),
scToBody
.
getScToInertial
(
date
));
final
DerivativeStructure
beta
=
FieldVector3D
.
angle
(
targetDirection
,
meanPlaneNormal
);
return
beta
.
subtract
(
0.5
*
FastMath
.
PI
);
};
/** Evaluate geometry for a given line number.
* @param lineNumber current line number
* @param targetPV target ground point
...
...
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