Class RTDEWriter

Class Documentation

class RTDEWriter

The RTDEWriter class offers an abstraction layer to send data to the robot via the RTDE interface. Several simple to use functions to create data packages to send exist, which are then sent to the robot in an additional thread.

Public Functions

RTDEWriter() = delete
RTDEWriter(comm::URStream<RTDEPackage> *stream, const std::vector<std::string> &recipe)

Creates a new RTDEWriter object using a given URStream and recipe.

Parameters:
  • stream – The URStream to use for communication with the robot

  • recipe – The recipe to use for communication

inline ~RTDEWriter()
void init(uint8_t recipe_id)

Starts the writer thread, which periodically clears the queue to write packages to the robot.

Parameters:

recipe_id – The recipe id to use, so the robot correctly identifies the used recipe

void run()

The writer thread loop, continually serializing and sending packages to the robot.

bool sendSpeedSlider(double speed_slider_fraction)

Creates a package to request setting a new value for the speed slider.

Parameters:

speed_slider_fraction – The new speed slider fraction as a value between 0.0 and 1.0

Returns:

Success of the package creation

bool sendStandardDigitalOutput(uint8_t output_pin, bool value)

Creates a package to request setting a new value for one of the standard digital output pins.

Parameters:
  • output_pin – The pin to change

  • value – The new value

Returns:

Success of the package creation

bool sendConfigurableDigitalOutput(uint8_t output_pin, bool value)

Creates a package to request setting a new value for one of the configurable digital output pins.

Parameters:
  • output_pin – The pin to change

  • value – The new value

Returns:

Success of the package creation

bool sendToolDigitalOutput(uint8_t output_pin, bool value)

Creates a package to request setting a new value for one of the tool output pins.

Parameters:
  • output_pin – The pin to change

  • value – The new value

Returns:

Success of the package creation

bool sendStandardAnalogOutput(uint8_t output_pin, double value)

Creates a package to request setting a new value for one of the standard analog output pins.

Parameters:
  • output_pin – The pin to change

  • value – The new value, it should be between 0 and 1, where 0 is 4mA and 1 is 20mA.

Returns:

Success of the package creation

bool sendInputBitRegister(uint32_t register_id, bool value)

Creates a package to request setting a new value for an input_bit_register.

Parameters:
  • register_id – The id of the register that should be changed [64..127]

  • value – The new value

Returns:

Success of the package creation

bool sendInputIntRegister(uint32_t register_id, int32_t value)

Creates a package to request setting a new value for an input_int_register.

Parameters:
  • register_id – The id of the register that should be changed [24..47]

  • value – The new value

Returns:

Success of the package creation

bool sendInputDoubleRegister(uint32_t register_id, double value)

Creates a package to request setting a new value for an input_double_register.

Parameters:
  • register_id – The id of the register that should be changed [24..47]

  • value – The new value

Returns:

Success of the package creation