Skip to content
Snippets Groups Projects
Commit 4a026fa1 authored by Fabian Tërnava's avatar Fabian Tërnava
Browse files

allow to execute a skill from an unknown provider (first matching)

parent 9ef9796e
No related branches found
No related tags found
1 merge request!286skill provider usability updates
......@@ -140,8 +140,15 @@ namespace armarx
skills::provider::dto::Execution::Status SkillsMemory::executeSkill(const skills::manager::dto::SkillExecutionRequest& info, const Ice::Current &current)
{
skillExecutionRequestCoreSegment.addSkillExecutionRequest(info);
return SkillManagerComponentPluginUser::executeSkill(info, current);
skills::manager::dto::SkillExecutionRequest requestCopy = info;
if (requestCopy.providerName == "*")
{
// sanitize the provider name if set to 'any'
requestCopy.providerName = getFirstProviderNameThatHasSkill(requestCopy.skillName);
}
skillExecutionRequestCoreSegment.addSkillExecutionRequest(requestCopy);
return SkillManagerComponentPluginUser::executeSkill(requestCopy, current);
}
void SkillsMemory::updateStatusForSkill(const skills::provider::dto::SkillStatusUpdate& update, const Ice::Current &current)
......
......@@ -263,7 +263,12 @@ namespace armarx
auto data = getConfigAsAron();
char hostname[HOST_NAME_MAX];
gethostname(hostname, HOST_NAME_MAX);
skills::manager::dto::SkillExecutionRequest exInfo;
exInfo.clientId = "Skills.Manager GUI (hostname: " + std::string(hostname) + ")";
exInfo.providerName = selectedSkill.providerName;
exInfo.skillName = selectedSkill.skillName;
exInfo.params = aron::data::Dict::ToAronDictDTO(data);
......
......@@ -22,7 +22,6 @@
#pragma once
//#include <RobotAPI/interface/skills/SkillProviderCallbackInterface.ice>
#include <RobotAPI/interface/skills/SkillProviderInterface.ice>
module armarx
......@@ -36,9 +35,10 @@ module armarx
// Inputs
struct SkillExecutionRequest
{
string providerName;
string skillName;
aron::data::dto::Dict params;
string clientId; // Who called the request
string providerName; // execute skill of which provider? can be '*'
string skillName; // the name of the skill to call. Must be set
aron::data::dto::Dict params; // the parameters for the skill. Can be nullptr if the skill does not require parameters
};
struct ProviderInfo
{
......
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