utils.dynamics
This file implements some wrappers to get the dynamics from crazyflow.
dynamics_function(model, config)
¶
Return the crazyflow dynamics of the model with the parameters of the drone config.
Models without rotor dynamics (e.g. so_rpy) neither take rotor_vel nor return its derivative. The returned function always does, such that the estimators can call all models the same way.
Source code in drone_estimators/utils/dynamics.py
hover_jacobians(model, config, estimate_rotor_vel=False, estimate_dist_f=False, estimate_dist_t=False)
¶
Return the Jacobians of the dynamics and the observation function at hover.
At hover, the drone is level and at rest, the command compensates gravity, and the rotors are at their steady state. The disturbances are modeled as constant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
str
|
The name of the model that is to be used. |
required |
config
|
str
|
The setup configuration of the drone. |
required |
estimate_rotor_vel
|
bool
|
If the rotor speeds are part of the state. |
False
|
estimate_dist_f
|
bool
|
If the disturbance forces are part of the state. |
False
|
estimate_dist_t
|
bool
|
If the disturbance torques are part of the state. |
False
|
Returns:
| Type | Description |
|---|---|
tuple[Array, Array]
|
The Jacobians of the continuous dynamics and of the observation function w.r.t. the state. |
Source code in drone_estimators/utils/dynamics.py
observation_function(pos, quat, vel, ang_vel, cmd, rotor_vel=None, dist_f=None, dist_t=None)
¶
Return the observable part of the state.
This is basically not necessary, since we always get position and orientation from Vicon. However, for sake of completeness, this observation function is added.