RobotRaconteurCompanion.Util.SensorDataUtil

Utility class for filling in com.robotraconteur.sensordata.SensorDataHeader structures

import RobotRaconteur as RR
RRN = RR.RobotRaconteurNode.s
import RobotRaconteurCompanion as RRC
from RobotRaconteurCompanion.Util.InfoFileLoader import InfoFileLoader
from RobotRaconteurCompanion.Util.SensorDataUtil import SensorDataUtil

RRC.RegisterStdRobDefServiceTypes(RRN)
info_loader = InfoFileLoader(RRN)
camera_info, camera_ident_fd = info_loader.LoadInfoFileFromString(camera_info_text, "com.robotraconteur.imaging.camerainfo.CameraInfo", "camera")

sensordata_util = SensorDataUtil(RRN)

while True:

    # Do some work on the driver

    # Create a new sensor data structure
    seqno += 1
    sensor_data_header = sensordata_util.FillSensorDataHeader(camera_info, seqno, time.time())

    # Sensor data structures typically have a data_header field of type SensorDataHeader
    my_sensor_data.data_header = sensor_data_header

SensorDataUtil

class RobotRaconteurCompanion.Util.SensorDataUtil.SensorDataUtil(node=None, client_obj=None)

Fill in a SensorDataHeader with the current time and sequence number

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

FillSensorDataHeader(device_info, seqno)

Fill in a SensorDataHeader with the current time and sequence number

Parameters:
  • device_info (com.robotraconteur.device.DeviceInfo) – The device info to use for the source info

  • seqno (int) – The sequence number to use