Class DroneNavAPI â
Handles drone movements
Methods: â
__init__ â
def __init__(
rc_api,
debug=False
)Initialize self. See help(type(self)) for accurate signature.
Params: â
- rc_api: Any
- debug: Any = False
arm â
def arm()Arms the drone and sets it to the READY_TO_FLY mode.
disarm â
def disarm()Disarms the drone and disables offboard mode.
go_backward â
def go_backward(
meter: float,
wait_until_done: bool = True
)Moves the drone backward by a specified distance.
Params: â
- meter: float - The distance to move backward in meters.
- wait_until_done: bool = True - Whether to wait until the setpoint is reached.
go_forward â
def go_forward(
meter: float,
wait_until_done: bool = True
)Moves the drone forward by a specified distance.
Params: â
- meter: float - The distance to move forward in meters.
- wait_until_done: bool = True - Whether to wait until the setpoint is reached.
go_left â
def go_left(
meter: float,
wait_until_done: bool = True
)Moves the drone to the left by a specified distance.
Params: â
- meter: float - The distance to move left in meters.
- wait_until_done: bool = True - Whether to wait until the setpoint is reached.
go_right â
def go_right(
meter: float,
wait_until_done: bool = True
)Moves the drone to the right by a specified distance.
Params: â
- meter: float - The distance to move right in meters.
- wait_until_done: bool = True - Whether to wait until the setpoint is reached.
kill â
def kill()Sends the drone into FAILSAFE mode.
land â
def land(
wait_until_done: bool = True
)Commands the drone to land by setting the altitude to 0.
Params: â
- wait_until_done: bool = True - Whether to wait until the setpoint is reached.
set_altitude â
def set_altitude(
altitude_meter: float,
wait_until_done: bool = True
)Sets the drone's altitude to a specific value.
Params: â
- altitude_meter: float - The target altitude in meters.
- wait_until_done: bool = True - Whether to wait until the setpoint is reached.
set_mode â
def set_mode()Sets the drone to the DISABLE mode.
set_position_2d â
def set_position_2d(
x_m: float,
y_m: float,
wait_until_done: bool = True
)Sets the drone's position to specific coordinates.
Params: â
- x_m: float - The target X coordinate in meters.
- y_m: float - The target Y coordinate in meters.
- wait_until_done: bool = True - Whether to wait until the setpoint is reached.
set_position_3d â
def set_position_3d(
x_m: float,
y_m: float,
z_m: float,
wait_until_done: bool = True
)Sets the drone's position to specific coordinates.
Params: â
- x_m: float - The target X coordinate in meters.
- y_m: float - The target Y coordinate in meters.
- z_m: float - The target Z coordinate in meters.
- wait_until_done: bool = True - Whether to wait until the setpoint is reached.
set_yaw â
def set_yaw(
yaw_in_rad: float,
wait_until_done: bool = True
)Sets the drone's yaw to a specific angle.
Params: â
- yaw_in_rad: float - The target yaw angle in radians.
- wait_until_done: bool = True - Whether to wait until the setpoint is reached.
takeoff â
def takeoff(
altitude_meter: float,
tolerance: float = 0.1,
wait_until_done: bool = True
)Commands the drone to take off to a specified altitude.
Params: â
- altitude_meter: float - The target altitude in meters.
- tolerance: float = 0.1 - The altitude tolerance in meters.
- wait_until_done: bool = True - Whether to wait until the setpoint is reached.
turn_cw â
def turn_cw(
rotation_in_rad: float,
wait_until_done: bool = True
)Rotates the drone clockwise by a specified angle.
Params: â
- rotation_in_rad: float - The angle to rotate in radians.
- wait_until_done: bool = True - Whether to wait until the setpoint is reached.
update_offboard_state â
def update_offboard_state(
**kwargs
)Updates the offboard state and sends the corresponding command.
Params: â
- kwargs: Any - Key-value pairs to update the offboard state.
wait_for_latest_setpoint â
def wait_for_latest_setpoint(
pos_tolerance: float = 0.15,
yaw_tolerance: float = 0.2617993877991494,
ignore_axis: robeex_ai_drone_api.nav_api.IgnoreAxis = <IgnoreAxis.NONE: 0>
)Waits for the drone to reach the setpoint within the specified tolerances.
Params: â
- pos_tolerance: float = 0.15 - The position tolerance in meters.
- yaw_tolerance: float = 0.2617993877991494 - The yaw tolerance in radians.
- ignore_axis:
IgnoreAxis= 0 - Axes to ignore during setpoint checks (bit mask).