high_level_commander
– Send high-level setpoints to CF controller¶
Used for sending high level setpoints to the Crazyflie
-
class
high_level_commander.
HighLevelCommander
(crazyflie=None)[source]¶ Used for sending high level setpoints to the Crazyflie
Initialize the object.
-
define_trajectory
(trajectory_id, offset, n_pieces, type=0)[source]¶ Define a trajectory that has previously been uploaded to memory.
- Parameters
trajectory_id – The id of the trajectory
offset – Offset in uploaded memory
n_pieces – Nr of pieces in the trajectory
type – The type of trajectory data; TRAJECTORY_TYPE_POLY4D or TRAJECTORY_TYPE_POLY4D_COMPRESSED
- Returns
-
go_to
(x, y, z, yaw, duration_s, relative=False, group_mask=0)[source]¶ Go to an absolute or relative position
- Parameters
x – X (m)
y – Y (m)
z – Z (m)
yaw – Yaw (radians)
duration_s – Time it should take to reach the position (s)
relative – True if x, y, z is relative to the current position
group_mask – Mask for which CFs this should apply to
-
land
(absolute_height_m, duration_s, group_mask=0, yaw=0.0)[source]¶ vertical land from current x-y position to given height
- Parameters
absolute_height_m – Absolute (m)
duration_s – Time it should take until target height is reached (s)
group_mask – Mask for which CFs this should apply to
yaw – Yaw (rad). Use current yaw if set to None.
-
set_group_mask
(group_mask=0)[source]¶ Set the group mask that the Crazyflie belongs to
- Parameters
group_mask – Mask for which groups this CF belongs to
-
start_trajectory
(trajectory_id, time_scale=1.0, relative=False, reversed=False, group_mask=0)[source]¶ starts executing a specified trajectory
- Parameters
trajectory_id – Id of the trajectory (previously defined by define_trajectory)
time_scale – Time factor; 1.0 = original speed; >1.0: slower; <1.0: faster
relative – Set to True, if trajectory should be shifted to current setpoint
reversed – Set to True, if trajectory should be executed in reverse
group_mask – Mask for which CFs this should apply to
- Returns
-
stop
(group_mask=0)[source]¶ stops the current trajectory (turns off the motors)
- Parameters
group_mask – Mask for which CFs this should apply to
- Returns
-
takeoff
(absolute_height_m, duration_s, group_mask=0, yaw=0.0)[source]¶ vertical takeoff from current x-y position to given height
- Parameters
absolute_height_m – Absolute (m)
duration_s – Time it should take until target height is reached (s)
group_mask – Mask for which CFs this should apply to
yaw – Yaw (rad). Use current yaw if set to None.
-