Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions moveit_ros/robot_interaction/src/locked_robot_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void robot_interaction::LockedRobotState::setState(const moveit::core::RobotStat

// If someone else has a reference to the state, then make a new copy.
// The old state is orphaned (does not change, but is now out of date).
if (state_.unique())
if (state_.use_count() == 1)
{
*state_ = state;
}
Expand All @@ -87,7 +87,7 @@ void robot_interaction::LockedRobotState::modifyState(const ModifyStateFunction&

// If someone else has a reference to the state, then make a copy.
// The old state is orphaned (does not change, but is now out of date).
if (!state_.unique())
if (state_.use_count() != 1)
state_ = std::make_shared<moveit::core::RobotState>(*state_);

modify(state_.get());
Expand Down
Loading