|
Base class for skills. More...
#include <RobotAPI/libraries/skills/core/Skill.h>
Classes | |
struct | ExitResult |
A result struct for skill exit function. More... | |
struct | InitResult |
A result struct for skill initialization. More... | |
struct | MainResult |
A result struct for th main method of a skill. More... | |
struct | PrepareResult |
A result struct for skill preparing. More... | |
Public Types | |
using | CallbackT = std::function< void(const SkillStatus s, const armarx::aron::data::DictPtr &)> |
Public Member Functions | |
ExitResult | exitSkill () |
Exit method of a skill. More... | |
aron::data::DictPtr | getParameters () const |
Get the parameters of a skill that have been set so far. More... | |
SkillDescription | getSkillDescription () const |
Get the description of a skill. More... | |
SkillID | getSkillId () const |
Get the id of the skill. More... | |
InitResult | initSkill () |
Initialization of a skill. More... | |
MainResult | mainOfSkill () |
Main method of a skill. More... | |
void | notifySkillToStop () |
Notify the skill from extern to stop. More... | |
PrepareResult | prepareSkill () |
Prepare a skill once. More... | |
void | setCallback (const CallbackT &callback) |
void | setExecutorName (const std::string &executorName) |
void | setManager (const manager::dti::SkillManagerInterfacePrx &manager) |
void | setParameters (const aron::data::DictPtr &d) |
Hard set the parameters, ignoring everything that has been set or merged before. More... | |
void | setProviderId (const skills::ProviderID &pid) |
Set the provider id of the description of the skill. More... | |
bool | shouldSkillTerminate () const |
Returns whether the skill should terminate as soon as possible. More... | |
Skill ()=delete | |
We completely remove the default constructor! A skill without a desciption cannot exist. More... | |
Skill (const SkillDescription &) | |
Constructor of a skill for inheritance. Every skill must have a skill description. More... | |
void | updateParameters (const aron::data::DictPtr &d) |
Merge parameters to the local parameters of the skill. More... | |
virtual | ~Skill () |
Virtual destructor of a skill. More... | |
Public Member Functions inherited from Logging | |
SpamFilterDataPtr | deactivateSpam (float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const |
disables the logging for the current line for the given amount of seconds. More... | |
MessageTypeT | getEffectiveLoggingLevel () const |
Logging () | |
void | setLocalMinimumLoggingLevel (MessageTypeT level) |
With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set. More... | |
void | setTag (const LogTag &tag) |
void | setTag (const std::string &tagName) |
virtual | ~Logging () |
Public Attributes | |
armarx::core::time::DateTime | exited = armarx::core::time::DateTime::Invalid() |
armarx::core::time::DateTime | started = armarx::core::time::DateTime::Now() |
Protected Member Functions | |
std::optional< TerminatedSkillStatusUpdate > | callSubskill (const SkillID &skillId) |
Call a subskill with the given ID and its default parameters. More... | |
std::optional< TerminatedSkillStatusUpdate > | callSubskill (const SkillID &skillId, const aron::data::DictPtr ¶meters) |
Call a subskill with the given ID and parameters. More... | |
template<class ParameterT > | |
std::optional< TerminatedSkillStatusUpdate > | callSubskill (const SkillID &skillId, const ParameterT ¶meters) |
Call a subskill with the given ID and parameters. More... | |
std::optional< TerminatedSkillStatusUpdate > | callSubskill (const SkillID &skillId, std::function< void(aron::data::DictPtr ¶meters)> parametersFunction) |
Call a subskill with parameters based on the default parameters. More... | |
template<class ParameterT > | |
std::optional< TerminatedSkillStatusUpdate > | callSubskill (const SkillID &skillId, std::function< void(ParameterT ¶meters)> parametersFunction) |
Call a subskill with parameters based on the default parameters. More... | |
std::optional< TerminatedSkillStatusUpdate > | callSubskill (const skills::SkillProxy &proxy) |
Call a subskill with default parameters and block until the subskill terminates. More... | |
std::optional< TerminatedSkillStatusUpdate > | callSubskill (const skills::SkillProxy &proxy, const aron::data::DictPtr ¶meters) |
Call a subskill with given parameters and block until the subskill terminates. More... | |
skills::SkillExecutionID | callSubskillAsync (const skills::SkillProxy &proxy) |
Similar to callSubskill but non-blocking. More... | |
skills::SkillExecutionID | callSubskillAsync (const skills::SkillProxy &proxy, const aron::data::DictPtr ¶meters) |
Similar to callSubskill but non-blocking. More... | |
virtual ExitResult | exit () |
Override this method with the actual implementation. More... | |
virtual InitResult | init () |
Override this method with the actual implementation. More... | |
void | installConditionWithCallback (std::function< bool()> &&f, std::function< void()> &&cb) |
install a condition which is frequently checked from the conditionCheckingThread More... | |
virtual MainResult | main () |
Override this method with the actual implementation. The callback is for status updates to the calling instance. More... | |
void | notifyTimeoutReached () |
virtual void | onStopRequested () |
virtual void | onTimeoutReached () |
Override these methods if you want to do something special when notification comes. More... | |
virtual PrepareResult | prepare () |
Override this method with the actual implementation. More... | |
void | throwIfSkillShouldTerminate (const std::function< void()> &do_before, const std::string &abortedMessage="") |
void | throwIfSkillShouldTerminate (const std::string &abortedMessage="") |
Protected Member Functions inherited from Logging | |
bool | checkLogLevel (MessageTypeT level) const |
const LogSenderPtr & | getLogSender () const |
Retrieve log sender. More... | |
LogSenderPtr | loghelper (const char *file, int line, const char *function) const |
Static Protected Member Functions | |
static MainResult | MakeAbortedResult () |
static MainResult | MakeFailedResult () |
static MainResult | MakeSucceededResult (aron::data::DictPtr data=nullptr) |
Protected Attributes | |
CallbackT | callback = CallbackT() |
std::atomic_bool | constructing = true |
SkillDescription | description |
std::string | executorName = "" |
std::atomic_bool | exiting = false |
std::atomic_bool | finished = false |
std::atomic_bool | initializing = false |
manager::dti::SkillManagerInterfacePrx | manager = nullptr |
armarx::aron::data::DictPtr | parameters = nullptr |
std::mutex | parametersMutex |
std::atomic_bool | preparing = false |
std::atomic_bool | running = false |
std::atomic_bool | stopped = false |
std::atomic_bool | timeoutReached = false |
Protected Attributes inherited from Logging | |
MessageTypeT | minimumLoggingLevel |
SpamFilterDataPtr | spamFilter |
LogTag | tag |
using CallbackT = std::function<void(const SkillStatus s, const armarx::aron::data::DictPtr&)> |
|
delete |
We completely remove the default constructor! A skill without a desciption cannot exist.
Skill | ( | const SkillDescription & | desc | ) |
|
inlinevirtual |
|
protected |
Call a subskill with the given ID and its default parameters.
skillId | The subskill's ID. |
armarx::skills::error::SkillAbortedException | If the calling skill has been aborted. |
armarx::skills::error::SkillFailedException | If the calling skill's timeout was reached. |
|
protected |
Call a subskill with the given ID and parameters.
skillId | The subskill's ID. |
parameters | The parameters. |
armarx::skills::error::SkillAbortedException | If the calling skill has been aborted. |
armarx::skills::error::SkillFailedException | If the calling skill's timeout was reached. |
|
inlineprotected |
Call a subskill with the given ID and parameters.
skillId | The subskill's ID. |
parameters | The parameters. |
armarx::skills::error::SkillAbortedException | If the calling skill has been aborted. |
armarx::skills::error::SkillFailedException | If the calling skill's timeout was reached. |
Definition at line 260 of file Skill.h.
|
protected |
Call a subskill with parameters based on the default parameters.
Creates the skill's default parameters, and calls parametersFunction
on them. This allows the caller to modify the parameters before executing the skill.
skillId | The subskill's ID. |
parametersFunction | Function which edits the parameters. |
armarx::skills::error::SkillAbortedException | If the calling skill has been aborted. |
armarx::skills::error::SkillFailedException | If the calling skill's timeout was reached. |
|
inlineprotected |
Call a subskill with parameters based on the default parameters.
Creates the skill's default parameters, converts them to ParameterT
, and calls parametersFunction
on them. This allows the caller to modify the parameters as ParameterT
before executing the skill.
skillId | The subskill's ID. |
parametersFunction | Function which edits the parameters. |
armarx::skills::error::SkillAbortedException | If the calling skill has been aborted. |
armarx::skills::error::SkillFailedException | If the calling skill's timeout was reached. |
Definition at line 301 of file Skill.h.
|
protected |
Call a subskill with default parameters and block until the subskill terminates.
If you call a subskill this way it will be stopped if the current skill stops.
proxy | Skill proxy. |
armarx::skills::error::SkillAbortedException | If the calling skill has been aborted. |
armarx::skills::error::SkillFailedException | If the calling skill's timeout was reached. |
Definition at line 22 of file Skill.cpp.
|
protected |
Call a subskill with given parameters and block until the subskill terminates.
proxy | Skill proxy. |
parameters | Parameters passed to the skill. |
armarx::skills::error::SkillAbortedException | If the calling skill has been aborted. |
armarx::skills::error::SkillFailedException | If the calling skill's timeout was reached. |
Definition at line 28 of file Skill.cpp.
|
protected |
|
protected |
|
protectedvirtual |
Override this method with the actual implementation.
Reimplemented in SimpleSpecializedSkill< AronT >, SimpleSpecializedSkill< skills::Example::HelloWorldAcceptedType >, SimpleSpecializedSkill< arondto::PointAtParams >, SimpleSpecializedSkill< joint_control::arondto::MoveJointsWithVelocityAcceptedType >, SimpleSpecializedSkill< visual_search::arondto::WhatCanYouSeeNowAcceptedType >, SimpleSpecializedSkill< arondto::MoveJointsToNamedConfigurationParams >, SimpleSpecializedSkill< grasp_object::arondto::ExecuteGraspAcceptedType >, SimpleSpecializedSkill< armarx::control::skills::params::ZeroTorque >, SimpleSpecializedSkill< grasp_object::arondto::OpenHandAndDetachAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformForPutdownAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::CloseHandAndAttachAcceptedType >, SimpleSpecializedSkill< arondto::NavigateToLocationParams >, SimpleSpecializedSkill< arondto::BringObjectToLandmarkAcceptedType >, SimpleSpecializedSkill< arondto::NavigateToParams >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformAfterGraspAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformAfterPutdownAcceptedType >, SimpleSpecializedSkill< hand_control::arondto::OpenHandAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::PutdownObjectAcceptedType >, SimpleSpecializedSkill< platform_control::arondto::MovePlatformToPoseAcceptedType >, SimpleSpecializedSkill< arondto::NavigateToNamedLocationParams >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformForGraspAcceptedType >, SimpleSpecializedSkill< arondto::GuideHumanToRoomParams >, SimpleSpecializedSkill< RetrieveHandParams >, SimpleSpecializedSkill< arondto::RelaxHandParams >, SimpleSpecializedSkill< arondto::MoveJointsWithVelocityParams >, SimpleSpecializedSkill< arondto::NavigateToChargingStationParams >, SimpleSpecializedSkill< arondto::MoveJointsToPositionParams >, SimpleSpecializedSkill< skills::Example::RecursiveSkillParams >, SimpleSpecializedSkill< platform_control::arondto::MovePlatformToLandmarkAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::GraspObjectAcceptedType >, SimpleSpecializedSkill< hand_control::arondto::CloseHandAcceptedType >, SimpleSpecializedSkill< arondto::ExecuteTrajectoryParams >, SimpleSpecializedSkill< arondto::FollowerParams >, SimpleSpecializedSkill< grasp_object::arondto::ExecutePutdownAcceptedType >, SimpleSpecializedSkill< arondto::NamedConfigurationParams >, and SimpleSkill.
Skill::ExitResult exitSkill | ( | ) |
aron::data::DictPtr getParameters | ( | ) | const |
|
inline |
|
inline |
|
protectedvirtual |
Override this method with the actual implementation.
Reimplemented in SimpleSpecializedSkill< AronT >, SimpleSpecializedSkill< skills::Example::HelloWorldAcceptedType >, SimpleSpecializedSkill< arondto::PointAtParams >, SimpleSpecializedSkill< joint_control::arondto::MoveJointsWithVelocityAcceptedType >, SimpleSpecializedSkill< visual_search::arondto::WhatCanYouSeeNowAcceptedType >, SimpleSpecializedSkill< arondto::MoveJointsToNamedConfigurationParams >, SimpleSpecializedSkill< grasp_object::arondto::ExecuteGraspAcceptedType >, SimpleSpecializedSkill< armarx::control::skills::params::ZeroTorque >, SimpleSpecializedSkill< grasp_object::arondto::OpenHandAndDetachAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformForPutdownAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::CloseHandAndAttachAcceptedType >, SimpleSpecializedSkill< arondto::NavigateToLocationParams >, SimpleSpecializedSkill< arondto::BringObjectToLandmarkAcceptedType >, SimpleSpecializedSkill< arondto::NavigateToParams >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformAfterGraspAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformAfterPutdownAcceptedType >, SimpleSpecializedSkill< hand_control::arondto::OpenHandAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::PutdownObjectAcceptedType >, SimpleSpecializedSkill< platform_control::arondto::MovePlatformToPoseAcceptedType >, SimpleSpecializedSkill< arondto::NavigateToNamedLocationParams >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformForGraspAcceptedType >, SimpleSpecializedSkill< arondto::GuideHumanToRoomParams >, SimpleSpecializedSkill< RetrieveHandParams >, SimpleSpecializedSkill< arondto::RelaxHandParams >, SimpleSpecializedSkill< arondto::MoveJointsWithVelocityParams >, SimpleSpecializedSkill< arondto::NavigateToChargingStationParams >, SimpleSpecializedSkill< arondto::MoveJointsToPositionParams >, SimpleSpecializedSkill< skills::Example::RecursiveSkillParams >, SimpleSpecializedSkill< platform_control::arondto::MovePlatformToLandmarkAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::GraspObjectAcceptedType >, SimpleSpecializedSkill< hand_control::arondto::CloseHandAcceptedType >, SimpleSpecializedSkill< arondto::ExecuteTrajectoryParams >, SimpleSpecializedSkill< arondto::FollowerParams >, SimpleSpecializedSkill< grasp_object::arondto::ExecutePutdownAcceptedType >, SimpleSpecializedSkill< arondto::NamedConfigurationParams >, and SimpleSkill.
Skill::InitResult initSkill | ( | ) |
|
protected |
|
protectedvirtual |
Override this method with the actual implementation. The callback is for status updates to the calling instance.
Reimplemented in SimpleSpecializedSkill< AronT >, SimpleSpecializedSkill< skills::Example::HelloWorldAcceptedType >, SimpleSpecializedSkill< arondto::PointAtParams >, SimpleSpecializedSkill< joint_control::arondto::MoveJointsWithVelocityAcceptedType >, SimpleSpecializedSkill< visual_search::arondto::WhatCanYouSeeNowAcceptedType >, SimpleSpecializedSkill< arondto::MoveJointsToNamedConfigurationParams >, SimpleSpecializedSkill< grasp_object::arondto::ExecuteGraspAcceptedType >, SimpleSpecializedSkill< armarx::control::skills::params::ZeroTorque >, SimpleSpecializedSkill< grasp_object::arondto::OpenHandAndDetachAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformForPutdownAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::CloseHandAndAttachAcceptedType >, SimpleSpecializedSkill< arondto::NavigateToLocationParams >, SimpleSpecializedSkill< arondto::BringObjectToLandmarkAcceptedType >, SimpleSpecializedSkill< arondto::NavigateToParams >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformAfterGraspAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformAfterPutdownAcceptedType >, SimpleSpecializedSkill< hand_control::arondto::OpenHandAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::PutdownObjectAcceptedType >, SimpleSpecializedSkill< platform_control::arondto::MovePlatformToPoseAcceptedType >, SimpleSpecializedSkill< arondto::NavigateToNamedLocationParams >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformForGraspAcceptedType >, SimpleSpecializedSkill< arondto::GuideHumanToRoomParams >, SimpleSpecializedSkill< RetrieveHandParams >, SimpleSpecializedSkill< arondto::RelaxHandParams >, SimpleSpecializedSkill< arondto::MoveJointsWithVelocityParams >, SimpleSpecializedSkill< arondto::NavigateToChargingStationParams >, SimpleSpecializedSkill< arondto::MoveJointsToPositionParams >, SimpleSpecializedSkill< skills::Example::RecursiveSkillParams >, SimpleSpecializedSkill< platform_control::arondto::MovePlatformToLandmarkAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::GraspObjectAcceptedType >, SimpleSpecializedSkill< hand_control::arondto::CloseHandAcceptedType >, SimpleSpecializedSkill< arondto::ExecuteTrajectoryParams >, SimpleSpecializedSkill< arondto::FollowerParams >, SimpleSpecializedSkill< grasp_object::arondto::ExecutePutdownAcceptedType >, SimpleSpecializedSkill< arondto::NamedConfigurationParams >, PeriodicSpecializedSkill< AronT >, PeriodicSkill, and SimpleSkill.
Skill::MainResult mainOfSkill | ( | ) |
|
staticprotected |
|
staticprotected |
|
staticprotected |
void notifySkillToStop | ( | ) |
|
protectedvirtual |
Reimplemented in RetrieveHand, and PointAt.
|
protectedvirtual |
|
protectedvirtual |
Skill::PrepareResult prepareSkill | ( | ) |
|
inline |
|
inline |
void setParameters | ( | const aron::data::DictPtr & | d | ) |
|
inline |
bool shouldSkillTerminate | ( | ) | const |
|
protected |
|
protected |
void updateParameters | ( | const aron::data::DictPtr & | d | ) |
|
protected |
|
protected |
|
protected |