structs.estimator_data
Data shared by all estimators.
EstimatorData
¶
State, covariance, sigma points, input, and measurement of an estimator.
as_state_array(data)
classmethod
¶
Returns the state as an array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
EstimatorData
|
The state of the estimator. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
The concatenated state of shape (..., dim_x). |
Source code in drone_estimators/structs/estimator_data.py
create(pos, quat, vel, ang_vel, rotor_vel=None, dist_f=None, dist_t=None)
classmethod
¶
Create the state from the given values with identity covariance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pos
|
Array
|
The position. |
required |
quat
|
Array
|
The quaternion. |
required |
vel
|
Array
|
The velocity. |
required |
ang_vel
|
Array
|
The angular velocity. |
required |
rotor_vel
|
Array | None
|
Optional, the rotor velocities. |
None
|
dist_f
|
Array | None
|
Optional, the disturbance forces. |
None
|
dist_t
|
Array | None
|
Optional, the disturbance torques. |
None
|
Returns:
| Type | Description |
|---|---|
EstimatorData
|
The state. |
Source code in drone_estimators/structs/estimator_data.py
create_empty(rotor_vel=False, dist_f=False, dist_t=False, dim_u=4, dim_z=7, batch_shape=())
classmethod
¶
Create the initial state with zeros and identity covariance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rotor_vel
|
bool
|
If the rotor velocities are part of the state. |
False
|
dist_f
|
bool
|
If the disturbance forces are part of the state. |
False
|
dist_t
|
bool
|
If the disturbance torques are part of the state. |
False
|
dim_u
|
int
|
The dimension of the input. |
4
|
dim_z
|
int
|
The dimension of the measurement. |
7
|
batch_shape
|
tuple[int, ...]
|
The batch dimensions, e.g., (n_drones,). |
()
|
Returns:
| Type | Description |
|---|---|
EstimatorData
|
The initial state. |
Source code in drone_estimators/structs/estimator_data.py
from_state_array(data, array)
classmethod
¶
Updates data in the given structure based on a given array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
EstimatorData
|
The state of the estimator to update. |
required |
array
|
Array
|
The state vector of shape (..., dim_x). |
required |
Returns:
| Type | Description |
|---|---|
EstimatorData
|
The updated state. |
Source code in drone_estimators/structs/estimator_data.py
get_state_dim(data)
classmethod
¶
Returns the dimension of the state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
EstimatorData
|
The state of the estimator. |
required |
Returns:
| Type | Description |
|---|---|
int
|
The dimension of the state, depending on the optional states. |