DavenportQMethod

giant.stellar_opnav.estimators.davenport_q_method:

class giant.stellar_opnav.estimators.davenport_q_method.DavenportQMethod(options=None)[source]

This class estimates the rotation quaternion that best aligns unit vectors from one frame with unit vectors in another frame using Davenport’s Q-Method solution to Wahba’s problem.

This class is relatively easy to use. After you initialize the class, simply specify the target_frame_directions unit vectors (\(\textbf{a}_i\) from the estimators documentation) as a 3xn array of vectors (each column is a vector) and the base_frame_directions unit vectors (\(\textbf{b}_i\) from the estimators documentation) as a 3xn array of vectors (each column is a vector) in the call to estimate(). Here the target_frame_directions unit vectors are expressed in the end frame (the frame you want to rotate to) and the base_frame_directions unit vectors are expressed in the starting frame (the frame you want to rotate from). Each column of target_frame_directions and base_frame_directions should correspond to each other as a pair (i.e. column 1 in target_frame_directions is paired with column ` in base_frame_directions.

Optionally, you can set the weighted_estimation value to True and then provide the weights input to estimate() to specify whether to use weighted estimation or not, and what weights to use if you are using weighted estimation. The weights input should be a length n array of the weights to apply to each unit vector pair.

The estimate() method can be called to compute the attitude quaternion that best aligns the two frames. When the estimate() method completes, the solved for rotation is returned as an Rotation object. In addition, the formal post fit covariance matrix of the estimate can be found in the post_fit_covariance attribute. Note that as with all attitude quaternions, the post fit covariance matrix will be rank deficient since there are only 3 true degrees of freedom.

A description of the math behind the DavenportQMethod Solution can be found here.

Parameters:

options (AttitudeEstimatorOptions | None) – A dataclass specifying the options to set for this instance.

property options_dict: Dict

Determine the options input to the dataclass.

This property method will ignore all internal properties and functions

property original_options: OptionsT

Get the original configuration options.

Returns:

OptionsT: The original options used during initialization.

Warning

Modifying the returned object will affect reset behavior.

weighted_estimation: bool = False

A flag specifying whether to use weights in the estimation of the rotation.

property post_fit_covariance: ndarray[tuple[Any, ...], dtype[float64]]

This returns the post-fit covariance after calling the estimate method as a 4x4 numpy array.

This should be only be called after the estimate method has been called, otherwise it raises a ValueError

Summary of Methods

apply_options

Update the options as attributes of the object class

attitude_profile_matrix

Computes the attitude profile matrix for the provided vector sets

comparison_dictionary

Compares each attribute of self to other and stores the result in a dict mapping the attribute to the comparison result.

compute_residuals

This method computes the residuals between the aligned unit vectors according to Wahba's problem definitions.

estimate

This method solves for the rotation matrix that best aligns the unit vectors in base_frame_directions with the unit vectors in target_frame_directions using Davenport's Q-Method solution to Wahba's Problem.

local_vars

this is used to overwrite options in variables only used in __init__

override_options

This method is used for special cases when certain options should be overwritten

reset_settings

Resets the class to the state it was originally initialized with.