Util¶
Helpful Utilities
Functions:
|
Resolves python 2 issue with json loading in unicode instead of string |
|
Draws a debug arrow in the world |
|
Draws a debug box in the world |
|
Draws a debug line in the world |
|
Draws a debug point in the world |
|
Gets the path of the holodeck environment |
|
Gets the current version of holodeck |
|
Gets the key for the OS. |
|
Gets a number of bytes as a human readable string. |
|
Gets path for logs. |
-
holodeck.util.convert_unicode(value)¶ Resolves python 2 issue with json loading in unicode instead of string
- Parameters
value (
str) – Unicode value to be converted- Returns
Converted string
- Return type
(
str)
-
holodeck.util.draw_arrow(env, start, end, color=None, thickness=10.0)¶ Draws a debug arrow in the world
- Parameters
env (
HolodeckEnvironment) – Environment to draw in.start (
listoffloat) – The start[x, y, z]location of the line. (see Coordinate System)end (
listoffloat) – The end[x, y, z]location of the arrowcolor (
list) –[r, g, b]color valuethickness (
float) – thickness of the arrow
-
holodeck.util.draw_box(env, center, extent, color=None, thickness=10.0)¶ Draws a debug box in the world
- Parameters
env (
HolodeckEnvironment) – Environment to draw in.center (
listoffloat) – The start[x, y, z]location of the box. (see Coordinate System)extent (
listoffloat) – The[x, y, z]extent of the boxcolor (
list) –[r, g, b]color valuethickness (
float) – thickness of the lines
-
holodeck.util.draw_line(env, start, end, color=None, thickness=10.0)¶ Draws a debug line in the world
- Parameters
env (
HolodeckEnvironment) – Environment to draw in.start (
listoffloat) – The start[x, y, z]location of the line. (see Coordinate System)end (
listoffloat) – The end[x, y, z]location of the linecolor (
list`) –[r, g, b]color valuethickness (
float) – thickness of the line
-
holodeck.util.draw_point(env, loc, color=None, thickness=10.0)¶ Draws a debug point in the world
- Parameters
env (
HolodeckEnvironment) – Environment to draw in.loc (
listoffloat) – The[x, y, z]start of the box. (see Coordinate System)color (
listoffloat) –[r, g, b]color valuethickness (
float) – thickness of the point
-
holodeck.util.get_holodeck_path()¶ Gets the path of the holodeck environment
- Returns
path to the current holodeck environment
- Return type
(
str)
-
holodeck.util.get_holodeck_version()¶ Gets the current version of holodeck
- Returns
the current version
- Return type
(
str)
-
holodeck.util.get_os_key()¶ Gets the key for the OS.
- Returns
LinuxorWindows. ThrowsNotImplementedErrorfor other systems.- Return type
str
-
holodeck.util.human_readable_size(size_bytes)¶ Gets a number of bytes as a human readable string.
- Parameters
size_bytes (
int) – The number of bytes to get as human readable.- Returns
The number of bytes in a human readable form.
- Return type
str
-
holodeck.util.log_paths()¶ Gets path for logs.
- Returns
The file path of where the logs are located
- Return type
str