utils

Small utils

Author:

Lukas Rustler

class pybullet_grasper.utils.Config(config_path: str)[source]

Bases: object

Class to parse and keep the config loaded from yaml file

Loads YAML config and exposes keys as object attributes.

Parameters:

config_path (str) – path to YAML config file

Returns:

None

Return type:

None

set_attribute(attr: str, value: Any, reference: Any) int[source]

Function to recursively fill the instance variables from dictionary. When value is non-dict, it is directly assigned to a variable. Else, the dict is recursively parsed. :param attr: name of the attribute :type attr: str :param value: value of the attribute :type value: str, float, int, dict, list, … - and other that can be loaded from yaml :param reference: reference to the parent class. “self” for the upper attributes, pointer to namedtuple for

inner attributes

Returns:

0

Return type:

int

class pybullet_grasper.utils.GenerateGraspsResponse[source]

Bases: object

class pybullet_grasper.utils.Logger(ros: bool, debug: bool = False)[source]

Bases: object

Class to handle logging for both ROS and non-ROS behaviours

Initializes logger backend for ROS or standard Python logging.

Parameters:
  • ros (bool) – whether ROS logging API should be used

  • debug (bool, optional, default=False) – enables debug-level logs

Returns:

None

Return type:

None

log_critical(msg: Any) None[source]

Logs a critical/fatal message.

Parameters:

msg (Any) – message payload

Returns:

None

Return type:

None

log_debug(msg: Any) None[source]

Logs a debug message.

Parameters:

msg (Any) – message payload

Returns:

None

Return type:

None

log_error(msg: Any) None[source]

Logs an error message.

Parameters:

msg (Any) – message payload

Returns:

None

Return type:

None

log_info(msg: Any) None[source]

Logs an info message.

Parameters:

msg (Any) – message payload

Returns:

None

Return type:

None

log_warning(msg: Any) None[source]

Logs a warning message.

Parameters:

msg (Any) – message payload

Returns:

None

Return type:

None

class pybullet_grasper.utils.MeshInfo[source]

Bases: object

class pybullet_grasper.utils.Point(x: float, y: float, z: float)[source]

Bases: object

class pybullet_grasper.utils.Pose(position: Point, orientation: Quaternion)[source]

Bases: object

class pybullet_grasper.utils.Quaternion(x: float, y: float, z: float, w: float)[source]

Bases: object

pybullet_grasper.utils.get_data_folder() str[source]
pybullet_grasper.utils.suppress_c_output()[source]

Context manager to suppress C/C++ level stdout and stderr.