Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
urcl::rtde_interface::RTDEClient Class Reference

The RTDEClient class manages communication over the RTDE interface. It contains the RTDE handshake and read and write functionality to and from the robot. More...

#include <rtde_client.h>

Public Member Functions

std::unique_ptr< rtde_interface::DataPackagegetDataPackage (std::chrono::milliseconds timeout)
 Reads the pipeline to fetch the next data package. More...
 
std::string getIP () const
 Returns the IP address (of the machine running this driver) used for the socket connection. More...
 
double getMaxFrequency () const
 Getter for the frequency the robot will publish RTDE data packages with. More...
 
std::vector< std::string > getOutputRecipe ()
 Getter for the RTDE output recipe. More...
 
VersionInformation getVersion ()
 Getter for the UR control version received from the robot. More...
 
RTDEWritergetWriter ()
 Getter for the RTDE writer, which is used to send data via the RTDE interface to the robot. More...
 
bool init ()
 Sets up RTDE communication with the robot. The handshake includes negotiation of the used protocol version and setting of input and output recipes. More...
 
 RTDEClient ()=delete
 
 RTDEClient (std::string robot_ip, comm::INotifier &notifier, const std::string &output_recipe_file, const std::string &input_recipe_file)
 Creates a new RTDEClient object, including a used URStream and Pipeline to handle the communication with the robot. More...
 
bool start ()
 Triggers the robot to start sending RTDE data packages in the negotiated format. More...
 
 ~RTDEClient ()
 

Private Member Functions

bool negotiateProtocolVersion (const uint16_t protocol_version)
 
void queryURControlVersion ()
 
std::vector< std::string > readRecipe (const std::string &recipe_file)
 
void setupInputs ()
 
void setupOutputs (const uint16_t protocol_version)
 
std::vector< std::string > splitVariableTypes (const std::string &variable_types) const
 Splits a variable_types string as reported from the robot into single variable type strings. More...
 

Private Attributes

std::vector< std::string > input_recipe_
 
double max_frequency_
 
std::vector< std::string > output_recipe_
 
RTDEParser parser_
 
comm::Pipeline< RTDEPackagepipeline_
 
comm::URProducer< RTDEPackageprod_
 
comm::URStream< RTDEPackagestream_
 
VersionInformation urcontrol_version_
 
RTDEWriter writer_
 

Static Private Attributes

static constexpr const double CB3_MAX_FREQUENCY = 125.0
 
static constexpr const double URE_MAX_FREQUENCY = 500.0
 

Detailed Description

The RTDEClient class manages communication over the RTDE interface. It contains the RTDE handshake and read and write functionality to and from the robot.

Definition at line 81 of file rtde_client.h.

Constructor & Destructor Documentation

urcl::rtde_interface::RTDEClient::RTDEClient ( )
delete
urcl::rtde_interface::RTDEClient::RTDEClient ( std::string  robot_ip,
comm::INotifier notifier,
const std::string &  output_recipe_file,
const std::string &  input_recipe_file 
)

Creates a new RTDEClient object, including a used URStream and Pipeline to handle the communication with the robot.

Parameters
robot_ipThe IP of the robot
notifierThe notifier to use in the pipeline
output_recipe_filePath to the file containing the output recipe
input_recipe_filePath to the file containing the input recipe

Definition at line 35 of file src/rtde/rtde_client.cpp.

urcl::rtde_interface::RTDEClient::~RTDEClient ( )

Definition at line 48 of file src/rtde/rtde_client.cpp.

Member Function Documentation

std::unique_ptr< rtde_interface::DataPackage > urcl::rtde_interface::RTDEClient::getDataPackage ( std::chrono::milliseconds  timeout)

Reads the pipeline to fetch the next data package.

Parameters
timeoutTime to wait if no data package is currently in the queue
Returns
Unique ptr to the package, if a package was fetched successfully, nullptr otherwise

Definition at line 346 of file src/rtde/rtde_client.cpp.

std::string urcl::rtde_interface::RTDEClient::getIP ( ) const

Returns the IP address (of the machine running this driver) used for the socket connection.

Returns
The IP address as a string (e.g. "192.168.0.1")

Definition at line 361 of file src/rtde/rtde_client.cpp.

double urcl::rtde_interface::RTDEClient::getMaxFrequency ( ) const
inline

Getter for the frequency the robot will publish RTDE data packages with.

Returns
The used frequency

Definition at line 124 of file rtde_client.h.

std::vector<std::string> urcl::rtde_interface::RTDEClient::getOutputRecipe ( )
inline

Getter for the RTDE output recipe.

Returns
The output recipe

Definition at line 159 of file rtde_client.h.

VersionInformation urcl::rtde_interface::RTDEClient::getVersion ( )
inline

Getter for the UR control version received from the robot.

Returns
The VersionInformation received from the robot

Definition at line 134 of file rtde_client.h.

RTDEWriter & urcl::rtde_interface::RTDEClient::getWriter ( )

Getter for the RTDE writer, which is used to send data via the RTDE interface to the robot.

Returns
A reference to the used RTDEWriter

Definition at line 366 of file src/rtde/rtde_client.cpp.

bool urcl::rtde_interface::RTDEClient::init ( )

Sets up RTDE communication with the robot. The handshake includes negotiation of the used protocol version and setting of input and output recipes.

Returns
Success of the handshake

Definition at line 53 of file src/rtde/rtde_client.cpp.

bool urcl::rtde_interface::RTDEClient::negotiateProtocolVersion ( const uint16_t  protocol_version)
private

Definition at line 89 of file src/rtde/rtde_client.cpp.

void urcl::rtde_interface::RTDEClient::queryURControlVersion ( )
private

Definition at line 132 of file src/rtde/rtde_client.cpp.

std::vector< std::string > urcl::rtde_interface::RTDEClient::readRecipe ( const std::string &  recipe_file)
private

Definition at line 327 of file src/rtde/rtde_client.cpp.

void urcl::rtde_interface::RTDEClient::setupInputs ( )
private

Definition at line 232 of file src/rtde/rtde_client.cpp.

void urcl::rtde_interface::RTDEClient::setupOutputs ( const uint16_t  protocol_version)
private

Definition at line 170 of file src/rtde/rtde_client.cpp.

std::vector< std::string > urcl::rtde_interface::RTDEClient::splitVariableTypes ( const std::string &  variable_types) const
private

Splits a variable_types string as reported from the robot into single variable type strings.

Parameters
variable_typesString as reported from the robot
Returns
A vector of variable variable_names

Definition at line 371 of file src/rtde/rtde_client.cpp.

bool urcl::rtde_interface::RTDEClient::start ( )

Triggers the robot to start sending RTDE data packages in the negotiated format.

Returns
Success of the requested start

Definition at line 292 of file src/rtde/rtde_client.cpp.

Member Data Documentation

constexpr const double urcl::rtde_interface::RTDEClient::CB3_MAX_FREQUENCY = 125.0
staticprivate

Definition at line 177 of file rtde_client.h.

std::vector<std::string> urcl::rtde_interface::RTDEClient::input_recipe_
private

Definition at line 167 of file rtde_client.h.

double urcl::rtde_interface::RTDEClient::max_frequency_
private

Definition at line 175 of file rtde_client.h.

std::vector<std::string> urcl::rtde_interface::RTDEClient::output_recipe_
private

Definition at line 166 of file rtde_client.h.

RTDEParser urcl::rtde_interface::RTDEClient::parser_
private

Definition at line 168 of file rtde_client.h.

comm::Pipeline<RTDEPackage> urcl::rtde_interface::RTDEClient::pipeline_
private

Definition at line 170 of file rtde_client.h.

comm::URProducer<RTDEPackage> urcl::rtde_interface::RTDEClient::prod_
private

Definition at line 169 of file rtde_client.h.

comm::URStream<RTDEPackage> urcl::rtde_interface::RTDEClient::stream_
private

Definition at line 165 of file rtde_client.h.

VersionInformation urcl::rtde_interface::RTDEClient::urcontrol_version_
private

Definition at line 173 of file rtde_client.h.

constexpr const double urcl::rtde_interface::RTDEClient::URE_MAX_FREQUENCY = 500.0
staticprivate

Definition at line 178 of file rtde_client.h.

RTDEWriter urcl::rtde_interface::RTDEClient::writer_
private

Definition at line 171 of file rtde_client.h.


The documentation for this class was generated from the following files:


ur_client_library
Author(s): Thomas Timm Andersen, Simon Rasmussen, Felix Exner, Lea Steffen, Tristan Schnell
autogenerated on Sun May 9 2021 02:16:26