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

throw exception when tool communication is requested for CB3

This commit is contained in:
Felix Mauch
2019-06-11 17:53:31 +02:00
parent e0201002f6
commit 520cd4d860
2 changed files with 36 additions and 0 deletions

View File

@@ -82,9 +82,16 @@ ur_driver::UrDriver::UrDriver(const std::string& robot_ip, const std::string& sc
prog.replace(prog.find(SERVER_IP_REPLACE), SERVER_IP_REPLACE.length(), local_ip);
prog.replace(prog.find(SERVER_PORT_REPLACE), SERVER_PORT_REPLACE.length(), std::to_string(reverse_port));
auto urcontrol_version = rtde_client_->getVersion();
std::stringstream begin_replace;
if (tool_comm_setup != nullptr)
{
if (urcontrol_version.major < 5)
{
throw VersionMismatch("This robot version does not support using the tool communication interface.", 5,
urcontrol_version.major);
}
begin_replace << "set_tool_voltage("
<< static_cast<std::underlying_type<ToolVoltage>::type>(tool_comm_setup->getToolVoltage()) << ")\n";
begin_replace << "set_tool_communication("