Go to the documentation of this file.
109 const std::string& abortedMessage =
"");
125 void _onTimeoutReached();
126 void _onStopRequested();
149 std::function<
void()>&& cb);
165 std::optional<TerminatedSkillStatusUpdate>
178 std::optional<TerminatedSkillStatusUpdate>
214 std::optional<TerminatedSkillStatusUpdate>
227 template <
class ParameterT>
228 std::optional<TerminatedSkillStatusUpdate>
248 std::optional<TerminatedSkillStatusUpdate>
268 template <
class ParameterT>
269 std::optional<TerminatedSkillStatusUpdate>
271 std::function<
void(ParameterT&
parameters)> parametersFunction)
278 parameters = ParameterT::FromAron(parametersAron);
286 template <
class ParameterT>
287 std::optional<TerminatedSkillStatusUpdate>
289 std::function<
void(ParameterT&
parameters)> parametersFunction)
296 parameters = ParameterT::FromAron(parametersAron);
314 manager::dti::SkillManagerInterfacePrx
manager =
nullptr;
340 mutable std::mutex conditionCallbacksMutex;
341 std::vector<std::pair<std::function<bool()>, std::function<void()>>>
342 conditionCallbacks = {};
344 std::thread conditionCheckingThread;
347 mutable std::mutex subskillsMutex;
348 std::vector<skills::SkillExecutionID> subskills;
aron::data::DictPtr getParameters() const
Get the parameters of a skill that have been set so far.
ExitResult exitSkill()
Exit method of a skill.
aron::data::DictPtr getRootProfileParameters() const
get the default parameters of the skill. TODO: Skill profiles in memory!
std::atomic_bool constructing
void setParameters(const aron::data::DictPtr &d)
Hard set the parameters, ignoring everything that has been set or merged before.
TerminatedSkillStatus status
void notifySkillToStop()
Notify the skill from extern to stop.
manager::dti::SkillManagerInterfacePrx manager
This file is part of ArmarX.
void updateParameters(const aron::data::DictPtr &d)
Merge parameters to the local parameters of the skill.
virtual PrepareResult prepare()
Override this method with the actual implementation.
A result struct for skill preparing.
armarx::aron::data::DictPtr parameters
Skill()=delete
We completely remove the default constructor! A skill without a desciption cannot exist.
virtual void onStopRequested()
std::atomic_bool preparing
void setExecutorName(const std::string &executorName)
SkillDescription getSkillDescription() const
Get the description of a skill.
std::optional< TerminatedSkillStatusUpdate > callSubskill(const SkillID &skillId, std::function< void(ParameterT ¶meters)> parametersFunction)
Call a subskill with parameters based on the default parameters.
void setCallback(const CallbackT &callback)
std::function< void(const SkillStatus s, const armarx::aron::data::DictPtr &)> CallbackT
skills::SkillExecutionID callSubskillAsync(const skills::SkillProxy &proxy)
Similar to callSubskill but non-blocking.
std::atomic_bool timeoutReached
std::optional< TerminatedSkillStatusUpdate > callSubskill(const skills::SkillProxy &proxy)
Call a subskill with default parameters and block until the subskill terminates.
virtual void onTimeoutReached()
Override these methods if you want to do something special when notification comes.
virtual InitResult init()
Override this method with the actual implementation.
void installConditionWithCallback(std::function< bool()> &&f, std::function< void()> &&cb)
install a condition which is frequently checked from the conditionCheckingThread
ActiveOrTerminatedSkillStatus status
static MainResult MakeFailedResult()
ActiveOrTerminatedSkillStatus
std::shared_ptr< Value > value()
void notifyTimeoutReached()
InitResult initSkill()
Initialization of a skill.
std::atomic_bool finished
std::mutex parametersMutex
SkillDescription description
MainResult mainOfSkill()
Main method of a skill.
armarx::core::time::DateTime started
static MainResult MakeAbortedResult()
static MainResult MakeSucceededResult(aron::data::DictPtr data=nullptr)
A result struct for th main method of a skill.
std::atomic_bool initializing
void setProviderId(const skills::ProviderID &pid)
Set the provider id of the description of the skill.
std::optional< TerminatedSkillStatusUpdate > callSubskillAsync(const SkillID &skillId, std::function< void(ParameterT ¶meters)> parametersFunction)
A result struct for skill exit function.
virtual ExitResult exit()
Override this method with the actual implementation.
Represents a point in time.
std::shared_ptr< Dict > DictPtr
TerminatedSkillStatus status
std::optional< TerminatedSkillStatusUpdate > callSubskill(const SkillID &skillId, const ParameterT ¶meters)
Call a subskill with the given ID and parameters.
Base Class for all Logging classes.
TerminatedSkillStatus status
bool shouldSkillTerminate() const
Returns whether the skill should terminate as soon as possible.
A result struct for skill initialization.
virtual MainResult main()
Override this method with the actual implementation. The callback is for status updates to the callin...
static Frequency Hertz(std::int64_t hertz)
void throwIfSkillShouldTerminate(const std::string &abortedMessage="")
PrepareResult prepareSkill()
Prepare a skill once.
void setManager(const manager::dti::SkillManagerInterfacePrx &manager)
virtual ~Skill()
Virtual destructor of a skill.
double s(double t, double s0, double v0, double a0, double j)
static DateTime Invalid()
This file offers overloads of toIce() and fromIce() functions for STL container types.
SkillID getSkillId() const
Get the id of the skill.
armarx::core::time::DateTime exited