8#include <unordered_map>
15#include <RobotAPI/interface/skills/SkillManagerInterface.h>
35 std::scoped_lock l{callbackMutex};
44 std::scoped_lock l{callbackMutex};
51 std::scoped_lock l{callbackMutex};
52 for (
auto& [
id, cb] : callbacks)
59 std::mutex callbackMutex;
60 std::unordered_map<CallbackID, Callback> callbacks;
106 std::optional<TerminatedSkillStatusUpdate>
123 std::optional<SkillStatusUpdate>
127 manager::dti::SkillManagerInterfacePrx
manager;
static Duration Seconds(std::int64_t seconds)
Constructs a duration in seconds.
static Frequency Hertz(std::int64_t hertz)
Base Class for all Logging classes.
TerminatedSkillStatusUpdate executeSkill(const std::string &executorName, const aron::data::DictPtr ¶ms=nullptr) const
execute a skill and block until skill terminates
SkillExecutionID executeSkillAsync(const std::string &executorName, const aron::data::DictPtr ¶ms=nullptr) const
execute a skill. Do not block during execution
SkillProxy & operator=(const SkillProxy &)=delete
SkillDescription skillDescription
std::optional< TerminatedSkillStatusUpdate > join(const SkillExecutionID &executionId, armarx::Duration max_wait_time=armarx::Duration::Seconds(1), armarx::Frequency check_frequency=armarx::Frequency::Hertz(20)) const
poll execution status and block until its null or terminated
manager::dti::SkillManagerInterfacePrx manager
std::unordered_map< std::string, SkillStatusUpdate > lastUpdates
std::optional< SkillStatusUpdate > getExecutionStatus(const SkillExecutionID &executionId) const
SkillProxy()=delete
We remove the default constructor as every skill proxy requires a manager.
bool abortSkillAsync(const SkillExecutionID &executionId) const
ask skill to abort ASAP
bool abortSkill(const SkillExecutionID &executionId) const
ask skill to abort ASAP. Blocks until skill stopped
SkillID getSkillId() const
get the skill id from the skill description
SkillProxy(const SkillProxy &)=delete
copy ctor
aron::data::DictPtr getRootProfileParameters() const
get the default parameters of the skill. TODO: Skill profiles in memory!
void updateSubSkillStatus(const skills::SkillStatusUpdate &statusUpdate)
std::mutex lastUpdatesMutex
SkillDescription getSkillDescription() const
get the skill description
SkillUpdateManager::CallbackID callbackId
std::function< void(const skills::SkillStatusUpdate &)> Callback
void removeCallback(CallbackID id)
CallbackID addCallback(Callback cb)
void update(const skills::SkillStatusUpdate &statusUpdate)
std::shared_ptr< Dict > DictPtr
This file is part of ArmarX.
SkillUpdateManager GlobalSkillUpdateManager
This file offers overloads of toIce() and fromIce() functions for STL container types.