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>
|
std::unique_ptr< rtde_interface::DataPackage > | getDataPackage (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 maximum frequency the robot can publish RTDE data packages with. More...
|
|
std::vector< std::string > | getOutputRecipe () |
| Getter for the RTDE output recipe. More...
|
|
double | getTargetFrequency () const |
| Getter for the target frequency that the robot will publish RTDE data packages with. More...
|
|
VersionInformation | getVersion () |
| Getter for the UR control version received from the robot. More...
|
|
RTDEWriter & | getWriter () |
| 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...
|
|
bool | pause () |
| Pauses RTDE data package communication. More...
|
|
| RTDEClient ()=delete |
|
| RTDEClient (std::string robot_ip, comm::INotifier ¬ifier, const std::string &output_recipe_file, const std::string &input_recipe_file, double target_frequency=0.0) |
| 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 () |
|
|
void | disconnect () |
|
bool | isRobotBooted () |
| Checks whether the robot is booted, this is done by looking at the timestamp from the robot controller, this will show the time in seconds since the controller was started. If the timestamp is below 40, we will read from the stream for approximately 1 second to ensure that the RTDE interface is up and running. This will ensure that we don't finalize setting up communication, before the controller is up and running. Else we could end up connecting to the RTDE interface, before a restart occurs during robot boot which would then destroy the connection established. More...
|
|
bool | negotiateProtocolVersion (const uint16_t protocol_version) |
|
void | queryURControlVersion () |
|
std::vector< std::string > | readRecipe (const std::string &recipe_file) |
|
bool | sendPause () |
|
bool | sendStart () |
|
void | setupCommunication () |
|
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...
|
|
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 92 of file rtde_client.h.
◆ RTDEClient() [1/2]
urcl::rtde_interface::RTDEClient::RTDEClient |
( |
| ) |
|
|
delete |
◆ RTDEClient() [2/2]
urcl::rtde_interface::RTDEClient::RTDEClient |
( |
std::string |
robot_ip, |
|
|
comm::INotifier & |
notifier, |
|
|
const std::string & |
output_recipe_file, |
|
|
const std::string & |
input_recipe_file, |
|
|
double |
target_frequency = 0.0 |
|
) |
| |
Creates a new RTDEClient object, including a used URStream and Pipeline to handle the communication with the robot.
- Parameters
-
robot_ip | The IP of the robot |
notifier | The notifier to use in the pipeline |
output_recipe_file | Path to the file containing the output recipe |
input_recipe_file | Path to the file containing the input recipe |
target_frequency | Frequency to run at. Defaults to 0.0 which means maximum frequency. |
Definition at line 37 of file src/rtde/rtde_client.cpp.
◆ ~RTDEClient()
urcl::rtde_interface::RTDEClient::~RTDEClient |
( |
| ) |
|
◆ disconnect()
void urcl::rtde_interface::RTDEClient::disconnect |
( |
| ) |
|
|
private |
◆ getDataPackage()
Reads the pipeline to fetch the next data package.
- Parameters
-
timeout | Time 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 570 of file src/rtde/rtde_client.cpp.
◆ getIP()
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 585 of file src/rtde/rtde_client.cpp.
◆ getMaxFrequency()
double urcl::rtde_interface::RTDEClient::getMaxFrequency |
( |
| ) |
const |
|
inline |
Getter for the maximum frequency the robot can publish RTDE data packages with.
- Returns
- The maximum frequency
Definition at line 142 of file rtde_client.h.
◆ getOutputRecipe()
std::vector<std::string> urcl::rtde_interface::RTDEClient::getOutputRecipe |
( |
| ) |
|
|
inline |
Getter for the RTDE output recipe.
- Returns
- The output recipe
Definition at line 187 of file rtde_client.h.
◆ getTargetFrequency()
double urcl::rtde_interface::RTDEClient::getTargetFrequency |
( |
| ) |
const |
|
inline |
Getter for the target frequency that the robot will publish RTDE data packages with.
- Returns
- The target frequency
Definition at line 152 of file rtde_client.h.
◆ getVersion()
◆ getWriter()
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 590 of file src/rtde/rtde_client.cpp.
◆ init()
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 57 of file src/rtde/rtde_client.cpp.
◆ isRobotBooted()
bool urcl::rtde_interface::RTDEClient::isRobotBooted |
( |
| ) |
|
|
private |
Checks whether the robot is booted, this is done by looking at the timestamp from the robot controller, this will show the time in seconds since the controller was started. If the timestamp is below 40, we will read from the stream for approximately 1 second to ensure that the RTDE interface is up and running. This will ensure that we don't finalize setting up communication, before the controller is up and running. Else we could end up connecting to the RTDE interface, before a restart occurs during robot boot which would then destroy the connection established.
- Returns
- true if the robot is booted, false otherwise which will essentially trigger a reconnection.
Definition at line 393 of file src/rtde/rtde_client.cpp.
◆ negotiateProtocolVersion()
bool urcl::rtde_interface::RTDEClient::negotiateProtocolVersion |
( |
const uint16_t |
protocol_version | ) |
|
|
private |
◆ pause()
bool urcl::rtde_interface::RTDEClient::pause |
( |
| ) |
|
Pauses RTDE data package communication.
- Returns
- Whether the RTDE data package communication was paused successfully
Definition at line 456 of file src/rtde/rtde_client.cpp.
◆ queryURControlVersion()
void urcl::rtde_interface::RTDEClient::queryURControlVersion |
( |
| ) |
|
|
private |
◆ readRecipe()
std::vector< std::string > urcl::rtde_interface::RTDEClient::readRecipe |
( |
const std::string & |
recipe_file | ) |
|
|
private |
◆ sendPause()
bool urcl::rtde_interface::RTDEClient::sendPause |
( |
| ) |
|
|
private |
◆ sendStart()
bool urcl::rtde_interface::RTDEClient::sendStart |
( |
| ) |
|
|
private |
◆ setupCommunication()
void urcl::rtde_interface::RTDEClient::setupCommunication |
( |
| ) |
|
|
private |
◆ setupInputs()
void urcl::rtde_interface::RTDEClient::setupInputs |
( |
| ) |
|
|
private |
◆ setupOutputs()
void urcl::rtde_interface::RTDEClient::setupOutputs |
( |
const uint16_t |
protocol_version | ) |
|
|
private |
◆ splitVariableTypes()
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_types | String as reported from the robot |
- Returns
- A vector of variable variable_names
Definition at line 595 of file src/rtde/rtde_client.cpp.
◆ start()
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 432 of file src/rtde/rtde_client.cpp.
◆ CB3_MAX_FREQUENCY
constexpr const double urcl::rtde_interface::RTDEClient::CB3_MAX_FREQUENCY = 125.0 |
|
staticprivate |
◆ client_state_
ClientState urcl::rtde_interface::RTDEClient::client_state_ |
|
private |
◆ input_recipe_
std::vector<std::string> urcl::rtde_interface::RTDEClient::input_recipe_ |
|
private |
◆ max_frequency_
double urcl::rtde_interface::RTDEClient::max_frequency_ |
|
private |
◆ output_recipe_
std::vector<std::string> urcl::rtde_interface::RTDEClient::output_recipe_ |
|
private |
◆ parser_
RTDEParser urcl::rtde_interface::RTDEClient::parser_ |
|
private |
◆ pipeline_
◆ prod_
◆ stream_
◆ target_frequency_
double urcl::rtde_interface::RTDEClient::target_frequency_ |
|
private |
◆ urcontrol_version_
◆ URE_MAX_FREQUENCY
constexpr const double urcl::rtde_interface::RTDEClient::URE_MAX_FREQUENCY = 500.0 |
|
staticprivate |
◆ writer_
RTDEWriter urcl::rtde_interface::RTDEClient::writer_ |
|
private |
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 Tue Jul 4 2023 02:09:47