as2_python_api.modules package

Submodules

as2_python_api.modules.dummy_module module

Dummy Module for testing purpouses.

This module is a dummy module that does nothing but print the arguments it receives.

class as2_python_api.modules.dummy_module.DummyModule(drone: DroneInterface)[source]

Bases: ModuleBase

Dummy Module.

destroy()[source]

Do nothing.

Dummy Module does not inherit from a behavior with a destroy method, so self defining it

stop()[source]

Stop dummy module.

as2_python_api.modules.follow_path_gps_module module

Follow Path GPS Module.

class as2_python_api.modules.follow_path_gps_module.FollowPathGpsModule(drone: DroneInterface)[source]

Bases: ModuleBase, FollowPathBehavior

Follow Path GPS Module.

as2_python_api.modules.follow_path_module module

Follow Path module.

class as2_python_api.modules.follow_path_module.FollowPathModule(drone: DroneInterface)[source]

Bases: ModuleBase, FollowPathBehavior

Follow Path Module.

follow_path_with_keep_yaw(path: Path, speed: float, frame_id: str = 'earth') bool[source]

Follow path. With keep yaw mode. Blocking call.

Parameters:
  • path (Path) – path to follow

  • speed (float) – speed (m/s) limit

  • frame_id (str, optional) – reference frame of the coordinates, defaults to “earth”

Returns:

True if was accepted, False otherwise

Return type:

bool

follow_path_with_path_facing(path: Path, speed: float, frame_id: str = 'earth') bool[source]

Follow path. With path facing yaw mode. Blocking call.

Parameters:
  • path (Path) – path to follow

  • speed (float) – speed (m/s) limit

  • frame_id (str, optional) – reference frame of the coordinates, defaults to “earth”

Returns:

True if was accepted, False otherwise

Return type:

bool

follow_path_with_yaw(path: Path, speed: float, angle: float, frame_id: str = 'earth') bool[source]

Follow path. With desired yaw angle. Blocking call.

Parameters:
  • path (Path) – path to follow

  • speed (float) – speed (m/s) limit

  • yaw_angle (float) – yaw angle (rad) when fixed yaw is set

  • frame_id (str, optional) – reference frame of the coordinates, defaults to “earth”

Returns:

True if was accepted, False otherwise

Return type:

bool

as2_python_api.modules.follow_reference_module module

Follow reference module.

class as2_python_api.modules.follow_reference_module.FollowReferenceModule(drone: DroneInterface)[source]

Bases: ModuleBase, FollowReferenceBehavior

Follow reference Module.

follow_reference(x: float, y: float, z: float, frame_id: str, speed_x: float, speed_y: float, speed_z: float) bool[source]

Follow reference. With keep yaw. Non-blocking call.

Parameters:
  • x (float) – x position relative to the frame_id

  • y (float) – y position relative to the frame_id

  • z (float) – z position relative to the frame_id

  • frame_id (str) – frame_id of the reference

  • speed_x (float) – speed limit

  • speed_y (float) – speed limit

  • speed_z (float) – speed limit

follow_reference_with_reference_facing(x: float, y: float, z: float, frame_id: str, speed_x: float, speed_y: float, speed_z: float) bool[source]

Follow reference. With reference facing yaw mode. Non-blocking call.

Parameters:
  • x (float) – x position relative to the frame_id

  • y (float) – y position relative to the frame_id

  • z (float) – z position relative to the frame_id

  • frame_id (str) – frame_id of the reference

  • speed_x (float) – speed limit

  • speed_y (float) – speed limit

  • speed_z (float) – speed limit

follow_reference_with_yaw(x: float, y: float, z: float, frame_id: str, speed_x: float, speed_y: float, speed_z: float, angle: float) bool[source]

Follow reference. With desired yaw angle. Non-blocking call.

Parameters:
  • x (float) – x position relative to the frame_id

  • y (float) – y position relative to the frame_id

  • z (float) – z position relative to the frame_id

  • frame_id (str) – frame_id of the reference

  • speed_x (float) – speed limit

  • speed_y (float) – speed limit

  • speed_z (float) – speed limit

  • yaw_angle (float) – yaw angle (rad)

as2_python_api.modules.go_to_gps_module module

Go to GPS Module.

class as2_python_api.modules.go_to_gps_module.GoToGpsModule(drone: DroneInterface)[source]

Bases: ModuleBase, GoToBehavior

Go to GPS Module.

go_to_gps(lat: float, lon: float, alt: float, speed: float) bool[source]

Go to GPS point. Blocking call.

Parameters:
  • lat (float) – latitude (deg) of the point

  • lon (float) – longitude (deg) of the point

  • alt (float) – altitude (m) of the point

  • speed (float) – speed (m/s) to go to the point

Returns:

True if was accepted, False otherwise

Return type:

bool

go_to_gps_path_facing(lat: float, lon: float, alt: float, speed: float) bool[source]

Go to GPS point. With desired path facing. Blocking call.

Parameters:
  • lat (float) – latitude (deg) of the point

  • lon (float) – longitude (deg) of the point

  • alt (float) – altitude (m) of the point

  • speed (float) – speed (m/s) to go to the point

Returns:

True if was accepted, False otherwise

Return type:

bool

go_to_gps_point(waypoint: list[float], speed: float) bool[source]

Go to GPS point. Blocking call.

Parameters:
  • point (list[float]) – GPS point [lat, lon, alt]

  • speed (float) – speed (m/s) to go to the point

Returns:

True if was accepted, False otherwise

Return type:

bool

go_to_gps_point_path_facing(waypoint: list[float], speed: float) bool[source]

Go to GPS point. With desired path facing. Blocking call.

Parameters:
  • point (list[float]) – GPS point [lat, lon, alt]

  • speed (float) – speed (m/s) to go to the point

Returns:

True if was accepted, False otherwise

Return type:

bool

go_to_gps_point_with_yaw(waypoint: list[float], speed: float, angle: float) bool[source]

Go to GPS point. With desired yaw angle. Blocking call.

Parameters:
  • point (list[float]) – GPS point [lat, lon, alt]

  • speed (float) – speed (m/s) to go to the point

  • yaw_angle (float) – go to desired yaw angle (rad)

Returns:

True if was accepted, False otherwise

Return type:

bool

go_to_gps_with_yaw(lat: float, lon: float, alt: float, speed: float, angle: float) bool[source]

Go to GPS point. With desired yaw angle. Blocking call.

Parameters:
  • lat (float) – latitude (deg) of the point

  • lon (float) – longitude (deg) of the point

  • alt (float) – altitude (m) of the point

  • speed (float) – speed (m/s) to go to the point

  • yaw_angle (float) – go to desired yaw angle (rad)

Returns:

True if was accepted, False otherwise

Return type:

bool

as2_python_api.modules.go_to_module module

Go to Module.

class as2_python_api.modules.go_to_module.GoToModule(drone: DroneInterface)[source]

Bases: ModuleBase, GoToBehavior

Go to Module.

go_to(x: float, y: float, z: float, speed: float, frame_id: str = 'earth') bool[source]

Go to point, blocking call.

Parameters:
  • x (float) – x coordinate (m) to go to

  • y (float) – y coordinate (m) to go to

  • z (float) – z coordinate (m) to go to

  • speed (float) – speed (m/s) to go to the point

  • frame_id (str, optional) – reference frame of the coordinates, defaults to “earth”

Returns:

True if was accepted, False otherwise

Return type:

bool

go_to_path_facing(x: float, y: float, z: float, speed: float, frame_id: str = 'earth') bool[source]

Go to point. With path facing yaw mode. Blocking call.

Parameters:
  • x (float) – x coordinate (m) to go to

  • y (float) – y coordinate (m) to go to

  • z (float) – z coordinate (m) to go to

  • speed (float) – speed (m/s) to go to the point

  • frame_id (str, optional) – reference frame of the coordinates, defaults to “earth”

Returns:

True if was accepted, False otherwise

Return type:

bool

go_to_point(point: list[float], speed: float, frame_id: str = 'earth') bool[source]

Go to point. With keep yaw mode. Blocking call.

Parameters:
  • point (list[float]) – [x, y, z] (m) coordinates to go to

  • speed (float) – speed (m/s) to go to the point

  • frame_id (str, optional) – reference frame of the coordinates, defaults to “earth”

Returns:

True if was accepted, False otherwise

Return type:

bool

go_to_point_path_facing(point: list[float], speed: float, frame_id: str = 'earth') bool[source]

Go to point. With path facing yaw mode. Blocking call.

Parameters:
  • point (list[float]) – [x, y, z] (m) coordinates to go to

  • speed (float) – speed (m/s) to go to the point

  • frame_id (str, optional) – reference frame of the coordinates, defaults to “earth”

Returns:

True if was accepted, False otherwise

Return type:

bool

go_to_point_with_yaw(point: list[float], speed: float, angle: float, frame_id: str = 'earth') bool[source]

Go to point. With desired yaw angle (degrees). Blocking call.

Parameters:
  • point (list[float]) – [x, y, z] (m) coordinates to go to

  • speed (float) – speed (m/s) to go to the point

  • yaw_angle (float) – yaw angle

  • frame_id (str, optional) – reference frame of the coordinates, defaults to “earth”

Returns:

True if was accepted, False otherwise

Return type:

bool

go_to_with_yaw(x: float, y: float, z: float, speed: float, angle: float, frame_id: str = 'earth') bool[source]

Go to point. With desired yaw angle (degrees). Blocking call.

Parameters:
  • x (float) – x coordinate (m) to go to

  • y (float) – y coordinate (m) to go to

  • z (float) – z coordinate (m) to go to

  • speed (float) – speed (m/s) to go to the point

  • yaw_angle (float) – yaw angle

  • frame_id (str, optional) – reference frame of the coordinates, defaults to “earth”

Returns:

True if was accepted, False otherwise

Return type:

bool

as2_python_api.modules.gps_module module

GPS module.

class as2_python_api.modules.gps_module.GpsModule(drone: DroneInterface)[source]

Bases: ModuleBase

GPS module.

destroy() None[source]

Destroy module, clean exit.

property origin: list[float]

Get Origin GPS position (lat, lon, alt) in deg and m. None if not set.

Return type:

list[float]

property pose: list[float]

Get GPS position (lat, lon, alt) in deg and m.

Return type:

list[float]

set_origin(gps_pose: list[float]) bool[source]

Set Origin position.

as2_python_api.modules.land_module module

Land module.

class as2_python_api.modules.land_module.LandModule(drone: DroneInterface)[source]

Bases: ModuleBase, LandBehavior

Land Module.

as2_python_api.modules.module_base module

Module Base.

class as2_python_api.modules.module_base.ModuleBase(drone: DroneInterface, alias: str)[source]

Bases: object

Module Base.

classmethod get_plan_item(method_name: Callable | None = None, *args, **kwargs) MissionItem[source]

Get a MissionItem from a method call.

Parameters:

method_name (Callable, optional) – Method to be called. Defaults to “cls.__call__”.

Returns:

MissionItem with the method call

Return type:

MissionItem

as2_python_api.modules.motion_reference_handler_module module

Motion Reference Handler module.

class as2_python_api.modules.motion_reference_handler_module.MotionReferenceHandlerModule(drone: DroneInterface)[source]

Bases: ModuleBase

Motion Reference Handlers module.

destroy() None[source]

Destroy module, clean exit.

hover() None[source]

Stop and hover current position.

as2_python_api.modules.navigate_to_module module

Navigate To Module.

class as2_python_api.modules.navigate_to_module.NavigateToModule(drone: DroneInterface)[source]

Bases: ModuleBase, NavigateToBehavior

Navigate to Module.

navigate_to(x: float, y: float, z: float, speed: float, frame_id: str = 'earth') None[source]

Navigate to point (m) with speed (m/s).

navigate_to_path_facing(x: float, y: float, z: float, speed: float, frame_id: str = 'earth') None[source]

Navigate to position facing goal with speed.

navigate_to_point(point: list[float], speed: float, frame_id: str = 'earth') None[source]

Navigate to point (m) with speed (m/s).

navigate_to_point_path_facing(point: list[float], speed: float, frame_id: str = 'earth') None[source]

Navigate to point facing goal with speed.

navigate_to_point_with_yaw(point: list[float], speed: float, angle: float, frame_id: str = 'earth') None[source]

Navigate to point with speed and yaw_angle.

navigate_to_with_yaw(x: float, y: float, z: float, speed: float, angle: float, frame_id: str = 'earth') None[source]

Navigate to position with speed and yaw_angle.

as2_python_api.modules.point_gimbal_module module

Point Gimbal Module.

class as2_python_api.modules.point_gimbal_module.PointGimbalModule(drone: DroneInterface)[source]

Bases: ModuleBase, PointGimbalBehavior

Point Gimbal Module.

point_gimbal(x: float, y: float, z: float, frame_id: str) bool[source]

Point Gimbal to reference, blocking call.

Parameters:
  • x (float) – x coordinate (m) to point gimbal to

  • y (float) – y coordinate (m) to point gimbal to

  • z (float) – z coordinate (m) to point gimbal to

  • frame_id (str) – reference frame of the coordinates

Returns:

True if was accepted, False otherwise

Return type:

bool

as2_python_api.modules.rtl_module module

RTL Module.

class as2_python_api.modules.rtl_module.RTLModule(drone: DroneInterface)[source]

Bases: ModuleBase

Return To Launch Module.

destroy() None[source]

Destroy module, clean exit.

property feedback

Behavior feedback.

Returns:

rclpy.Feedback

as2_python_api.modules.takeoff_module module

Takeoff Module.

class as2_python_api.modules.takeoff_module.TakeoffModule(drone: DroneInterface)[source]

Bases: ModuleBase, TakeoffBehavior

Takeoff module.

as2_python_api.modules.trajectory_generation_module module

Trajectory Generation module.

class as2_python_api.modules.trajectory_generation_module.TrajectoryGenerationModule(drone: DroneInterface)[source]

Bases: ModuleBase, TrajectoryGenerationBehavior

Trajectory Generation Module.

traj_generation_with_face_reference(path: Path, speed: float, frame_id: str = 'earth') bool[source]

Trajectory generation. With path facing yaw mode. Blocking call.

Parameters:
  • path (Path) – path to follow

  • speed (float) – speed (m/s) limit

  • frame_id (str, optional) – reference frame of the coordinates, defaults to “earth”

Returns:

True if was accepted, False otherwise

Return type:

bool

traj_generation_with_keep_yaw(path: Path, speed: float, frame_id: str = 'earth') bool[source]

Trajectory generation. With keep yaw mode. Blocking call.

Parameters:
  • path (Path) – path to follow

  • speed (float) – speed (m/s) limit

  • frame_id (str, optional) – reference frame of the coordinates, defaults to “earth”

Returns:

True if was accepted, False otherwise

Return type:

bool

traj_generation_with_path_facing(path: Path, speed: float, frame_id: str = 'earth') bool[source]

Trajectory generation. With path facing yaw mode. Blocking call.

Parameters:
  • path (Path) – path to follow

  • speed (float) – speed (m/s) limit

  • frame_id (str, optional) – reference frame of the coordinates, defaults to “earth”

Returns:

True if was accepted, False otherwise

Return type:

bool

traj_generation_with_yaw(path: Path, speed: float, angle: float, frame_id: str = 'earth') bool[source]

Trajectory generation. With desired yaw angle. Blocking call.

Parameters:
  • path (Path) – path to follow

  • speed (float) – speed (m/s) limit

  • yaw_angle (float) – yaw angle (rad) when fixed yaw is set

  • frame_id (str, optional) – reference frame of the coordinates, defaults to “earth”

Returns:

True if was accepted, False otherwise

Return type:

bool

Module contents