Utility functions

dronemanager.utils.dist_ned(pos1, pos2)
dronemanager.utils.dist_gps(gps1, gps2)
dronemanager.utils.heading_ned(pos1, pos2)

Heading from pos1 to pos2, going from -180 to +180 with 0 straight north.

pos1 and pos2 must be NED arrays.

dronemanager.utils.heading_gps(gps1, gps2)

Heading between GPS coordinates, going from -180 to +180 with 0 straight north.

Note that the GPS coordinates include an altitude, which is ignored in this function

dronemanager.utils.relative_gps(north, east, up, lat, long, alt)

Given a NEU offset and a GPS position, calculate the GPS coordinates of the offset position.

dronemanager.utils.offset_from_gps(origin, gps1, gps2)

Given two GPS points, computes a heading and distance between the first two and then creates a new point separated fom the origin by the same heading and distance

dronemanager.utils.ned_from_gps(gps1, gps2)

Given two GPS points, compute the NED difference between the two positions, same as PX4 http://mathworld.wolfram.com/AzimuthalEquidistantProjection.html

dronemanager.utils.get_free_port()

Get a free network port.

The port is not guaranteed to be free once the function returns.

Returns:

dronemanager.utils.parse_address(string)

Used to ensure that udp://:14540, udp://localhost:14540 and udp://127.0.0.1:14540 are recognized as equivalent.

Missing elements from the string or the other entries are replaced with defaults. These are udp, empty host and 50051 for the scheme, host and port, respectively.

dronemanager.utils.check_cli_command_signatures(command)

If a signature is invalid, the other fields may not be populated correctly or at all.

Parameters:

command

Returns:

async dronemanager.utils.coroutine_awaiter(task: Future, logger)