Skip to content

Commit 5cae525

Browse files
committed
changed implementation for current_moprim_execution_status_ after instruction_executor_ execution is done
1 parent db0754f commit 5cae525

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

ur_robot_driver/src/hardware_interface.cpp

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,12 +1708,9 @@ void URPositionHardwareInterface::processMoprimMotionCmd(const std::vector<doubl
17081708
build_moprim_sequence_ = false;
17091709
current_moprim_execution_status_ = MoprimExecutionState::EXECUTING;
17101710
bool success = instruction_executor_->executeMotion(moprim_sequence_);
1711-
current_moprim_execution_status_ = success ? MoprimExecutionState::SUCCESS : MoprimExecutionState::ERROR;
1712-
RCLCPP_INFO(rclcpp::get_logger("URPositionHardwareInterface"),
1713-
" [processMoprimMotionCmd] After executing motion sequence: current_moprim_execution_status_ = %d",
1714-
static_cast<uint8_t>(current_moprim_execution_status_));
17151711
moprim_sequence_.clear();
17161712
if (success) {
1713+
current_moprim_execution_status_ = MoprimExecutionState::SUCCESS;
17171714
ready_for_new_moprim_ = true; // set to true to allow sending new commands
17181715
}
17191716
return;
@@ -1760,11 +1757,8 @@ void URPositionHardwareInterface::processMoprimMotionCmd(const std::vector<doubl
17601757
joint_positions[0], joint_positions[1], joint_positions[2], joint_positions[3],
17611758
joint_positions[4], joint_positions[5], velocity, acceleration, move_time, blend_radius);
17621759
bool success = instruction_executor_->moveJ(joint_positions, acceleration, velocity, move_time, blend_radius);
1763-
current_moprim_execution_status_ = success ? MoprimExecutionState::SUCCESS : MoprimExecutionState::ERROR;
1764-
RCLCPP_INFO(rclcpp::get_logger("URPositionHardwareInterface"),
1765-
" [processMoprimMotionCmd] After executing moveJ: current_moprim_execution_status_ = %d",
1766-
static_cast<uint8_t>(current_moprim_execution_status_));
17671760
if (success) {
1761+
current_moprim_execution_status_ = MoprimExecutionState::SUCCESS;
17681762
ready_for_new_moprim_ = true; // set to true to allow sending new commands
17691763
}
17701764
return;
@@ -1815,11 +1809,8 @@ void URPositionHardwareInterface::processMoprimMotionCmd(const std::vector<doubl
18151809
pose.x, pose.y, pose.z, pose.rx, pose.ry, pose.rz, velocity, acceleration, move_time,
18161810
blend_radius);
18171811
bool success = instruction_executor_->moveL(pose, acceleration, velocity, move_time, blend_radius);
1818-
current_moprim_execution_status_ = success ? MoprimExecutionState::SUCCESS : MoprimExecutionState::ERROR;
1819-
RCLCPP_INFO(rclcpp::get_logger("URPositionHardwareInterface"),
1820-
" [processMoprimMotionCmd] After executing moveL: current_moprim_execution_status_ = %d",
1821-
static_cast<uint8_t>(current_moprim_execution_status_));
18221812
if (success) {
1813+
current_moprim_execution_status_ = MoprimExecutionState::SUCCESS;
18231814
ready_for_new_moprim_ = true; // set to true to allow sending new commands
18241815
}
18251816
return;
@@ -1881,11 +1872,8 @@ void URPositionHardwareInterface::processMoprimMotionCmd(const std::vector<doubl
18811872
goal_pose.y, goal_pose.z, goal_pose.rx, goal_pose.ry, goal_pose.rz, velocity, acceleration,
18821873
blend_radius, mode);
18831874
bool success = instruction_executor_->moveC(via_pose, goal_pose, acceleration, velocity, blend_radius, mode);
1884-
current_moprim_execution_status_ = success ? MoprimExecutionState::SUCCESS : MoprimExecutionState::ERROR;
1885-
RCLCPP_INFO(rclcpp::get_logger("URPositionHardwareInterface"),
1886-
" [processMoprimMotionCmd] After executing moveC: current_moprim_execution_status_ = %d",
1887-
static_cast<uint8_t>(current_moprim_execution_status_));
18881875
if (success) {
1876+
current_moprim_execution_status_ = MoprimExecutionState::SUCCESS;
18891877
ready_for_new_moprim_ = true; // set to true to allow sending new commands
18901878
}
18911879
return;

0 commit comments

Comments
 (0)