1
0
mirror of https://gitlab.com/obbart/universal_robots_ros_driver.git synced 2026-04-12 11:00:47 +02:00

introduced VersionInformation

Use this as a data container to store version information in.
This commit is contained in:
Felix Mauch
2019-06-11 17:52:58 +02:00
parent e1e71b5cb4
commit e0201002f6
6 changed files with 60 additions and 6 deletions

View File

@@ -33,10 +33,10 @@ namespace rtde_interface
{
bool GetUrcontrolVersion::parseWith(comm::BinParser& bp)
{
bp.parse(major_);
bp.parse(minor_);
bp.parse(bugfix_);
bp.parse(build_);
bp.parse(version_information_.major);
bp.parse(version_information_.minor);
bp.parse(version_information_.bugfix);
bp.parse(version_information_.build);
return true;
}

View File

@@ -26,6 +26,7 @@
//----------------------------------------------------------------------
#include "ur_rtde_driver/rtde/rtde_client.h"
#include "ur_rtde_driver/exceptions.h"
namespace ur_driver
{
@@ -73,9 +74,15 @@ bool RTDEClient::init()
size = GetUrcontrolVersionRequest::generateSerializedRequest(buffer);
stream_.write(buffer, size, written);
pipeline_.getLatestProduct(package, std::chrono::milliseconds(1000));
rtde_interface::GetUrcontrolVersion* tmp_control_version =
rtde_interface::GetUrcontrolVersion* tmp_urcontrol_version =
dynamic_cast<rtde_interface::GetUrcontrolVersion*>(package.get());
if (tmp_control_version->major_ < 5)
if (tmp_urcontrol_version == nullptr)
{
throw UrException("Could not get urcontrol version from robot. This should not happen!");
}
urcontrol_version_ = tmp_urcontrol_version->version_information_;
if (urcontrol_version_.major < 5)
{
max_frequency_ = CB3_MAX_FREQUENCY;
}