Skip to content

Commit 0cdd411

Browse files
authored
Stop control, when UrDriver object is destroyed (#338)
1 parent 12b842a commit 0cdd411

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

include/ur_client_library/ur/ur_driver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ class UrDriver
435435
init(config);
436436
}
437437

438-
virtual ~UrDriver() = default;
438+
~UrDriver();
439439

440440
/*!
441441
* \brief Access function to receive the latest data package sent from the robot through RTDE

src/ur/ur_driver.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ static const std::string SCRIPT_COMMAND_PORT_REPLACE("{{SCRIPT_COMMAND_SERVER_PO
5252
static const std::string FORCE_MODE_SET_DAMPING_REPLACE("{{FORCE_MODE_SET_DAMPING_REPLACE}}");
5353
static const std::string FORCE_MODE_SET_GAIN_SCALING_REPLACE("{{FORCE_MODE_SET_GAIN_SCALING_REPLACE}}");
5454

55+
UrDriver::~UrDriver()
56+
{
57+
// This will return false if the external control script is not running.
58+
stopControl();
59+
}
60+
5561
void UrDriver::init(const UrDriverConfiguration& config)
5662
{
5763
robot_ip_ = config.robot_ip;

0 commit comments

Comments
 (0)