32 namespace rtde_interface
52 std::unique_ptr<DataPackage> package;
55 if (
queue_.waitDequeTimed(package, 1000000))
58 size = package->serializePackage(buffer);
59 stream_->write(buffer, size, written);
71 success = success &&
package_.
setData(
"speed_slider_fraction", speed_slider_fraction);
90 uint8_t digital_output;
100 success = success &&
package_.
setData(
"standard_digital_output", digital_output);
119 uint8_t digital_output;
122 digital_output = 255;
129 success = success &&
package_.
setData(
"configurable_digital_output", digital_output);
148 uint8_t digital_output;
151 digital_output = 255;
158 success = success &&
package_.
setData(
"tool_digital_output", digital_output);
177 uint8_t output_type = 0;
180 success = success &&
package_.
setData(
"standard_analog_output_type", output_type);
181 success = success &&
package_.
setData(
"standard_analog_output_0", value);
182 success = success &&
package_.
setData(
"standard_analog_output_1", value);
209 std::stringstream ss;
210 ss <<
"input_bit_register_" << register_id;
227 std::stringstream ss;
228 ss <<
"input_int_register_" << register_id;
245 std::stringstream ss;
246 ss <<
"input_double_register_" << register_id;
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...
void init(uint8_t recipe_id)
Starts the writer thread, which periodically clears the queue to write packages to the robot...
bool sendInputIntRegister(uint32_t register_id, int32_t value)
Creates a package to request setting a new value for an input_int_register.
The stream is an abstraction of the TCPSocket that offers reading a full UR data package out of the s...
comm::URStream< RTDEPackage > * stream_
std::mutex package_mutex_
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...
bool sendToolDigitalOutput(uint8_t output_pin, bool value)
Creates a package to request setting a new value for one of the tool output pins. ...
#define URCL_LOG_DEBUG(...)
uint8_t pinToMask(uint8_t pin)
std::vector< std::string > recipe_
void run()
The writer thread loop, continually serializing and sending packages to the robot.
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...
std::thread writer_thread_
bool sendInputBitRegister(uint32_t register_id, bool value)
Creates a package to request setting a new value for an input_bit_register.
bool sendInputDoubleRegister(uint32_t register_id, double value)
Creates a package to request setting a new value for an input_double_register.
The DataPackage class handles communication in the form of RTDE data packages both to and from the ro...
void initEmpty()
Initializes to contained list with empty values based on the recipe.
moodycamel::BlockingReaderWriterQueue< std::unique_ptr< DataPackage > > queue_
bool setData(const std::string &name, T &val)
Set a data field in the DataPackage.
bool sendSpeedSlider(double speed_slider_fraction)
Creates a package to request setting a new value for the speed slider.