Skip to content

Commit

Permalink
Added missing RTDE data packages and fixed incorrect names (#213)
Browse files Browse the repository at this point in the history
Updated the list of RTDE data packages for consistency with
https://www.universal-robots.com/articles/ur/interface-communication/real-time-data-exchange-rtde-guide/.

Also added tests for all possible RTDE fields matching their software versions.
  • Loading branch information
remi-siffert-ocado authored Oct 12, 2024
1 parent 173f193 commit 9443dd1
Show file tree
Hide file tree
Showing 4 changed files with 427 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jobs:
ROBOT_MODEL: 'ur5e'
URSIM_VERSION: '5.9.4'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'
- DOCKER_RUN_OPTS: --network ursim_net
BEFORE_INIT: 'apt-get update -qq && apt-get install -y iproute2 iputils-ping && ip addr && ping -c5 192.168.56.101'
CTEST_OUTPUT_ON_FAILURE: 1
ROBOT_MODEL: 'ur20'
URSIM_VERSION: 'latest'
PROGRAM_FOLDER: 'tests/resources/dockerursim/programs/e-series'

steps:
- uses: actions/checkout@v1
Expand Down
17 changes: 14 additions & 3 deletions src/rtde/data_package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ std::unordered_map<std::string, DataPackage::_rtde_type_variant> DataPackage::g_
{ "target_moment", vector6d_t() },
{ "actual_q", vector6d_t() },
{ "actual_qd", vector6d_t() },
{ "actual_qdd", vector6d_t() },
{ "actual_current", vector6d_t() },
{ "actual_moment", vector6d_t() },
{ "actual_current_window", vector6d_t() },
{ "joint_control_output", vector6d_t() },
{ "actual_TCP_pose", vector6d_t() },
{ "actual_TCP_speed", vector6d_t() },
Expand All @@ -57,6 +56,7 @@ std::unordered_map<std::string, DataPackage::_rtde_type_variant> DataPackage::g_
{ "robot_mode", int32_t() },
{ "joint_mode", vector6int32_t() },
{ "safety_mode", int32_t() },
{ "safety_status", int32_t() },
{ "actual_tool_accelerometer", vector3d_t() },
{ "speed_scaling", double() },
{ "target_speed_fraction", double() },
Expand Down Expand Up @@ -88,7 +88,7 @@ std::unordered_map<std::string, DataPackage::_rtde_type_variant> DataPackage::g_
{ "tool_output_voltage", int32_t() },
{ "tool_output_current", double() },
{ "tool_temperature", double() },
{ "tool_force_scalar", double() },
{ "tcp_force_scalar", double() },
{ "output_bit_registers0_to_31", uint32_t() },
{ "output_bit_registers32_to_63", uint32_t() },
{ "output_bit_register_0", bool() },
Expand Down Expand Up @@ -548,7 +548,18 @@ std::unordered_map<std::string, DataPackage::_rtde_type_variant> DataPackage::g_
{ "configurable_digital_output_mask", uint8_t() },
{ "configurable_digital_output", uint8_t() },
{ "tool_digital_output_mask", uint8_t() },
{ "tool_output_mode", uint8_t() },
{ "tool_digital_output0_mode", uint8_t() },
{ "tool_digital_output1_mode", uint8_t() },
{ "tool_digital_output", uint8_t() },
{ "payload", double() },
{ "payload_cog", vector3d_t() },
{ "payload_inertia", vector6d_t() },
{ "script_control_line", uint32_t() },
{ "ft_raw_wrench", vector6d_t() },
{ "joint_position_deviation_ratio", double() },
{ "collision_detection_ratio", double() },
{ "time_scale_source", int32_t() },
{ "standard_analog_output_mask", uint8_t() },
{ "standard_analog_output_type", uint8_t() },
{ "standard_analog_output_0", double() },
Expand Down
2 changes: 1 addition & 1 deletion src/rtde/rtde_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ void RTDEClient::setupOutputs(const uint16_t protocol_version)
unsigned int num_retries = 0;
size_t size;
size_t written;
uint8_t buffer[4096];
uint8_t buffer[8192];
URCL_LOG_INFO("Setting up RTDE communication with frequency %f", target_frequency_);
if (protocol_version == 2)
{
Expand Down
Loading

0 comments on commit 9443dd1

Please sign in to comment.