as2_python_api.behavior_manager package

Submodules

as2_python_api.behavior_manager.behavior_manager module

Behavior manager.

class as2_python_api.behavior_manager.behavior_manager.DroneBehaviorManager[source]

Bases: object

Handle behavior control.

static drone_behavior_func(behaviors: List | str, uav: DroneInterfaceBase, func)[source]

_summary_

Parameters:
  • behavior (list | str) – _description_

  • uav (DroneInterfaceBase) – _description_

  • func (_type_) – _description_

Returns:

_description_

Return type:

_type_

static get_behavior_status(uav: DroneInterfaceBase)[source]

Get behavior status for an interface.

Returns:

dictionary with namespace and behavior status

Return type:

dict(namespace, list(int))

static pause_all_behaviors(uav: DroneInterfaceBase)[source]

_summary_

Returns:

_description_

Return type:

dict {behavior: bool}

static pause_behaviors(behaviors: List | str, uav: DroneInterfaceBase)[source]

_summary_

Parameters:
Returns:

_description_

Return type:

_type_

static resume_all_behaviors(uav: DroneInterfaceBase)[source]

_summary_

Returns:

_description_

Return type:

dict {behavior: bool}

static resume_behaviors(behaviors: List | str, uav: DroneInterfaceBase)[source]

_summary_

Parameters:

behavior (_type_) – _description_

Returns:

_description_

Return type:

bool

static stop_all_behaviors(uav: DroneInterfaceBase)[source]

_summary_

Returns:

_description_

Return type:

dict {behavior: bool}

static stop_behaviors(behaviors: List | str, uav: DroneInterfaceBase)[source]

_summary_

Parameters:

behavior (_type_) – _description_

Returns:

_description_

Return type:

bool

class as2_python_api.behavior_manager.behavior_manager.SwarmBehaviorManager[source]

Bases: object

_summary_

static get_behaviors_status(drone_interface_list: List[DroneInterfaceBase])[source]

Get behavior status for each interface.

Returns:

dictionary with namespace and behavior status

Return type:

dict {drone_id:{behavior:status(int)}}

static pause_all_behaviors(drone_interface_list: List[DroneInterfaceBase])[source]

_summary_

Parameters:

drone_id_list (_type_, optional) – _description_, defaults to None

Returns:

_description_

Return type:

dict {drone_id:{behavior: bool}}

static pause_behaviors(behavior_dict)[source]

_summary_

Parameters:

behavior_dict (_type_) – _description_

Returns:

_description_

Return type:

dict {drone_id:{behavior: bool}}

static resume_all_behaviors(drone_interface_list: List[DroneInterfaceBase])[source]

_summary_

Parameters:

drone_id_list (_type_, optional) – _description_, defaults to None

Returns:

_description_

Return type:

dict {drone_id:{behavior: bool}}

static resume_behaviors(behavior_dict)[source]

_summary_

Parameters:

behavior_dict (_type_) – _description_

Returns:

_description_

Return type:

dict {drone_id:{behavior: bool}}

static stop_all_behaviors(drone_interface_list: List[DroneInterfaceBase])[source]

_summary_

Parameters:

drone_id_list (_type_, optional) – _description_, defaults to None

Returns:

_description_

Return type:

dict {drone_id:{behavior: bool}}

static stop_behaviors(behavior_dict)[source]

_summary_

Parameters:

behavior_dict (_type_) – _description_

Returns:

_description_

Return type:

dict {drone_id:{behavior: bool}}

static swarm_all_behavior_func(drone_interface_list, func)[source]

_summary_

Parameters:
  • func (_type_) – _description_

  • drone_interface_list (_type_) – _description_

Returns:

_description_

Return type:

dict {drone_id:{behavior: bool}}

static swarm_behavior_func(behavior_dict, func)[source]

_summary_

Parameters:
  • func (_type_) – _description_

  • behavior_dict (_type_) – _description_

Returns:

_description_

Return type:

dict {drone_id:{behavior: bool}}

class as2_python_api.behavior_manager.behavior_manager.ThreadWithReturnValue(group=None, target=None, name=None, args=(), kwargs={}, Verbose=None)[source]

Bases: Thread

join(*args)[source]

Wait until the thread terminates.

This blocks the calling thread until the thread whose join() method is called terminates – either normally or through an unhandled exception or until the optional timeout occurs.

When the timeout argument is present and not None, it should be a floating point number specifying a timeout for the operation in seconds (or fractions thereof). As join() always returns None, you must call is_alive() after join() to decide whether a timeout happened – if the thread is still alive, the join() call timed out.

When the timeout argument is not present or None, the operation will block until the thread terminates.

A thread can be join()ed many times.

join() raises a RuntimeError if an attempt is made to join the current thread as that would cause a deadlock. It is also an error to join() a thread before it has been started and attempts to do so raises the same exception.

run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

Module contents