8 #include <Eigen/Geometry>
34 std::future_status
status = f.wait_for(std::chrono::seconds(0));
35 if (
status == std::future_status::ready)
39 else if (
status == std::future_status::deferred)
61 trajControllerParams{};
65 if (in.parameters.velocityLimitLinear.has_value())
67 trajControllerParams.limits.linear = in.parameters.velocityLimitLinear.value();
68 generalParams.
maxVel.
linear = in.parameters.velocityLimitLinear.value();
71 if (in.parameters.velocityLimitAngular.has_value())
73 trajControllerParams.limits.angular = in.parameters.velocityLimitAngular.value();
74 generalParams.maxVel.angular = in.parameters.velocityLimitAngular.value();
77 ARMARX_INFO <<
"Configuring navigator to respect the velocity limits:";
78 ARMARX_INFO <<
"linear: " << trajControllerParams.limits.linear;
79 ARMARX_INFO <<
"angular: " << trajControllerParams.limits.angular;
82 client::NavigationStackConfig cfg;
83 cfg.general(generalParams);
85 cfg.trajectoryController(trajControllerParams);
90 memorySubscriber.emplace(configId, srv_->memoryNameSystem);
94 srv_->iceNavigator.createConfig(cfg, configId);
96 navigator.emplace(client::Navigator::InjectedServices{
97 .navigator = &srv_->iceNavigator, .subscriber = &memorySubscriber.value()});
99 return ::armarx::skills::Skill::InitResult{
100 .status = ::armarx::skills::TerminatedSkillStatus::Succeeded};
106 const Eigen::Isometry3f globalTarget(in.parameters.targetPose);
117 auto future = std::async(std::launch::async, [
this]() {
return navigator->waitForStop(); });
128 auto se = future.get();
131 ARMARX_INFO <<
"Goal `" << Eigen::Isometry3f(in.parameters.targetPose).translation()
136 if (se.isSafetyStopTriggeredEvent())
140 return ::armarx::skills::Skill::MainResult{
141 .status = ::armarx::skills::TerminatedSkillStatus::Failed};
143 if (se.isUserAbortTriggeredEvent())
147 return ::armarx::skills::Skill::MainResult{
148 .status = ::armarx::skills::TerminatedSkillStatus::Failed};
150 if (se.isInternalErrorEvent())
153 << se.toInternalErrorEvent().message;
155 return ::armarx::skills::Skill::MainResult{
156 .status = ::armarx::skills::TerminatedSkillStatus::Failed};
161 return ::armarx::skills::Skill::MainResult{
162 .status = ::armarx::skills::TerminatedSkillStatus::Succeeded};
166 NavigateTo::onStopRequested()
168 if (navigator.has_value())