32 auto stopped_callback = [
this](
const auto& e) { stopped(
StopEvent(e)); };
34 srv.subscriber->onGoalReached(stopped_callback);
35 srv.subscriber->onSafetyStopTriggered(stopped_callback);
36 srv.subscriber->onUserAbortTriggered(stopped_callback);
37 srv.subscriber->onInternalError(stopped_callback);
38 srv.subscriber->onGlobalPlanningFailed(stopped_callback);
45 moveTo(std::vector<core::Pose>{pose}, frame);
56 std::scoped_lock
const l{stoppedInfo.m};
57 stoppedInfo.event.reset();
68 const std::vector<WaypointTarget>& path = builder.
path();
74 std::scoped_lock
const l{stoppedInfo.m};
75 stoppedInfo.event.reset();
98 std::scoped_lock
const l{stoppedInfo.m};
99 stoppedInfo.event.reset();
113 std::scoped_lock
const l{stoppedInfo.m};
114 stoppedInfo.event.reset();
165 std::future<void> future = std::async(
169 std::unique_lock l{stoppedInfo.m};
170 stoppedInfo.cv.wait(l, [&i = stoppedInfo] {
return i.event.has_value(); });
177 auto status = future.wait_for(std::chrono::milliseconds(timeoutMs));
182 case std::future_status::ready:
183 ARMARX_INFO <<
"waitForStop: terminated on goal reached";
185 case std::future_status::timeout:
186 ARMARX_INFO <<
"waitForStop: terminated due to timeout";
190 throw LocalException(
"Navigator::waitForStop: timeout");
192 case std::future_status::deferred:
208 stoppedInfo.event.reset();
218 std::scoped_lock l{stoppedInfo.m};
219 stoppedInfo.event = e;
221 stoppedInfo.cv.notify_all();