Skip to content
Snippets Groups Projects
Commit 13912403 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Move code to cpp, use skill ID constant

parent 17cb8334
No related branches found
No related tags found
1 merge request!99Load location names, add NavigateToNamedLocation skill
This commit is part of merge request !99. Comments created here will be created in the context of that merge request.
......@@ -6,6 +6,8 @@
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <ArmarXCore/core/time/Duration.h>
#include <armarx/navigation/client/NavigationStackConfig.h>
#include <armarx/navigation/client/Navigator.h>
#include <armarx/navigation/client/PathBuilder.h>
......@@ -15,6 +17,7 @@
#include <armarx/navigation/client/types.h>
#include <armarx/navigation/global_planning/AStar.h>
#include <armarx/navigation/global_planning/SPFA.h>
#include <armarx/navigation/skills/skill_ids.h>
#include <armarx/navigation/trajectory_control/local/TrajectoryFollowingController.h>
namespace armarx::navigation::skills
......@@ -45,6 +48,29 @@ namespace armarx::navigation::skills
}
}
armarx::skills::SkillDescription
NavigateToLocation::DefaultSkillDescription()
{
ParamType defaultParameters;
defaultParameters.location = "";
defaultParameters.velocityLimitAngular = std::nullopt;
defaultParameters.velocityLimitLinear = std::nullopt;
std::stringstream description;
description
<< "Retrieve the location `location` from the memory and navigate to it."
<< "\n\nThe `location` is specified by its provider segment name and entity name"
" in the format `providerSegmentName/entityName` .";
return armarx::skills::SkillDescription{
.skillId = skill_ids::NavigateToLocation,
.description = description.str(),
.rootProfileDefaults = defaultParameters.toAron(),
.timeout = armarx::core::time::Duration::Days(42),
.parametersType = Params::ToAronType(),
};
}
NavigateToLocation::NavigateToLocation(const Services& srv) : Base(DefaultSkillDescription())
{
srv_.emplace(srv);
......@@ -157,7 +183,6 @@ namespace armarx::navigation::skills
}
}
return ::armarx::skills::Skill::MainResult{
.status = ::armarx::skills::TerminatedSkillStatus::Failed};
}
......@@ -172,5 +197,4 @@ namespace armarx::navigation::skills
}
}
} // namespace armarx::navigation::skills
......@@ -21,16 +21,11 @@
#pragma once
#include <ArmarXCore/core/ManagedIceObject.h>
#include <ArmarXCore/core/time/Duration.h>
#include <RobotAPI/libraries/skills/provider/SimpleSkill.h>
#include <RobotAPI/libraries/skills/provider/SimpleSpecializedSkill.h>
#include <armarx/navigation/client.h>
#include <armarx/navigation/client/services/MemorySubscriber.h>
#include <armarx/navigation/skills/aron/NavigateToLocation.aron.generated.h>
#include <armarx/navigation/skills/constants.h>
namespace armarx::navigation::skills
{
......@@ -59,20 +54,7 @@ namespace armarx::navigation::skills
public:
static armarx::skills::SkillDescription
DefaultSkillDescription()
{
ParamType defaultParameters;
defaultParameters.location = "";
defaultParameters.velocityLimitAngular = std::nullopt;
defaultParameters.velocityLimitLinear = std::nullopt;
return armarx::skills::SkillDescription{
.skillId = {.skillName = constants::skill_names::NavigateToLocation},
.description = "",
.rootProfileDefaults = defaultParameters.toAron(),
.timeout = armarx::core::time::Duration::Days(42),
.parametersType = Params::ToAronType()};
}
static armarx::skills::SkillDescription DefaultSkillDescription();
protected:
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment