RobotRaconteurCompanion.InfoParser

Utility class for parsing Robot Raconteur device info files. This class is typically called using the InfoFileLoader utility class.

InfoParser

class RobotRaconteurCompanion.InfoParser.InfoParser(node=None, client_obj=None)

Class to load YAML info files into Robot Raconteur device info structures. This wil typically be called from InfoFileLoader instead of being called directly.

Parameters:
  • node (RobotRaconteur.RobotRaconteurNode) – (optional) The Robot Raconteur node to use for parsing. Defaults to RobotRaconteurNode.s

  • client_obj (RobotRaconteur.ClientObject) – (optional) The client object to use for finding types. Defaults to None

ParseInfoDict(info_dict, type_name)

Use a parsed YAML string containing contents of a device info structure. The type_name must be the fully qualified name of the structure type. The structure type must be defined in a service definition loaded into the node, or pulled by a client object.

Parameters:
  • info_dict (dict) – The dictionary containing the parsed YAML structure

  • type_name (str) – The fully qualified name of the structure type. Examples include com.robotraconteur.robotics.robot.DeviceInfo and com.robotraconteur.robotics.robot.RobotInfo

Returns:

The parsed structure

ParseInfoFile(filename, type_name)

Load and parse a YAML file containing contents of a device info structure. The type_name must be the fully qualified name of the structure type. The structure type must be defined in a service definition loaded into the node, or pulled by a client object.

Parameters:
  • filename (str) – The filename of the YAML file to load

  • type_name (str) – The fully qualified name of the structure type. Examples include com.robotraconteur.robotics.robot.DeviceInfo and com.robotraconteur.robotics.robot.RobotInfo

Returns:

The parsed structure

ParseInfoString(info_string, type_name)

Parse a YAML string containing contents of a device info structure. The type_name must be the fully qualified name of the structure type. The structure type must be defined in a service definition loaded into the node, or pulled by a client object.

Parameters:
  • info_string (str) – The YAML string to parse

  • type_name (str) – The fully qualified name of the structure type. Examples include com.robotraconteur.robotics.robot.DeviceInfo and com.robotraconteur.robotics.robot.RobotInfo

Returns:

The parsed structure