7 #include <Eigen/Geometry>
32 std::future_status
status = f.wait_for(std::chrono::seconds(0));
33 if (
status == std::future_status::ready)
37 else if (
status == std::future_status::deferred)
59 trajControllerParams{};
63 if (in.parameters.velocityLimitLinear.has_value())
65 trajControllerParams.limits.linear = in.parameters.velocityLimitLinear.value();
66 generalParams.
maxVel.
linear = in.parameters.velocityLimitLinear.value();
69 if (in.parameters.velocityLimitAngular.has_value())
71 trajControllerParams.limits.angular = in.parameters.velocityLimitAngular.value();
72 generalParams.maxVel.angular = in.parameters.velocityLimitAngular.value();
75 ARMARX_INFO <<
"Configuring navigator to respect the velocity limits:";
76 ARMARX_INFO <<
"linear: " << trajControllerParams.limits.linear;
77 ARMARX_INFO <<
"angular: " << trajControllerParams.limits.angular;
80 client::NavigationStackConfig cfg;
81 cfg.general(generalParams);
83 cfg.trajectoryController(trajControllerParams);
88 memorySubscriber.emplace(configId, srv_->memoryNameSystem);
92 srv_->iceNavigator.createConfig(cfg, configId);
94 navigator.emplace(client::Navigator::InjectedServices{
95 .navigator = &srv_->iceNavigator, .subscriber = &memorySubscriber.value()});
97 return ::armarx::skills::Skill::InitResult{
98 .status = ::armarx::skills::TerminatedSkillStatus::Succeeded};
104 const Eigen::Isometry3f globalTarget(in.parameters.targetPose);
115 auto future = std::async(std::launch::async, [
this]() {
return navigator->waitForStop(); });
126 auto se = future.get();
129 ARMARX_INFO <<
"Goal `" << Eigen::Isometry3f(in.parameters.targetPose).translation()
134 if (se.isSafetyStopTriggeredEvent())
138 return ::armarx::skills::Skill::MainResult{
139 .status = ::armarx::skills::TerminatedSkillStatus::Failed};
141 if (se.isUserAbortTriggeredEvent())
145 return ::armarx::skills::Skill::MainResult{
146 .status = ::armarx::skills::TerminatedSkillStatus::Failed};
148 if (se.isInternalErrorEvent())
151 << se.toInternalErrorEvent().message;
153 return ::armarx::skills::Skill::MainResult{
154 .status = ::armarx::skills::TerminatedSkillStatus::Failed};
159 return ::armarx::skills::Skill::MainResult{
160 .status = ::armarx::skills::TerminatedSkillStatus::Succeeded};
164 NavigateTo::onStopRequested()
166 if (navigator.has_value())