Skip to content

Commit 94e83be

Browse files
committed
wrapped current_moprim_execution_status_ into an std::atomic<>
1 parent 87f6551 commit 94e83be

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ur_robot_driver/include/ur_robot_driver/hardware_interface.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class URPositionHardwareInterface : public hardware_interface::SystemInterface
300300
// Status for communication with controller
301301
bool motion_primitives_forward_controller_running_;
302302
using MoprimExecutionState = motion_primitives_forward_controller::ExecutionState;
303-
MoprimExecutionState current_moprim_execution_status_;
303+
std::atomic<MoprimExecutionState> current_moprim_execution_status_;
304304
std::atomic_bool ready_for_new_moprim_;
305305

306306
// Command and state interfaces for the motion primitives

ur_robot_driver/src/hardware_interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ hardware_interface::return_type URPositionHardwareInterface::read(const rclcpp::
909909
updateNonDoubleValues();
910910

911911
// Motion primitives stuff
912-
hw_moprim_states_[0] = static_cast<uint8_t>(current_moprim_execution_status_);
912+
hw_moprim_states_[0] = static_cast<uint8_t>(current_moprim_execution_status_.load());
913913
hw_moprim_states_[1] = static_cast<double>(ready_for_new_moprim_);
914914

915915
return hardware_interface::return_type::OK;

0 commit comments

Comments
 (0)