11#include <Eigen/Geometry>
34 armarx::skills::SkillDescription
38 defaultParameters.location =
"";
44 <<
"Retrieve the location `location` from the memory and navigate to it."
45 <<
"\n\nThe `location` is specified by its provider segment name and entity name"
46 " in the format `providerSegmentName/entityName` .";
51 .rootProfileDefaults = defaultParameters.toAron(),
53 .parametersType = Params::ToAronType(),
64 NavigateToLocation::init(
const Base::SpecializedInitInput& in)
66 helper.
init(in.parameters.navigatingSkillParams,
69 return ::armarx::skills::Skill::InitResult{
74 NavigateToLocation::main(
const Base::SpecializedMainInput& in)
76 const std::string& location = in.parameters.location;
77 const std::optional<std::string>& locationProvider = in.parameters.locationProvider;
89 [&] { helper.
getNavigator()->moveToLocation(location, locationProvider); },
94 return ::armarx::skills::Skill::MainResult{
99 if (se.isSafetyStopTriggeredEvent())
103 return ::armarx::skills::Skill::MainResult{
106 if (se.isUserAbortTriggeredEvent())
110 return ::armarx::skills::Skill::MainResult{
113 if (se.isInternalErrorEvent())
116 << se.toInternalErrorEvent().message;
118 return ::armarx::skills::Skill::MainResult{
121 if (se.isGlobalPlanningFailedEvent())
124 << se.toGlobalPlanningFailedEvent().message;
126 return ::armarx::skills::Skill::MainResult{
131 return ::armarx::skills::Skill::MainResult{
135 return ::armarx::skills::Skill::MainResult{
140 NavigateToLocation::onStopRequested()
142 if (helper.getNavigator().has_value())
145 helper.getNavigator()->stop();
static Duration Hours(std::int64_t hours)
Constructs a duration in hours.
::armarx::skills::SimpleSpecializedSkill< Params > Base
static armarx::skills::SkillDescription DefaultSkillDescription()
NavigateToLocation(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::NavigateToLocationParams ParamType
SkillDescription description
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.
const armarx::skills::SkillID NavigateToLocation
A result struct for skill initialization.
A result struct for th main method of a skill.