8#include <Eigen/Geometry>
34 NavigateToAlternatives::init(
const Base::SpecializedInitInput& in)
36 helper.
init(in.parameters.navigatingSkillParams,
39 return ::armarx::skills::Skill::InitResult{
44 NavigateToAlternatives::main(
const Base::SpecializedMainInput& in)
46 std::vector<core::TargetAlternative> targetAlternatives;
47 for (
const auto& t : in.parameters.targetAlternatives)
49 core::TargetAlternative bo;
51 targetAlternatives.emplace_back(bo);
54 ARMARX_INFO <<
"moving to " << targetAlternatives.size() <<
" alternatives";
62 helper.
getNavigator()->moveToAlternatives(targetAlternatives,
72 if (se.isSafetyStopTriggeredEvent())
76 return ::armarx::skills::Skill::MainResult{
79 if (se.isUserAbortTriggeredEvent())
83 return ::armarx::skills::Skill::MainResult{
86 if (se.isInternalErrorEvent())
89 << se.toInternalErrorEvent().message;
91 return ::armarx::skills::Skill::MainResult{
94 if (se.isGlobalPlanningFailedEvent())
97 << se.toGlobalPlanningFailedEvent().message;
99 return ::armarx::skills::Skill::MainResult{
104 return ::armarx::skills::Skill::MainResult{
109 return ::armarx::skills::Skill::MainResult{
114 NavigateToAlternatives::onStopRequested()
116 if (helper.getNavigator().has_value())
119 helper.getNavigator()->stop();
123 armarx::skills::SkillDescription
127 defaultParameters.targetAlternatives = {};
132 .description =
"Navigate to a list of prioritized target alternatives.",
133 .rootProfileDefaults = defaultParameters.toAron(),
135 .parametersType = Params::ToAronType()};
static Duration Hours(std::int64_t hours)
Constructs a duration in hours.
::armarx::skills::SimpleSpecializedSkill< Params > Base
static armarx::skills::SkillDescription DefaultSkillDescription()
NavigateToAlternatives(const NavigatingSkillHelper::Properties &properties, const NavigatingSkillHelper::Services &srv)
std::optional< client::Navigator > & getNavigator()
void init(const arondto::NavigatingSkillParams ¶ms, const std::string &id)
static arondto::NavigatingSkillParams DefaultSkillDescription()
client::StopEvent moveAndWaitForStop(IssueNavigationCommandT &&issueNavigationCommand, ShouldTerminateT &&shouldTerminate)
Issues the navigation command and waits for the navigator to stop, polling shouldTerminate meanwhile.
arondto::NavigateToAlternativesParams ParamType
bool shouldSkillTerminate() const override
Returns whether the skill should terminate as soon as possible.
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
#define ARMARX_INFO
The normal logging level.
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
void fromAron(const arondto::GlobalTrajectoryPoint &dto, GlobalTrajectoryPoint &bo)
const std::string NavigateToAlternatives
A result struct for skill initialization.
A result struct for th main method of a skill.