pub struct Commander { /* private fields */ }Expand description
§Low level setpoint subsystem
This struct implements methods to send low level setpoints to the Crazyflie. See the commander module documentation for more context and information.
Implementations§
Source§impl Commander
§Legacy RPY+ setpoint
This setpoint was originally the only one present in the Crazyflie and has been (ab)used to
implement the early position control and other assisted and semi-autonomous mode.
impl Commander
§Legacy RPY+ setpoint
This setpoint was originally the only one present in the Crazyflie and has been (ab)used to implement the early position control and other assisted and semi-autonomous mode.
Sourcepub async fn setpoint_rpyt(
&self,
roll: f32,
pitch: f32,
yaw: f32,
thrust: u16,
) -> Result<()>
pub async fn setpoint_rpyt( &self, roll: f32, pitch: f32, yaw: f32, thrust: u16, ) -> Result<()>
Set the Roll Pitch Yaw Thrust setpoint
When not modified by parameters, the meaning of the argument are:
- Roll/Pitch are in degree and represent the absolute angle
- Yaw is in degree per seconds and represents the rotation rate
- Thrust is a 16 bit value where 0 maps to 0% thrust and 65535 to 100% thrust
The thrust is blocked by default. The setpoint needs to be set once with thrust = 0 to unlock the thrust for example:
cf.commander.setpoint_rpyt(0.0, 0.0, 0.0, 0); // Unlocks the thrust
cf.commander.setpoint_rpyt(0.0, 0.0, 0.0, 1000); // Thrust set to 1000impl Commander
§Generic setpoints
These setpoints are implemented in such a way that they are easy to add in the Crazyflie firmware and in libs like this one. So if you have a use-case not covered by any of the existing setpoint do not hesitate to implement and contribute your dream setpoint :-).