Skip to content

Commit d8e1ff9

Browse files
authored
UrDriver: Send program in headless mode after creating trajectory and script_command servers (#271)
Before, we were sending the script code for execution to the robot and then opening the sockets that the script would connect to. This has been working fine in most cases, but that fails when too much time passes between the two steps. E.g. I experienced that when having debug output switched on, the robot script was not able to connect to the sockets. From my understanding this has been overlooked and there is no specific reason why the order was like that. Opening the sockets first and then sending the script seems to make more sense.
1 parent 99f0a76 commit d8e1ff9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ur/ur_driver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ void UrDriver::init(const UrDriverConfiguration& config)
148148
}
149149
prog.replace(prog.find(BEGIN_REPLACE), BEGIN_REPLACE.length(), begin_replace.str());
150150

151+
trajectory_interface_.reset(new control::TrajectoryPointInterface(config.trajectory_port));
152+
script_command_interface_.reset(new control::ScriptCommandInterface(config.script_command_port));
153+
151154
if (in_headless_mode_)
152155
{
153156
full_robot_program_ = "stop program\n";
@@ -167,9 +170,6 @@ void UrDriver::init(const UrDriverConfiguration& config)
167170
URCL_LOG_DEBUG("Created script sender");
168171
}
169172

170-
trajectory_interface_.reset(new control::TrajectoryPointInterface(config.trajectory_port));
171-
script_command_interface_.reset(new control::ScriptCommandInterface(config.script_command_port));
172-
173173
if (!std::empty(config.calibration_checksum))
174174
{
175175
URCL_LOG_WARN("DEPRECATION NOTICE: Passing the calibration_checksum to the UrDriver's constructor has been "

0 commit comments

Comments
 (0)