25 auto stopped_callback = [
this](
const auto& e) { stopped(
StopEvent(e)); };
27 srv.subscriber->onGoalReached(stopped_callback);
28 srv.subscriber->onSafetyStopTriggered(stopped_callback);
29 srv.subscriber->onUserAbortTriggered(stopped_callback);
30 srv.subscriber->onInternalError(stopped_callback);
31 srv.subscriber->onGlobalPlanningFailed(stopped_callback);
39 moveTo(std::vector<core::Pose>{pose}, frame);
51 std::scoped_lock
const l{stoppedInfo.m};
52 stoppedInfo.event.reset();
64 const std::vector<WaypointTarget>& path = builder.
path();
70 std::scoped_lock
const l{stoppedInfo.m};
71 stoppedInfo.event.reset();
93 std::scoped_lock
const l{stoppedInfo.m};
94 stoppedInfo.event.reset();
107 std::scoped_lock
const l{stoppedInfo.m};
108 stoppedInfo.event.reset();
166 std::future<void> future = std::async(
170 std::unique_lock l{stoppedInfo.m};
171 stoppedInfo.cv.wait(l, [&i = stoppedInfo] {
return i.event.has_value(); });
178 auto status = future.wait_for(std::chrono::milliseconds(timeoutMs));
183 case std::future_status::ready:
184 ARMARX_INFO <<
"waitForStop: terminated on goal reached";
186 case std::future_status::timeout:
187 ARMARX_INFO <<
"waitForStop: terminated due to timeout";
191 throw LocalException(
"Navigator::waitForStop: timeout");
193 case std::future_status::deferred:
209 stoppedInfo.event.reset();
220 std::scoped_lock l{stoppedInfo.m};
221 stoppedInfo.event = e;
223 stoppedInfo.cv.notify_all();