Skip to content
Snippets Groups Projects
Commit 15e3a9f9 authored by Julian Tusch's avatar Julian Tusch :no_entry_sign:
Browse files

first draft

parent ba3be354
No related branches found
No related tags found
3 merge requests!460Draft: fluxio/dev-skill-timeout,!449Fluxio preliminary release,!446Draft: Fluxio related changes
Pipeline #18572 failed
......@@ -56,6 +56,26 @@ module armarx
dictionary<SkillID, dto::SkillDescription> SkillDescriptionMap;
// struct Identificator
// {
// string id;
// string hint;
// };
struct FluxioSkill
{
string id;
string name;
string description;
string last_changed;
bool executable;
bool native;
//Identificator skill_provider_id;
string skill_provider_id;
};
dictionary<SkillID, dto::FluxioSkill> SkillList;
struct ProviderInfo
{
ProviderID providerId;
......@@ -107,8 +127,11 @@ module armarx
dto::SkillDescriptionMap
getSkillDescriptions(); // get all skilldescriptions from all providers
dto::SkillList
getSkillList(); // get all skills from all providers
optional(2) dto::SkillStatusUpdate
getSkillExecutionStatus(dto::SkillExecutionID executionId);
getSkillExecutionStatus(dto::SkillExecutionID executionId);
dto::SkillStatusUpdateMap
getSkillExecutionStatuses(); // returns the current executions from all providers
......
......@@ -26,6 +26,7 @@ armarx_add_library(
Skill.cpp
SkillProxy.cpp
SkillDescription.cpp
FluxioSkill.cpp
HEADERS
error/Exception.h
SkillID.h
......@@ -39,6 +40,7 @@ armarx_add_library(
Skill.h
SkillProxy.h
SkillDescription.h
FluxioSkill.h
)
add_library(RobotAPI::skills::core ALIAS RobotAPISkillsCore)
#pragma once
#include <string>
#include <RobotAPI/interface/skills/SkillManagerInterface.h>
namespace armarx
{
namespace skills
{
struct FluxioSkill
{
std::string id;
std::string name;
std::string description;
std::string last_changed;
bool executable;
bool native;
std::string skill_provider_id;
manager::dto::FluxioSkill toManagerIce() const;
//static FluxioSkill FromIce(const manager::dto::FluxioSkill& i);
};
} // namespace skills
} // namespace armarx
\ No newline at end of file
......@@ -454,6 +454,33 @@ namespace armarx::plugins
return ret;
}
std::map<skills::SkillID, skills::FluxioSkill>
SkillManagerComponentPlugin::getSkillList()
{
std::map<skills::SkillID, skills::FluxioSkill> ret;
std::map<skills::SkillID, skills::SkillDescription> skillDescriptions = getSkillDescriptions();
for (const auto& [skillId, skillDescription] : skillDescriptions)
{
skills::FluxioSkill s;
s.id = skillId.skillName;
s.name = s.id;
s.description = skillDescription.description;
s.last_changed = "";
s.executable = false;
s.native = true;
s.skill_provider_id = (skillId.providerId && skillId.providerId.has_value()) ? skillId.providerId.value().providerName : "";
ret.insert({
skillId,
s
});
}
return ret;
}
std::optional<skills::SkillStatusUpdate>
SkillManagerComponentPlugin::getSkillExecutionStatus(
const skills::SkillExecutionID& executionId)
......@@ -676,6 +703,21 @@ namespace armarx
return {};
}
skills::manager::dto::SkillList
SkillManagerComponentPluginUser::getSkillList(const Ice::Current& current)
{
skills::manager::dto::SkillList ret;
auto l = this->plugin->getSkillList();
for (const auto& [k, v] : l)
{
ret.insert({k.toManagerIce(), v.toManagerIce()});
}
return ret;
}
IceUtil::Optional<skills::manager::dto::SkillStatusUpdate>
SkillManagerComponentPluginUser::getSkillExecutionStatus(
const skills::manager::dto::SkillExecutionID& executionId,
......
#pragma once
#include <mutex>
#include <list>
#include <ArmarXCore/core/ComponentPlugin.h>
#include <ArmarXCore/core/ManagedIceObject.h>
#include <RobotAPI/libraries/skills/core/FluxioSkill.h>
#include <RobotAPI/interface/skills/SkillManagerInterface.h>
#include <RobotAPI/libraries/skills/core/ProviderID.h>
#include <RobotAPI/libraries/skills/core/ProviderInfo.h>
......@@ -48,6 +49,8 @@ namespace armarx::plugins
std::map<skills::SkillID, skills::SkillDescription> getSkillDescriptions();
std::map<skills::SkillID, skills::FluxioSkill> getSkillList();
std::optional<skills::SkillStatusUpdate>
getSkillExecutionStatus(const skills::SkillExecutionID& id);
......@@ -113,6 +116,9 @@ namespace armarx
getSkillDescription(const skills::manager::dto::SkillID& id,
const Ice::Current& current) override;
skills::manager::dto::SkillList
getSkillList(const Ice::Current& current) override;
IceUtil::Optional<skills::manager::dto::SkillStatusUpdate>
getSkillExecutionStatus(const skills::manager::dto::SkillExecutionID& executionId,
const Ice::Current& current) override;
......
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