fr.cnes.sirius.patrius.events.sensor
Class ExtremaSightAxisDetector

java.lang.Object
  extended by org.orekit.propagation.events.AbstractDetector
      extended by fr.cnes.sirius.patrius.events.sensor.ExtremaSightAxisDetector
All Implemented Interfaces:
Serializable, EventDetector

public class ExtremaSightAxisDetector
extends AbstractDetector

Detects the minimum angle between a sight view line and a PVCoordinateProvider target view from a Frame which origin is on the line.

The detector is similar to the extrema three body angle detector : body one is the target point, body two is the frame origin on the line, and body three is the direction vector of the line. Each one are expressed in the frame with origin on the line.

The detector doesn't take into account potential masking.

The default implementation behavior is to stop propagation when the minimum angle is detected. This can be changed by using one of the following constructors :

Since:
1.3
Version:
$Id: ExtremaSightAxisDetector.java 17586 2017-05-10 13:29:16Z bignon $
Author:
chabaudp
See Also:
EventDetector, ExtremaThreeBodiesAngleDetector, Serialized Form
Concurrency :
not thread-safe
Concurrency comment :
attributes are mutable and related to propagation, and the direct use of a not thread-safe Assembly makes this class not thread-safe itself

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.orekit.propagation.events.EventDetector
EventDetector.Action
 
Field Summary
static int MAX
          Flag for local maximum angle detection (g decreasing).
static int MIN
          Flag for local minimum angle detection (g increasing).
static int MIN_MAX
          Flag for both local minimum and maximum angle detection.
 
Fields inherited from class org.orekit.propagation.events.AbstractDetector
DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
 
Fields inherited from interface org.orekit.propagation.events.EventDetector
DECREASING, INCREASING, INCREASING_DECREASING
 
Constructor Summary
ExtremaSightAxisDetector(int extremumType, PVCoordinatesProvider target, Assembly assembly, String partName)
          Constructor based on an Assembly containing at least one part with sensor property describing the vehicle.
ExtremaSightAxisDetector(int extremumType, PVCoordinatesProvider target, Assembly assembly, String partName, double maxCheck, double threshold)
          Constructor based on an Assembly containing at least one part with sensor property describing the vehicle.
ExtremaSightAxisDetector(int extremumType, PVCoordinatesProvider target, Assembly assembly, String partName, double maxCheck, double threshold, EventDetector.Action action)
          Constructor for both minimal and maximal angle based on an Assembly containing at least one part with sensor property describing the vehicle.
ExtremaSightAxisDetector(int extremumType, PVCoordinatesProvider target, Assembly assembly, String partName, double maxCheck, double threshold, EventDetector.Action action, boolean remove)
          Constructor for both minimal and maximal angle based on an Assembly containing at least one part with sensor property describing the vehicle.
ExtremaSightAxisDetector(int extremumType, PVCoordinatesProvider target, Vector3D sightAxisDirection)
          Constructor to use without assembly.
ExtremaSightAxisDetector(int extremumType, PVCoordinatesProvider target, Vector3D sightAxisDirection, double maxCheck, double threshold)
          Constructor to use without assembly.
ExtremaSightAxisDetector(int extremumType, PVCoordinatesProvider target, Vector3D sightAxisDirection, double maxCheck, double threshold, EventDetector.Action action)
          Constructor to use without assembly.
ExtremaSightAxisDetector(int extremumType, PVCoordinatesProvider target, Vector3D sightAxisDirection, double maxCheck, double threshold, EventDetector.Action action, boolean remove)
          Constructor to use without assembly.
ExtremaSightAxisDetector(PVCoordinatesProvider target, Assembly assembly, String partName, double maxCheck, double threshold, EventDetector.Action actionMin, EventDetector.Action actionMax)
          Constructor for both minimal and maximal angle based on an Assembly containing at least one part with sensor property describing the vehicle.
ExtremaSightAxisDetector(PVCoordinatesProvider target, Assembly assembly, String partName, double maxCheck, double threshold, EventDetector.Action actionMin, EventDetector.Action actionMax, boolean removeMin, boolean removeMax)
          Constructor for both minimal and maximal angle based on an Assembly containing at least one part with sensor property describing the vehicle.
ExtremaSightAxisDetector(PVCoordinatesProvider target, Vector3D sightAxisDirection, double maxCheck, double threshold, EventDetector.Action actionMin, EventDetector.Action actionMax)
          Constructor to use without assembly for both minimal and maximal angle detection.
ExtremaSightAxisDetector(PVCoordinatesProvider target, Vector3D sightAxisDirection, double maxCheck, double threshold, EventDetector.Action actionMin, EventDetector.Action actionMax, boolean removeMin, boolean removeMax)
          Constructor to use without assembly for both minimal and maximal angle detection.
 
Method Summary
 EventDetector.Action eventOccurred(SpacecraftState s, boolean increasing, boolean forward)
          Handle an event and choose what to do next.
 double g(SpacecraftState s)
          The switching function is specific case of the extrema three bodies angle detector.
 String getSensorName()
          Get the sensor name.
 Vector3D getSightAxis()
          Get the sight axis
 PVCoordinatesProvider getTargetPoint()
          Get the target point.
 Assembly getVehicle()
          Get the vehicle.
 void init(SpacecraftState s0, AbsoluteDate t)
          Initialize event handler at the start of a propagation.
 boolean shouldBeRemoved()
          This method is called after EventDetector.eventOccurred(org.orekit.propagation.SpacecraftState, boolean, boolean) has been triggered.
 
Methods inherited from class org.orekit.propagation.events.AbstractDetector
getMaxCheckInterval, getMaxIterationCount, getSlopeSelection, getThreshold, resetState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN

public static final int MIN
Flag for local minimum angle detection (g increasing).

See Also:
Constant Field Values

MAX

public static final int MAX
Flag for local maximum angle detection (g decreasing).

See Also:
Constant Field Values

MIN_MAX

public static final int MIN_MAX
Flag for both local minimum and maximum angle detection.

See Also:
Constant Field Values
Constructor Detail

ExtremaSightAxisDetector

public ExtremaSightAxisDetector(PVCoordinatesProvider target,
                                Vector3D sightAxisDirection,
                                double maxCheck,
                                double threshold,
                                EventDetector.Action actionMin,
                                EventDetector.Action actionMax)
Constructor to use without assembly for both minimal and maximal angle detection. The sight view line will have origin on the attitude frame origin and direction of the sight axis vector3D.

Parameters:
target - the target could be on central body surface or another vehicle
sightAxisDirection - the direction of the sight view line which origin is the position of the vehicle
maxCheck - maximum checking interval (s)(see AbstractDetector)
threshold - convergence threshold (s)(see AbstractDetector)
actionMin - action to be performed when the expected local minimum is reached
actionMax - action to be performed when the expected local maximum is reached
Throws:
IllegalArgumentException - if sight axis direction is null

ExtremaSightAxisDetector

public ExtremaSightAxisDetector(PVCoordinatesProvider target,
                                Vector3D sightAxisDirection,
                                double maxCheck,
                                double threshold,
                                EventDetector.Action actionMin,
                                EventDetector.Action actionMax,
                                boolean removeMin,
                                boolean removeMax)
Constructor to use without assembly for both minimal and maximal angle detection. The sight view line will have origin on the attitude frame origin and direction of the sight axis vector3D.

Parameters:
target - the target could be on central body surface or another vehicle
sightAxisDirection - the direction of the sight view line which origin is the position of the vehicle
maxCheck - maximum checking interval (s)(see AbstractDetector)
threshold - convergence threshold (s)(see AbstractDetector)
actionMin - action to be performed when the expected local minimum is reached
actionMax - action to be performed when the expected local maximum is reached
removeMin - true if detector should be removed when the expected local minimum is reached
removeMax - true if detector should be removed when the expected local maximum is reached
Throws:
IllegalArgumentException - if sight axis direction is null

ExtremaSightAxisDetector

public ExtremaSightAxisDetector(int extremumType,
                                PVCoordinatesProvider target,
                                Vector3D sightAxisDirection,
                                double maxCheck,
                                double threshold,
                                EventDetector.Action action)
Constructor to use without assembly. The sight view line will have origin on the attitude frame origin and direction of the sight axis vector3D.

Parameters:
extremumType - MIN for minimal angle detection, MAX for maximal angle detection or MIN_MAX for both minimal and maximal angle detection
target - the target could be on central body surface or another vehicle
sightAxisDirection - the direction of the sight view line which origin is the position of the vehicle
maxCheck - maximum checking interval (s)(see AbstractDetector)
threshold - convergence threshold (s)(see AbstractDetector)
action - action to be performed when the expected extrema is reached.
Throws:
IllegalArgumentException - thrown if sight axis direction is null

ExtremaSightAxisDetector

public ExtremaSightAxisDetector(int extremumType,
                                PVCoordinatesProvider target,
                                Vector3D sightAxisDirection,
                                double maxCheck,
                                double threshold,
                                EventDetector.Action action,
                                boolean remove)
Constructor to use without assembly. The sight view line will have origin on the attitude frame origin and direction of the sight axis vector3D.

Parameters:
extremumType - MIN for minimal angle detection, MAX for maximal angle detection or MIN_MAX for both minimal and maximal angle detection
target - the target could be on central body surface or another vehicle
sightAxisDirection - the direction of the sight view line which origin is the position of the vehicle
maxCheck - maximum checking interval (s)(see AbstractDetector)
threshold - convergence threshold (s)(see AbstractDetector)
action - action to be performed when the expected extrema is reached.
remove - true if detector should be removed when the expected extrema is reached NB : If remove is true, it means detector should be removed at detection, so the value of attributes removeMIN and removeMAX must be decided according extremumType. Doing it, we ensure that detector will be removed well at propagation when calling method eventOccured (in which the value of attribute shouldBeRemoved is decided). In this case, users should better create an ExtremaSightAxisDetector with constructor ExtremaSightAxisDetector(PVCoordinatesProvider, Vector3D, double, double, EventDetector.Action, EventDetector.Action, boolean, boolean)
Throws:
IllegalArgumentException - if sight axis direction is null
Since:
3.1

ExtremaSightAxisDetector

public ExtremaSightAxisDetector(int extremumType,
                                PVCoordinatesProvider target,
                                Vector3D sightAxisDirection,
                                double maxCheck,
                                double threshold)
Constructor to use without assembly. The sight view line will have origin on the attitude frame origin and direction of the sight axis vector3D.

The default behavior is to stop propagation when the minimum angle is detected

Parameters:
extremumType - MIN for minimal angle detection, MAX for maximal angle detection or MIN_MAX for both minimal and maximal angle detection
target - the target could be on central body surface or another vehicle
sightAxisDirection - the direction of the sight view line which origin is the position of the vehicle
maxCheck - maximum checking interval (s)(see AbstractDetector)
threshold - convergence threshold (s)(see AbstractDetector)
Throws:
IllegalArgumentException - thrown if sight axis direction is null

ExtremaSightAxisDetector

public ExtremaSightAxisDetector(int extremumType,
                                PVCoordinatesProvider target,
                                Vector3D sightAxisDirection)
Constructor to use without assembly. It uses default max check and default threshold.

The default behavior is to stop propagation when the minimum angle is detected.

Parameters:
extremumType - MIN for minimal angle detection, MAX for maximal angle detection or MIN_MAX for both minimal and maximal angle detection
target - the target could be on central body surface or another vehicle
sightAxisDirection - the direction of the sight view line which origin is the position of the vehicle

ExtremaSightAxisDetector

public ExtremaSightAxisDetector(int extremumType,
                                PVCoordinatesProvider target,
                                Assembly assembly,
                                String partName,
                                double maxCheck,
                                double threshold)
Constructor based on an Assembly containing at least one part with sensor property describing the vehicle.

The default behavior is to stop propagation when the minimum angle is detected

Parameters:
extremumType - MIN for minimal angle detection, MAX for maximal angle detection or MIN_MAX for both minimal and maximal angle detection
target - the target could be on central body surface or another vehicle
assembly - the assembly to consider (its main part frame must have a parent frame !!). Must have at least one part with sensor property.
partName - the name of the part that supports the sensor property.
maxCheck - maximum checking interval (s)(see AbstractDetector)
threshold - convergence threshold (s)(see AbstractDetector)
Throws:
IllegalArgumentException - thrown if the part identified by partName doesn't have the SENSOR property.

ExtremaSightAxisDetector

public ExtremaSightAxisDetector(int extremumType,
                                PVCoordinatesProvider target,
                                Assembly assembly,
                                String partName)
Constructor based on an Assembly containing at least one part with sensor property describing the vehicle. It uses default max check and default threshold.

The default behavior is to stop propagation when the minimum angle is detected

Parameters:
extremumType - MIN for minimal angle detection, MAX for maximal angle detection or MIN_MAX for both minimal and maximal angle detection
target - the target could be on central body surface or another vehicle
assembly - the assembly to consider (its main part frame must have a parent frame !!). Must have at least one part with sensor property.
partName - the name of the part that supports the sensor property.

ExtremaSightAxisDetector

public ExtremaSightAxisDetector(int extremumType,
                                PVCoordinatesProvider target,
                                Assembly assembly,
                                String partName,
                                double maxCheck,
                                double threshold,
                                EventDetector.Action action)
Constructor for both minimal and maximal angle based on an Assembly containing at least one part with sensor property describing the vehicle.

Parameters:
extremumType - MIN for minimal angle detection, MAX for maximal angle detection or MIN_MAX for both minimal and maximal angle detection
target - the target could be on central body surface or another vehicle
assembly - the assembly to consider (its main part frame must have a parent frame !) Must have at least one part with sensor property.
partName - the name of the part that supports the sensor property.
maxCheck - maximum checking interval (s)(see AbstractDetector)
threshold - convergence threshold (s)(see AbstractDetector)
action - action to be performed when the expected extrema is reached
Throws:
IllegalArgumentException - if the part identified by partName doesn't have the SENSOR property

ExtremaSightAxisDetector

public ExtremaSightAxisDetector(int extremumType,
                                PVCoordinatesProvider target,
                                Assembly assembly,
                                String partName,
                                double maxCheck,
                                double threshold,
                                EventDetector.Action action,
                                boolean remove)
Constructor for both minimal and maximal angle based on an Assembly containing at least one part with sensor property describing the vehicle.

Parameters:
extremumType - MIN for minimal angle detection, MAX for maximal angle detection or MIN_MAX for both minimal and maximal angle detection
target - the target could be on central body surface or another vehicle
assembly - the assembly to consider (its main part frame must have a parent frame !!). Must have at least one part with sensor property.
partName - the name of the part that supports the sensor property.
maxCheck - maximum checking interval (s)(see AbstractDetector)
threshold - convergence threshold (s)(see AbstractDetector)
action - action to be performed when the expected extrema is reached.
remove - true if detector should be removed when the expected extrema is reached NB : If remove is true, it means detector should be removed at detection, so the value of attributes removeMIN and removeMAX must be decided according extremumType. Doing it, we ensure that detector will be removed well at propagation when calling method eventOccured (in which the value of attribute shouldBeRemoved is decided). In this case, users should better create an ExtremaDistanceDectector with constructor ExtremaSightAxisDetector(PVCoordinatesProvider, Assembly, String, double, double, EventDetector.Action, EventDetector.Action, boolean, boolean)
Throws:
IllegalArgumentException - if the part identified by partName doesn't have the SENSOR property.

ExtremaSightAxisDetector

public ExtremaSightAxisDetector(PVCoordinatesProvider target,
                                Assembly assembly,
                                String partName,
                                double maxCheck,
                                double threshold,
                                EventDetector.Action actionMin,
                                EventDetector.Action actionMax)
Constructor for both minimal and maximal angle based on an Assembly containing at least one part with sensor property describing the vehicle.

Parameters:
target - the target can be on central body surface or another vehicle
assembly - the assembly to consider (its main part frame must have a parent frame !!). Must have at least one part with sensor property.
partName - the name of the part that supports the sensor property.
maxCheck - maximum checking interval (s)(see AbstractDetector)
threshold - convergence threshold (s)(see AbstractDetector)
actionMin - action to be performed when the expected local minimum is reached
actionMax - action to be performed when the expected local maximum is reached
Throws:
IllegalArgumentException - if the part identified by partName doesn't have the sensor property.

ExtremaSightAxisDetector

public ExtremaSightAxisDetector(PVCoordinatesProvider target,
                                Assembly assembly,
                                String partName,
                                double maxCheck,
                                double threshold,
                                EventDetector.Action actionMin,
                                EventDetector.Action actionMax,
                                boolean removeMin,
                                boolean removeMax)
Constructor for both minimal and maximal angle based on an Assembly containing at least one part with sensor property describing the vehicle.

Parameters:
target - the target can be on central body surface or another vehicle
assembly - the assembly to consider (its main part frame must have a parent frame !!). Must have at least one part with sensor property.
partName - the name of the part that supports the sensor property.
maxCheck - maximum checking interval (s)(see AbstractDetector)
threshold - convergence threshold (s)(see AbstractDetector)
actionMin - action to be performed when the expected local minimum is reached
actionMax - action to be performed when the expected local maximum is reached
removeMin - true if detector should be removed when the expected local minimum is reached
removeMax - true if detector should be removed when the expected local maximum is reached
Throws:
IllegalArgumentException - if the part identified by partName doesn't have the SENSOR property.
Method Detail

init

public void init(SpacecraftState s0,
                 AbsoluteDate t)
Description copied from class: AbstractDetector
Initialize event handler at the start of a propagation.

This method is called once at the start of the propagation. It may be used by the event handler to initialize some internal data if needed.

Specified by:
init in interface EventDetector
Overrides:
init in class AbstractDetector
Parameters:
s0 - initial state
t - target time for the integration

g

public double g(SpacecraftState s)
         throws OrekitException
The switching function is specific case of the extrema three bodies angle detector. It is minus the derivative of the inner expression : (P1 dotProduct P3) / Norm(P1) * Norm(P3) where P1 is the position of the target and P3 is the sight view axis all expressed in frame with origin on the sight line view. P2 is this origin and is fix in this frame so we remove it from expression

Specified by:
g in interface EventDetector
Specified by:
g in class AbstractDetector
Parameters:
s - the spacecraft state used to determine the local frame
Returns:
value of the switching function
Throws:
OrekitException - if some specific error occurs
See Also:
ExtremaThreeBodiesAngleDetector

eventOccurred

public EventDetector.Action eventOccurred(SpacecraftState s,
                                          boolean increasing,
                                          boolean forward)
                                   throws OrekitException
Handle an event and choose what to do next.

The scheduling between this method and the OrekitStepHandler method handleStep(interpolator, isLast) is to call this method first and handleStep afterwards. This scheduling allows the propagator to pass true as the isLast parameter to the step handler to make it aware the step will be the last one if this method returns EventDetector.Action.STOP. As the interpolator may be used to navigate back throughout the last step (as OrekitStepNormalizer does for example), user code called by this method and user code called by step handlers may experience apparently out of order values of the independent time variable. As an example, if the same user object implements both this EventDetector interface and the OrekitFixedStepHandler interface, a forward integration may call its eventOccurred method with a state at 2000-01-01T00:00:10 first and call its handleStep method with a state at 2000-01-01T00:00:09 afterwards. Such out of order calls are limited to the size of the integration step for variable step handlers and to the size of the fixed step for fixed step handlers.

Specified by:
eventOccurred in interface EventDetector
Specified by:
eventOccurred in class AbstractDetector
Parameters:
s - the current state information: date, kinematics, attitude for forces and events computation, mass provider, and additional states
increasing - if true, the value of the switching function increases when times increases around event (note that increase is measured with respect to physical time, not with respect to propagation which may go backward in time)
forward - if true, the integration variable (time) increases during integration.
Returns:
one of EventDetector.Action.STOP, EventDetector.Action.RESET_STATE, EventDetector.Action.RESET_DERIVATIVES, EventDetector.Action.CONTINUE
Throws:
OrekitException - if some specific error occurs

shouldBeRemoved

public boolean shouldBeRemoved()
Description copied from class: AbstractDetector
This method is called after EventDetector.eventOccurred(org.orekit.propagation.SpacecraftState, boolean, boolean) has been triggered. It returns true if the current detector should be removed after first event detection. WARNING: this method can be called only once a event has been triggered. Before, the value is not available.

Specified by:
shouldBeRemoved in interface EventDetector
Specified by:
shouldBeRemoved in class AbstractDetector
Returns:
true if the current detector should be removed after first event detection

getTargetPoint

public PVCoordinatesProvider getTargetPoint()
Get the target point.

Returns:
the target point

getSightAxis

public Vector3D getSightAxis()
Get the sight axis

Returns:
the sight axis

getVehicle

public Assembly getVehicle()
Get the vehicle.

Returns:
the vehicle

getSensorName

public String getSensorName()
Get the sensor name.

Returns:
the sensor name


Copyright © 2017 CNES. All Rights Reserved.