22#include <armarx/navigation/skills/aron/NavigateToLocation.aron.generated.h>
29 armarx::skills::SkillDescription
34 defaultParameters.useObjectLocations =
true;
36 defaultParameters.navigateToLocation.fromAron(
38 defaultParameters.navigateToLocation.location =
"<Resolved according to 'locationName'>";
41 description <<
"Resolve a named location and navigate to it."
42 <<
"\n\n`locationName`: The location's human-readable name."
43 <<
"\n\n`minMatchRatio`: Minimum match ratio required to accept a match "
44 "between a location's name and `locationName`."
45 <<
"\n\nThe parameters `navigateToLocation` are passed to the sub skill "
46 "`NavigateToLocation`, except for `navigateToLocation.location`, which is "
47 "set to the location that `locationName` is resolved to.";
52 .rootProfileDefaults = defaultParameters.toAron(),
54 .parametersType = Params::ToAronType(),
72 NavigateToNamedLocation::main(
const Base::SpecializedMainInput& in)
76 const std::optional<ResolvedLocation> resolvedLocation =
79 .locationReader = services.locationReader,
80 .objectPoseClient = services.objectPoseClient,
81 .objectClassReader = services.objectClassReader,
83 in.parameters.minMatchRatio,
84 in.parameters.useObjectLocations);
86 if (not resolvedLocation.has_value())
88 ARMARX_ERROR <<
"Could not resolve location name '" << in.parameters.locationName
89 <<
"' to any location.";
94 <<
QUOTED(resolvedLocation->provider +
"::" + resolvedLocation->name)
101 using ParamsT = arondto::NavigateToLocationParams;
107 [&resolvedLocation, &in](ParamsT&
parameters)
noexcept
110 parameters = in.parameters.navigateToLocation;
112 parameters.location = resolvedLocation->name;
113 parameters.locationProvider =
114 resolvedLocation->provider;
static Duration Hours(std::int64_t hours)
Constructs a duration in hours.
static armarx::skills::SkillDescription DefaultSkillDescription()
::armarx::skills::SkillDescription GetSkillDescription()
::armarx::skills::SimpleSpecializedSkill< Params > Base
NavigateToNamedLocation(const Properties &properties, const Services &services)
arondto::NavigateToNamedLocationParams ParamType
std::optional< TerminatedSkillStatusUpdate > callSubskill(const SkillID &skillId)
Call a subskill with the given ID and its default parameters.
static MainResult MakeSucceededResult(aron::data::DictPtr data=nullptr)
armarx::aron::data::DictPtr parameters
SkillDescription description
void throwIfSkillShouldTerminate(const std::string &abortedMessage="") const
static MainResult MakeFailedResult(aron::data::DictPtr data=nullptr)
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
#define ARMARX_IMPORTANT
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
const armarx::skills::SkillID NavigateToNamedLocation
std::optional< ResolvedLocation > resolveLocationName(const std::string &locationName, const LocationNameResolverServices &services, const double minMatchRatio, const bool useObjectLocations)
Resolve a human-readable place onto a location, the way NavigateToNamedLocation does.
bool skillExecutionFailed(const std::optional< armarx::skills::TerminatedSkillStatusUpdate > &update)
This file offers overloads of toIce() and fromIce() functions for STL container types.
This file is part of ArmarX.
This file is part of ArmarX.
Everything needed to turn a spoken place into a location.
armarx::skills::SkillID navigateToLocation
A result struct for th main method of a skill.