as2_python_api package

Subpackages

Submodules

as2_python_api.drone_interface module

Drone interface to easily command drones with Aerostack2.

class as2_python_api.drone_interface.DroneInterface(drone_id: str = 'drone0', verbose: bool = False, use_sim_time: bool = False, spin_rate: float = 20.0)[source]

Bases: DroneInterfaceBase

Drone interface node.

as2_python_api.drone_interface_base module

Python interface base.

class as2_python_api.drone_interface_base.DroneInterfaceBase(drone_id: str = 'drone0', verbose: bool = False, use_sim_time: bool = False, spin_rate: float = 20.0, executor: ~rclpy.executors.Executor = <class 'rclpy.executors.SingleThreadedExecutor'>)[source]

Bases: Node

Drone interface base node.

arm() bool[source]

Arm drone.

disarm() bool[source]

Disarm drone.

property drone_id: str

Get drone id (namespace).

Return type:

str

property info: dict[str, bool | str]

Get drone info.

Return type:

dict[str, Union[bool, str]]

load_module(pkg: str) None[source]

Load module on drone.

manual() bool[source]

Disable offboard mode.

offboard() bool[source]

Enable offboard mode.

property orientation: list[float]

Get drone orientation [roll, pitch, yaw] in rad.

Return type:

list[float]

property position: list[float]

Get drone position [x, y, z] in m.

Return type:

list[float]

send_emergency_hover() None[source]

Set controller to hover mode. You will have to take the control manually.

send_emergency_hover_to_aircraft() None[source]

Call platform hover.

BE CAREFUL, you will have to take it control manually!

send_emergency_killswitch_to_aircraft() None[source]

Call platform stop.

BE CAREFUL, motors will stop!

send_emergency_land() None[source]

Emergency landing.

send_emergency_land_to_aircraft() None[source]

Call platform emergency land.

shutdown() None[source]

Shutdown properly.

property speed: list[float]

Get drone speed [vx, vy, vz] in m/s.

Return type:

list[float]

as2_python_api.drone_interface_gps module

Drone interface GPS to easily command drones with Aerostack2.

class as2_python_api.drone_interface_gps.DroneInterfaceGPS(drone_id: str = 'drone0', verbose: bool = False, use_sim_time: bool = False, spin_rate: float = 20.0)[source]

Bases: DroneInterfaceBase

Drone interface node.

as2_python_api.drone_interface_teleop module

Drone interface with motion handlers to teleoperate.

class as2_python_api.drone_interface_teleop.DroneInterfaceTeleop(drone_id: str = 'drone0', verbose: bool = False, use_sim_time: bool = False, spin_rate: float = 20.0)[source]

Bases: DroneInterface

Drone interface for teleoperation.

Module contents