Skip to content

Commit 648b5ef

Browse files
committed
Only sleep before playing if we can use that function
1 parent 407ab7e commit 648b5ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ur_robot_driver/src/robot_state_helper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,12 @@ void RobotStateHelper::setModeExecute(const std::shared_ptr<RobotStateHelper::Se
361361
if (headless_mode_) {
362362
result_->success = safeDashboardTrigger(this->resend_robot_program_srv_);
363363
} else {
364-
// The dashboard denies playing immediately after switching the mode to RUNNING
365-
sleep(1);
366364
if (play_program_srv_ == nullptr) {
367365
result_->success = false;
368366
result_->message = "Play program service not available on this robot.";
369367
} else {
368+
// The dashboard denies playing immediately after switching the mode to RUNNING
369+
sleep(1);
370370
result_->success = safeDashboardTrigger(this->play_program_srv_);
371371
}
372372
}

0 commit comments

Comments
 (0)