Skill Class Reference

Base class for skills. More...

#include <RobotAPI/libraries/skills/core/Skill.h>

Inherits Logging, and SkillExecutorInterface.

Inherited by SpecializedSkill< arondto::CloseHandParams >, SpecializedSkill< arondto::ExecuteTrajectoryParams >, SpecializedSkill< arondto::GuidingWithCollAvoidanceParams >, SpecializedSkill< arondto::MoveJointsToNamedConfigurationParams >, SpecializedSkill< arondto::MoveJointsToPositionParams >, SpecializedSkill< arondto::MoveJointsWithVelocityParams >, SpecializedSkill< arondto::OpenHandParams >, SpecializedSkill< arondto::RelaxHandParams >, SpecializedSkill< arondto::ShapeHandParams >, SpecializedSkill< arondto::SwitchCoordinationModeParams >, SpecializedSkill< armarx::control::skills::params::ZeroTorque >, SpecializedSkill< arondto::NamedConfigurationParams >, SpecializedSkill< arondto::FollowerParams >, SpecializedSkill< arondto::GuideHumanToRoomParams >, SpecializedSkill< arondto::NavigateToParams >, SpecializedSkill< arondto::NavigateToAlternativesParams >, SpecializedSkill< arondto::NavigateToChargingStationParams >, SpecializedSkill< arondto::NavigateToLocationParams >, SpecializedSkill< arondto::NavigateToNamedLocationParams >, SpecializedSkill< arondto::RotateTowardsLocationParams >, SpecializedSkill< arondto::BringObjectToLandmarkAcceptedType >, SpecializedSkill< hand_control::arondto::CloseHandAcceptedType >, SpecializedSkill< grasp_object::arondto::CloseHandAndAttachAcceptedType >, SpecializedSkill< grasp_object::arondto::ExecuteGraspAcceptedType >, SpecializedSkill< grasp_object::arondto::ExecutePutdownAcceptedType >, SpecializedSkill< grasp_object::arondto::GraspObjectAcceptedType >, SpecializedSkill< joint_control::arondto::MoveJointsWithVelocityAcceptedType >, SpecializedSkill< grasp_object::arondto::MovePlatformAfterGraspAcceptedType >, SpecializedSkill< grasp_object::arondto::MovePlatformAfterPutdownAcceptedType >, SpecializedSkill< grasp_object::arondto::MovePlatformForGraspAcceptedType >, SpecializedSkill< grasp_object::arondto::MovePlatformForPutdownAcceptedType >, SpecializedSkill< platform_control::arondto::MovePlatformToLandmarkAcceptedType >, SpecializedSkill< platform_control::arondto::MovePlatformToPoseAcceptedType >, SpecializedSkill< hand_control::arondto::OpenHandAcceptedType >, SpecializedSkill< grasp_object::arondto::OpenHandAndDetachAcceptedType >, SpecializedSkill< grasp_object::arondto::PutdownObjectAcceptedType >, SpecializedSkill< visual_search::arondto::WhatCanYouSeeNowAcceptedType >, SpecializedSkill< skills::Example::ChainingAsyncSkillParams >, SpecializedSkill< skills::Example::ChainingSkillParams >, SpecializedSkill< skills::Example::DataPassingParams >, SpecializedSkill< skills::Example::HelloWorldAcceptedType >, SpecializedSkill< skills::Example::RecursiveSkillParams >, SpecializedSkill< armarx::skills::Example::SleepAcceptedType >, SpecializedSkill< arondto::LookAtParams >, SpecializedSkill< arondto::LookAtArticulatedObjectFrameParams >, SpecializedSkill< arondto::LookAtHumanFaceParams >, SpecializedSkill< arondto::LookAtHumanHandParams >, SpecializedSkill< arondto::LookAtObjectParams >, SpecializedSkill< arondto::LookDirectionParams >, SpecializedSkill< arondto::LookForObjectsParams >, SpecializedSkill< arondto::ResetGazeTargetsParams >, SpecializedSkill< arondto::ScanLocationParams >, SpecializedSkill< arondto::ScanLocationsForObjectParams >, SpecializedSkill< arondto::SetCustomGazeTargetParams >, LambdaSkill, PeriodicSkill, SimpleSkill, and SpecializedSkill< AronT >.

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
 

Public Member Functions

std::optional< TerminatedSkillStatusUpdatecallSubskill (const SkillID &skillId)
 Call a subskill with the given ID and its default parameters.
 
std::optional< TerminatedSkillStatusUpdatecallSubskill (const SkillID &skillId, const aron::data::DictPtr &parameters)
 Call a subskill with the given ID and parameters.
 
template<class ParameterT>
std::optional< TerminatedSkillStatusUpdatecallSubskill (const SkillID &skillId, const ParameterT &parameters)
 Call a subskill with the given ID and parameters.
 
std::optional< TerminatedSkillStatusUpdatecallSubskill (const SkillID &skillId, std::function< void(aron::data::DictPtr &parameters)> parametersFunction)
 Call a subskill with parameters based on the default parameters.
 
template<class ParameterT>
std::optional< TerminatedSkillStatusUpdatecallSubskill (const SkillID &skillId, std::function< void(ParameterT &parameters)> parametersFunction)
 Call a subskill with parameters based on the default parameters.
 
std::optional< TerminatedSkillStatusUpdatecallSubskill (const skills::SkillProxy &proxy)
 Call a subskill with default parameters and block until the subskill terminates.
 
std::optional< TerminatedSkillStatusUpdatecallSubskill (const skills::SkillProxy &proxy, const aron::data::DictPtr &parameters)
 Call a subskill with given parameters and block until the subskill terminates.
 
std::optional< TerminatedSkillStatusUpdatecallSubskill (SkillProxyPtr proxy)
 Call a subskill with default parameters and block until the subskill terminates.
 
std::optional< TerminatedSkillStatusUpdatecallSubskill (SkillProxyPtr proxy, const aron::data::DictPtr &parameters)
 Call a subskill with given parameters and block until the subskill terminates.
 
SkillExecutionHandlePtr callSubskillAsync (const SkillID &skillId)
 
SkillExecutionHandlePtr callSubskillAsync (const SkillID &skillId, const aron::data::DictPtr &parameters)
 
SkillExecutionHandlePtr callSubskillAsync (const SkillID &skillId, std::function< void(aron::data::DictPtr &)> parametersFunction)
 
template<class ParameterT>
SkillExecutionHandlePtr callSubskillAsync (const SkillID &skillId, std::function< void(ParameterT &parameters)> parametersFunction)
 Similar to callSubskill but non-blocking.
 
template<class ParameterT>
SkillExecutionHandlePtr callSubskillAsync (const SkillProxy &proxy, std::function< void(ParameterT &parameters)> parametersFunction)
 Similar to callSubskill but non-blocking.
 
SkillExecutionHandlePtr callSubskillAsync (const skills::SkillProxy &proxy, const aron::data::DictPtr &parameters)
 
SkillExecutionHandlePtr callSubskillAsync (SkillProxyPtr proxy)
 Similar to callSubskill but non-blocking.
 
SkillExecutionHandlePtr callSubskillAsync (SkillProxyPtr proxy, const aron::data::DictPtr &parameters)
 Similar to callSubskill but non-blocking.
 
template<class ParameterT>
SkillExecutionHandlePtr callSubskillAsync (SkillProxyPtr proxy, std::function< void(ParameterT &parameters)> parametersFunction)
 
ExitResult exitSkill ()
 Exit method of a skill.
 
aron::data::DictPtr getParameters () const
 Get the parameters of a skill that have been set so far.
 
SkillDescription getSkillDescription () const
 Get the description of a skill.
 
SkillID getSkillId () const
 Get the id of the skill.
 
InitResult initSkill ()
 Initialization of a skill.
 
void installConditionWithCallback (std::function< bool()> &&f, std::function< void()> &&cb)
 install a condition which is frequently checked from the conditionCheckingThread
 
MainResult mainOfSkill ()
 Main method of a skill.
 
void notifySkillToStop ()
 Notify the skill from extern to stop.
 
PrepareResult prepareSkill ()
 Prepare a skill once.
 
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.
 
void setProviderId (const skills::ProviderID &pid)
 Set the provider id of the description of the skill.
 
bool shouldSkillTerminate () const override
 Returns whether the skill should terminate as soon as possible.
 
 Skill ()=delete
 We completely remove the default constructor!
 
 Skill (const SkillDescription &)
 Constructor of a skill for inheritance. Every skill must have a skill description.
 
void updateParameters (const aron::data::DictPtr &d)
 Merge parameters to the local parameters of the skill.
 
void updateSubSkillStatus (const skills::SkillStatusUpdate &statusUpdate)
 
void waitFor (const armarx::Duration &duration, const armarx::Duration &interval=armarx::Duration::MilliSeconds(200)) const override
 
 ~Skill () override
 Virtual destructor of a skill.
 
- 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.
 
MessageTypeT getEffectiveLoggingLevel () const
 
 Logging ()
 
void setLocalMinimumLoggingLevel (MessageTypeT level)
 With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set.
 
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

virtual ExitResult exit ()
 Override this method with the actual implementation.
 
virtual InitResult init ()
 Override this method with the actual implementation.
 
virtual MainResult main ()
 Override this method with the actual implementation.
 
void notifyTimeoutReached ()
 
virtual void onStopRequested ()
 
virtual void onTimeoutReached ()
 Override these methods if you want to do something special when notification comes.
 
virtual PrepareResult prepare ()
 Override this method with the actual implementation.
 
void throwIfSkillShouldTerminate (const std::function< void()> &do_before, const std::string &abortedMessage="") const
 
void throwIfSkillShouldTerminate (const std::string &abortedMessage="") const
 
- Protected Member Functions inherited from Logging
bool checkLogLevel (MessageTypeT level) const
 
const LogSenderPtrgetLogSender () const
 Retrieve log sender.
 
LogSenderPtr loghelper (const char *file, int line, const char *function) const
 
- Protected Member Functions inherited from SkillExecutorInterface
virtual ~SkillExecutorInterface ()=default
 

Static Protected Member Functions

static MainResult MakeAbortedResult (aron::data::DictPtr data=nullptr)
 
static MainResult MakeFailedResult (aron::data::DictPtr data=nullptr)
 
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
 
armem::task_outcome::TaskOutcome taskOutcome_
 
std::atomic_bool timeoutReached = false
 
- Protected Attributes inherited from Logging
MessageTypeT minimumLoggingLevel
 
SpamFilterDataPtr spamFilter
 
LogTag tag
 

Detailed Description

Base class for skills.

Definition at line 40 of file Skill.h.

Member Typedef Documentation

◆ CallbackT

using CallbackT
Initial value:
std::function<void(const SkillStatus s, const armarx::aron::data::DictPtr&)>
std::shared_ptr< Dict > DictPtr
Definition Dict.h:42

Definition at line 45 of file Skill.h.

Constructor & Destructor Documentation

◆ Skill() [1/2]

Skill ( )
delete

We completely remove the default constructor!

A skill without a desciption cannot exist

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Skill() [2/2]

Skill ( const SkillDescription & desc)

Constructor of a skill for inheritance. Every skill must have a skill description.

Definition at line 33 of file Skill.cpp.

+ Here is the call graph for this function:

◆ ~Skill()

~Skill ( )
override

Virtual destructor of a skill.

Definition at line 592 of file Skill.cpp.

Member Function Documentation

◆ callSubskill() [1/9]

std::optional< TerminatedSkillStatusUpdate > callSubskill ( const SkillID & skillId)

Call a subskill with the given ID and its default parameters.

Parameters
skillIdThe subskill's ID.
Returns
The terminated skill status update.
Exceptions
armarx::skills::error::SkillAbortedExceptionIf the calling skill has been aborted.
armarx::skills::error::SkillFailedExceptionIf the calling skill's timeout was reached.

Definition at line 119 of file Skill.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ callSubskill() [2/9]

std::optional< TerminatedSkillStatusUpdate > callSubskill ( const SkillID & skillId,
const aron::data::DictPtr & parameters )

Call a subskill with the given ID and parameters.

Parameters
skillIdThe subskill's ID.
parametersThe parameters.
Returns
The terminated skill status update.
Exceptions
armarx::skills::error::SkillAbortedExceptionIf the calling skill has been aborted.
armarx::skills::error::SkillFailedExceptionIf the calling skill's timeout was reached.

Definition at line 125 of file Skill.cpp.

+ Here is the call graph for this function:

◆ callSubskill() [3/9]

template<class ParameterT>
std::optional< TerminatedSkillStatusUpdate > callSubskill ( const SkillID & skillId,
const ParameterT & parameters )
inline

Call a subskill with the given ID and parameters.

Parameters
skillIdThe subskill's ID.
parametersThe parameters.
Returns
The terminated skill status update.
Exceptions
armarx::skills::error::SkillAbortedExceptionIf the calling skill has been aborted.
armarx::skills::error::SkillFailedExceptionIf the calling skill's timeout was reached.

Definition at line 230 of file Skill.h.

+ Here is the call graph for this function:

◆ callSubskill() [4/9]

std::optional< TerminatedSkillStatusUpdate > callSubskill ( const SkillID & skillId,
std::function< void(aron::data::DictPtr &parameters)> parametersFunction )

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.

Parameters
skillIdThe subskill's ID.
parametersFunctionFunction which edits the parameters.
Returns
The terminated skill status update.
Exceptions
armarx::skills::error::SkillAbortedExceptionIf the calling skill has been aborted.
armarx::skills::error::SkillFailedExceptionIf the calling skill's timeout was reached.

◆ callSubskill() [5/9]

template<class ParameterT>
std::optional< TerminatedSkillStatusUpdate > callSubskill ( const SkillID & skillId,
std::function< void(ParameterT &parameters)> parametersFunction )
inline

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.

Parameters
skillIdThe subskill's ID.
parametersFunctionFunction which edits the parameters.
Returns
The terminated skill status update.
Exceptions
armarx::skills::error::SkillAbortedExceptionIf the calling skill has been aborted.
armarx::skills::error::SkillFailedExceptionIf the calling skill's timeout was reached.

Definition at line 271 of file Skill.h.

+ Here is the call graph for this function:

◆ callSubskill() [6/9]

std::optional< TerminatedSkillStatusUpdate > callSubskill ( const skills::SkillProxy & proxy)
inline

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.

Parameters
proxySkill proxy.
Returns
Terminated skill status update.
Exceptions
armarx::skills::error::SkillAbortedExceptionIf the calling skill has been aborted.
armarx::skills::error::SkillFailedExceptionIf the calling skill's timeout was reached.

Definition at line 417 of file Skill.h.

+ Here is the call graph for this function:

◆ callSubskill() [7/9]

std::optional< TerminatedSkillStatusUpdate > callSubskill ( const skills::SkillProxy & proxy,
const aron::data::DictPtr & parameters )
inline

Call a subskill with given parameters and block until the subskill terminates.

Parameters
proxySkill proxy.
parametersParameters passed to the skill.
Returns
Terminated skill status update.
Exceptions
armarx::skills::error::SkillAbortedExceptionIf the calling skill has been aborted.
armarx::skills::error::SkillFailedExceptionIf the calling skill's timeout was reached.

Definition at line 435 of file Skill.h.

+ Here is the call graph for this function:

◆ callSubskill() [8/9]

std::optional< TerminatedSkillStatusUpdate > callSubskill ( SkillProxyPtr proxy)

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.

Parameters
proxySkill proxy.
Returns
Terminated skill status update.
Exceptions
armarx::skills::error::SkillAbortedExceptionIf the calling skill has been aborted.
armarx::skills::error::SkillFailedExceptionIf the calling skill's timeout was reached.

Definition at line 71 of file Skill.cpp.

+ Here is the call graph for this function:

◆ callSubskill() [9/9]

std::optional< TerminatedSkillStatusUpdate > callSubskill ( SkillProxyPtr proxy,
const aron::data::DictPtr & parameters )

Call a subskill with given parameters and block until the subskill terminates.

Parameters
proxySkill proxy.
parametersParameters passed to the skill.
Returns
Terminated skill status update.
Exceptions
armarx::skills::error::SkillAbortedExceptionIf the calling skill has been aborted.
armarx::skills::error::SkillFailedExceptionIf the calling skill's timeout was reached.

Definition at line 78 of file Skill.cpp.

+ Here is the call graph for this function:

◆ callSubskillAsync() [1/9]

SkillExecutionHandlePtr callSubskillAsync ( const SkillID & skillId)
nodiscard

Definition at line 165 of file Skill.cpp.

+ Here is the call graph for this function:

◆ callSubskillAsync() [2/9]

SkillExecutionHandlePtr callSubskillAsync ( const SkillID & skillId,
const aron::data::DictPtr & parameters )
nodiscard

Definition at line 598 of file Skill.cpp.

+ Here is the call graph for this function:

◆ callSubskillAsync() [3/9]

SkillExecutionHandlePtr callSubskillAsync ( const SkillID & skillId,
std::function< void(aron::data::DictPtr &)> parametersFunction )
nodiscard

Definition at line 148 of file Skill.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ callSubskillAsync() [4/9]

template<class ParameterT>
SkillExecutionHandlePtr callSubskillAsync ( const SkillID & skillId,
std::function< void(ParameterT &parameters)> parametersFunction )
inlinenodiscard

Similar to callSubskill but non-blocking.

Definition at line 290 of file Skill.h.

+ Here is the call graph for this function:

◆ callSubskillAsync() [5/9]

template<class ParameterT>
SkillExecutionHandlePtr callSubskillAsync ( const SkillProxy & proxy,
std::function< void(ParameterT &parameters)> parametersFunction )
inline

Similar to callSubskill but non-blocking.

Definition at line 444 of file Skill.h.

+ Here is the call graph for this function:

◆ callSubskillAsync() [6/9]

SkillExecutionHandlePtr callSubskillAsync ( const skills::SkillProxy & proxy,
const aron::data::DictPtr & parameters )
inline

Definition at line 460 of file Skill.h.

+ Here is the call graph for this function:

◆ callSubskillAsync() [7/9]

SkillExecutionHandlePtr callSubskillAsync ( Skill::SkillProxyPtr prx)
nodiscard

Similar to callSubskill but non-blocking.

Definition at line 93 of file Skill.cpp.

+ Here is the call graph for this function:

◆ callSubskillAsync() [8/9]

SkillExecutionHandlePtr callSubskillAsync ( Skill::SkillProxyPtr prx,
const aron::data::DictPtr & parameters )
nodiscard

Similar to callSubskill but non-blocking.

Definition at line 100 of file Skill.cpp.

+ Here is the call graph for this function:

◆ callSubskillAsync() [9/9]

template<class ParameterT>
SkillExecutionHandlePtr callSubskillAsync ( SkillProxyPtr proxy,
std::function< void(ParameterT &parameters)> parametersFunction )
inline

Definition at line 340 of file Skill.h.

+ Here is the call graph for this function:

◆ exit()

Skill::ExitResult exit ( )
protectedvirtual

Override this method with the actual implementation.

Reimplemented in SimpleSkill, SimpleSpecializedSkill< AronT >, SimpleSpecializedSkill< ::armarx::control::collision_avoidance::arondto::CollisionAvoidanceParams >, SimpleSpecializedSkill< ::armarx::control::collision_avoidance::arondto::CollisionAvoidanceParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseWithFaceRecognitionParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseWithFaceRecognitionParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanProfileParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanProfileParams >, SimpleSpecializedSkill< armarx::control::skills::params::ZeroTorque >, SimpleSpecializedSkill< armarx::skills::Example::SleepAcceptedType >, SimpleSpecializedSkill< arondto::BringObjectToLandmarkAcceptedType >, SimpleSpecializedSkill< arondto::ExecuteTrajectoryParams >, SimpleSpecializedSkill< arondto::FollowerParams >, SimpleSpecializedSkill< arondto::GuideHumanToRoomParams >, SimpleSpecializedSkill< arondto::GuidingWithCollAvoidanceParams >, SimpleSpecializedSkill< arondto::LookAtArticulatedObjectFrameParams >, SimpleSpecializedSkill< arondto::LookAtHumanFaceParams >, SimpleSpecializedSkill< arondto::LookAtHumanHandParams >, SimpleSpecializedSkill< arondto::LookAtObjectParams >, SimpleSpecializedSkill< arondto::LookAtParams >, SimpleSpecializedSkill< arondto::LookDirectionParams >, SimpleSpecializedSkill< arondto::LookForObjectsParams >, SimpleSpecializedSkill< arondto::MoveJointsToNamedConfigurationParams >, SimpleSpecializedSkill< arondto::MoveJointsToPositionParams >, SimpleSpecializedSkill< arondto::MoveJointsWithVelocityParams >, SimpleSpecializedSkill< arondto::NamedConfigurationParams >, SimpleSpecializedSkill< arondto::NavigateToAlternativesParams >, SimpleSpecializedSkill< arondto::NavigateToChargingStationParams >, SimpleSpecializedSkill< arondto::NavigateToLocationParams >, SimpleSpecializedSkill< arondto::NavigateToNamedLocationParams >, SimpleSpecializedSkill< arondto::NavigateToParams >, SimpleSpecializedSkill< arondto::PointAtParams >, SimpleSpecializedSkill< arondto::PointAtParams >, SimpleSpecializedSkill< arondto::RelaxHandParams >, SimpleSpecializedSkill< arondto::ResetGazeTargetsParams >, SimpleSpecializedSkill< arondto::RotateTowardsLocationParams >, SimpleSpecializedSkill< arondto::ScanLocationParams >, SimpleSpecializedSkill< arondto::ScanLocationsForObjectParams >, SimpleSpecializedSkill< arondto::SetCustomGazeTargetParams >, SimpleSpecializedSkill< arondto::SwitchCoordinationModeParams >, SimpleSpecializedSkill< grasp_object::arondto::CloseHandAndAttachAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::ExecuteGraspAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::ExecutePutdownAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::GraspObjectAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformAfterGraspAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformAfterPutdownAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformForGraspAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformForPutdownAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::OpenHandAndDetachAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::PutdownObjectAcceptedType >, SimpleSpecializedSkill< hand_control::arondto::CloseHandAcceptedType >, SimpleSpecializedSkill< hand_control::arondto::OpenHandAcceptedType >, SimpleSpecializedSkill< joint_control::arondto::MoveJointsWithVelocityAcceptedType >, SimpleSpecializedSkill< Params >, SimpleSpecializedSkill< Params >, SimpleSpecializedSkill< platform_control::arondto::MovePlatformToLandmarkAcceptedType >, SimpleSpecializedSkill< platform_control::arondto::MovePlatformToPoseAcceptedType >, SimpleSpecializedSkill< RetrieveHandParams >, SimpleSpecializedSkill< RetrieveHandParams >, SimpleSpecializedSkill< skills::Example::ChainingAsyncSkillParams >, SimpleSpecializedSkill< skills::Example::ChainingSkillParams >, SimpleSpecializedSkill< skills::Example::DataPassingParams >, SimpleSpecializedSkill< skills::Example::HelloWorldAcceptedType >, SimpleSpecializedSkill< skills::Example::RecursiveSkillParams >, and SimpleSpecializedSkill< visual_search::arondto::WhatCanYouSeeNowAcceptedType >.

Definition at line 535 of file Skill.cpp.

+ Here is the caller graph for this function:

◆ exitSkill()

Skill::ExitResult exitSkill ( )

Exit method of a skill.

It is guaranteed that exit is always called (unless there is a segfault or similar)

Definition at line 369 of file Skill.cpp.

+ Here is the call graph for this function:

◆ getParameters()

aron::data::DictPtr getParameters ( ) const

Get the parameters of a skill that have been set so far.

Definition at line 219 of file Skill.cpp.

◆ getSkillDescription()

SkillDescription getSkillDescription ( ) const

Get the description of a skill.

Definition at line 581 of file Skill.cpp.

◆ getSkillId()

SkillID getSkillId ( ) const

Get the id of the skill.

Definition at line 587 of file Skill.cpp.

+ Here is the caller graph for this function:

◆ init()

Skill::InitResult init ( )
protectedvirtual

Override this method with the actual implementation.

Reimplemented in SimpleSkill, SimpleSpecializedSkill< AronT >, SimpleSpecializedSkill< ::armarx::control::collision_avoidance::arondto::CollisionAvoidanceParams >, SimpleSpecializedSkill< ::armarx::control::collision_avoidance::arondto::CollisionAvoidanceParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseWithFaceRecognitionParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseWithFaceRecognitionParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanProfileParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanProfileParams >, SimpleSpecializedSkill< armarx::control::skills::params::ZeroTorque >, SimpleSpecializedSkill< armarx::skills::Example::SleepAcceptedType >, SimpleSpecializedSkill< arondto::BringObjectToLandmarkAcceptedType >, SimpleSpecializedSkill< arondto::ExecuteTrajectoryParams >, SimpleSpecializedSkill< arondto::FollowerParams >, SimpleSpecializedSkill< arondto::GuideHumanToRoomParams >, SimpleSpecializedSkill< arondto::GuidingWithCollAvoidanceParams >, SimpleSpecializedSkill< arondto::LookAtArticulatedObjectFrameParams >, SimpleSpecializedSkill< arondto::LookAtHumanFaceParams >, SimpleSpecializedSkill< arondto::LookAtHumanHandParams >, SimpleSpecializedSkill< arondto::LookAtObjectParams >, SimpleSpecializedSkill< arondto::LookAtParams >, SimpleSpecializedSkill< arondto::LookDirectionParams >, SimpleSpecializedSkill< arondto::LookForObjectsParams >, SimpleSpecializedSkill< arondto::MoveJointsToNamedConfigurationParams >, SimpleSpecializedSkill< arondto::MoveJointsToPositionParams >, SimpleSpecializedSkill< arondto::MoveJointsWithVelocityParams >, SimpleSpecializedSkill< arondto::NamedConfigurationParams >, SimpleSpecializedSkill< arondto::NavigateToAlternativesParams >, SimpleSpecializedSkill< arondto::NavigateToChargingStationParams >, SimpleSpecializedSkill< arondto::NavigateToLocationParams >, SimpleSpecializedSkill< arondto::NavigateToNamedLocationParams >, SimpleSpecializedSkill< arondto::NavigateToParams >, SimpleSpecializedSkill< arondto::PointAtParams >, SimpleSpecializedSkill< arondto::PointAtParams >, SimpleSpecializedSkill< arondto::RelaxHandParams >, SimpleSpecializedSkill< arondto::ResetGazeTargetsParams >, SimpleSpecializedSkill< arondto::RotateTowardsLocationParams >, SimpleSpecializedSkill< arondto::ScanLocationParams >, SimpleSpecializedSkill< arondto::ScanLocationsForObjectParams >, SimpleSpecializedSkill< arondto::SetCustomGazeTargetParams >, SimpleSpecializedSkill< arondto::SwitchCoordinationModeParams >, SimpleSpecializedSkill< grasp_object::arondto::CloseHandAndAttachAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::ExecuteGraspAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::ExecutePutdownAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::GraspObjectAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformAfterGraspAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformAfterPutdownAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformForGraspAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformForPutdownAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::OpenHandAndDetachAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::PutdownObjectAcceptedType >, SimpleSpecializedSkill< hand_control::arondto::CloseHandAcceptedType >, SimpleSpecializedSkill< hand_control::arondto::OpenHandAcceptedType >, SimpleSpecializedSkill< joint_control::arondto::MoveJointsWithVelocityAcceptedType >, SimpleSpecializedSkill< Params >, SimpleSpecializedSkill< Params >, SimpleSpecializedSkill< platform_control::arondto::MovePlatformToLandmarkAcceptedType >, SimpleSpecializedSkill< platform_control::arondto::MovePlatformToPoseAcceptedType >, SimpleSpecializedSkill< RetrieveHandParams >, SimpleSpecializedSkill< RetrieveHandParams >, SimpleSpecializedSkill< skills::Example::ChainingAsyncSkillParams >, SimpleSpecializedSkill< skills::Example::ChainingSkillParams >, SimpleSpecializedSkill< skills::Example::DataPassingParams >, SimpleSpecializedSkill< skills::Example::HelloWorldAcceptedType >, SimpleSpecializedSkill< skills::Example::RecursiveSkillParams >, and SimpleSpecializedSkill< visual_search::arondto::WhatCanYouSeeNowAcceptedType >.

Definition at line 519 of file Skill.cpp.

+ Here is the caller graph for this function:

◆ initSkill()

Skill::InitResult initSkill ( )

Initialization of a skill.

Called directly after construction. If this method does not return SUCCEEDED the skill execution is failed.

Definition at line 341 of file Skill.cpp.

+ Here is the call graph for this function:

◆ installConditionWithCallback()

void installConditionWithCallback ( std::function< bool()> && f,
std::function< void()> && cb )

install a condition which is frequently checked from the conditionCheckingThread

Definition at line 47 of file Skill.cpp.

◆ main()

Skill::MainResult main ( )
protectedvirtual

Override this method with the actual implementation.

The callback is for status updates to the calling instance

Reimplemented in PointAt, RetrieveHand, PeriodicSkill, PeriodicSpecializedSkill< AronT >, SimpleSkill, SimpleSpecializedSkill< AronT >, SimpleSpecializedSkill< ::armarx::control::collision_avoidance::arondto::CollisionAvoidanceParams >, SimpleSpecializedSkill< ::armarx::control::collision_avoidance::arondto::CollisionAvoidanceParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseWithFaceRecognitionParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseWithFaceRecognitionParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanProfileParams >, SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanProfileParams >, SimpleSpecializedSkill< armarx::control::skills::params::ZeroTorque >, SimpleSpecializedSkill< armarx::skills::Example::SleepAcceptedType >, SimpleSpecializedSkill< arondto::BringObjectToLandmarkAcceptedType >, SimpleSpecializedSkill< arondto::ExecuteTrajectoryParams >, SimpleSpecializedSkill< arondto::FollowerParams >, SimpleSpecializedSkill< arondto::GuideHumanToRoomParams >, SimpleSpecializedSkill< arondto::GuidingWithCollAvoidanceParams >, SimpleSpecializedSkill< arondto::LookAtArticulatedObjectFrameParams >, SimpleSpecializedSkill< arondto::LookAtHumanFaceParams >, SimpleSpecializedSkill< arondto::LookAtHumanHandParams >, SimpleSpecializedSkill< arondto::LookAtObjectParams >, SimpleSpecializedSkill< arondto::LookAtParams >, SimpleSpecializedSkill< arondto::LookDirectionParams >, SimpleSpecializedSkill< arondto::LookForObjectsParams >, SimpleSpecializedSkill< arondto::MoveJointsToNamedConfigurationParams >, SimpleSpecializedSkill< arondto::MoveJointsToPositionParams >, SimpleSpecializedSkill< arondto::MoveJointsWithVelocityParams >, SimpleSpecializedSkill< arondto::NamedConfigurationParams >, SimpleSpecializedSkill< arondto::NavigateToAlternativesParams >, SimpleSpecializedSkill< arondto::NavigateToChargingStationParams >, SimpleSpecializedSkill< arondto::NavigateToLocationParams >, SimpleSpecializedSkill< arondto::NavigateToNamedLocationParams >, SimpleSpecializedSkill< arondto::NavigateToParams >, SimpleSpecializedSkill< arondto::PointAtParams >, SimpleSpecializedSkill< arondto::PointAtParams >, SimpleSpecializedSkill< arondto::RelaxHandParams >, SimpleSpecializedSkill< arondto::ResetGazeTargetsParams >, SimpleSpecializedSkill< arondto::RotateTowardsLocationParams >, SimpleSpecializedSkill< arondto::ScanLocationParams >, SimpleSpecializedSkill< arondto::ScanLocationsForObjectParams >, SimpleSpecializedSkill< arondto::SetCustomGazeTargetParams >, SimpleSpecializedSkill< arondto::SwitchCoordinationModeParams >, SimpleSpecializedSkill< grasp_object::arondto::CloseHandAndAttachAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::ExecuteGraspAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::ExecutePutdownAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::GraspObjectAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformAfterGraspAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformAfterPutdownAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformForGraspAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::MovePlatformForPutdownAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::OpenHandAndDetachAcceptedType >, SimpleSpecializedSkill< grasp_object::arondto::PutdownObjectAcceptedType >, SimpleSpecializedSkill< hand_control::arondto::CloseHandAcceptedType >, SimpleSpecializedSkill< hand_control::arondto::OpenHandAcceptedType >, SimpleSpecializedSkill< joint_control::arondto::MoveJointsWithVelocityAcceptedType >, SimpleSpecializedSkill< Params >, SimpleSpecializedSkill< Params >, SimpleSpecializedSkill< platform_control::arondto::MovePlatformToLandmarkAcceptedType >, SimpleSpecializedSkill< platform_control::arondto::MovePlatformToPoseAcceptedType >, SimpleSpecializedSkill< RetrieveHandParams >, SimpleSpecializedSkill< RetrieveHandParams >, SimpleSpecializedSkill< skills::Example::ChainingAsyncSkillParams >, SimpleSpecializedSkill< skills::Example::ChainingSkillParams >, SimpleSpecializedSkill< skills::Example::DataPassingParams >, SimpleSpecializedSkill< skills::Example::HelloWorldAcceptedType >, SimpleSpecializedSkill< skills::Example::RecursiveSkillParams >, and SimpleSpecializedSkill< visual_search::arondto::WhatCanYouSeeNowAcceptedType >.

Definition at line 542 of file Skill.cpp.

+ Here is the caller graph for this function:

◆ mainOfSkill()

Skill::MainResult mainOfSkill ( )

Main method of a skill.

Definition at line 359 of file Skill.cpp.

+ Here is the call graph for this function:

◆ MakeAbortedResult()

Skill::MainResult MakeAbortedResult ( aron::data::DictPtr data = nullptr)
staticprotected

Definition at line 431 of file Skill.cpp.

+ Here is the caller graph for this function:

◆ MakeFailedResult()

Skill::MainResult MakeFailedResult ( aron::data::DictPtr data = nullptr)
staticprotected

Definition at line 422 of file Skill.cpp.

+ Here is the caller graph for this function:

◆ MakeSucceededResult()

Skill::MainResult MakeSucceededResult ( aron::data::DictPtr data = nullptr)
staticprotected

Definition at line 413 of file Skill.cpp.

+ Here is the caller graph for this function:

◆ notifySkillToStop()

void notifySkillToStop ( )

Notify the skill from extern to stop.

Definition at line 440 of file Skill.cpp.

+ Here is the call graph for this function:

◆ notifyTimeoutReached()

void notifyTimeoutReached ( )
protected

Definition at line 454 of file Skill.cpp.

+ Here is the call graph for this function:

◆ onStopRequested()

void onStopRequested ( )
protectedvirtual

Reimplemented in PointAt, RetrieveHand, and Sleep.

Definition at line 513 of file Skill.cpp.

+ Here is the caller graph for this function:

◆ onTimeoutReached()

void onTimeoutReached ( )
protectedvirtual

Override these methods if you want to do something special when notification comes.

Reimplemented in PointAt.

Definition at line 508 of file Skill.cpp.

+ Here is the caller graph for this function:

◆ prepare()

Skill::PrepareResult prepare ( )
protectedvirtual

Override this method with the actual implementation.

Definition at line 527 of file Skill.cpp.

+ Here is the caller graph for this function:

◆ prepareSkill()

Skill::PrepareResult prepareSkill ( )

Prepare a skill once.

This method is called in a loop as long as it returns RUNNING If the loop does not terminate with SUCCEDED the skill execution is failed.

Definition at line 350 of file Skill.cpp.

+ Here is the call graph for this function:

◆ setCallback()

void setCallback ( const CallbackT & callback)

Definition at line 557 of file Skill.cpp.

◆ setExecutorName()

void setExecutorName ( const std::string & executorName)

Definition at line 569 of file Skill.cpp.

◆ setManager()

void setManager ( const manager::dti::SkillManagerInterfacePrx & manager)

Definition at line 563 of file Skill.cpp.

◆ setParameters()

void setParameters ( const aron::data::DictPtr & d)

Hard set the parameters, ignoring everything that has been set or merged before.

Definition at line 206 of file Skill.cpp.

+ Here is the caller graph for this function:

◆ setProviderId()

void setProviderId ( const skills::ProviderID & pid)

Set the provider id of the description of the skill.

This method is called when creating a skill in a skill provider

Definition at line 551 of file Skill.cpp.

◆ shouldSkillTerminate()

bool shouldSkillTerminate ( ) const
overridevirtual

Returns whether the skill should terminate as soon as possible.

Implements SkillExecutorInterface.

Definition at line 469 of file Skill.cpp.

+ Here is the caller graph for this function:

◆ throwIfSkillShouldTerminate() [1/2]

void throwIfSkillShouldTerminate ( const std::function< void()> & do_before,
const std::string & abortedMessage = "" ) const
protected

Definition at line 378 of file Skill.cpp.

+ Here is the call graph for this function:

◆ throwIfSkillShouldTerminate() [2/2]

void throwIfSkillShouldTerminate ( const std::string & abortedMessage = "") const
protected

Definition at line 389 of file Skill.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateParameters()

void updateParameters ( const aron::data::DictPtr & d)

Merge parameters to the local parameters of the skill.

Definition at line 190 of file Skill.cpp.

◆ updateSubSkillStatus()

void updateSubSkillStatus ( const skills::SkillStatusUpdate & statusUpdate)

Definition at line 575 of file Skill.cpp.

◆ waitFor()

void waitFor ( const armarx::Duration & duration,
const armarx::Duration & interval = armarx::Duration::MilliSeconds(200) ) const
overridevirtual

Implements SkillExecutorInterface.

Definition at line 54 of file Skill.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ callback

CallbackT callback = CallbackT()
protected

Definition at line 362 of file Skill.h.

◆ constructing

std::atomic_bool constructing = true
protected

Definition at line 378 of file Skill.h.

◆ description

SkillDescription description
protected

Definition at line 372 of file Skill.h.

◆ executorName

std::string executorName = ""
protected

Definition at line 364 of file Skill.h.

◆ exited

◆ exiting

std::atomic_bool exiting = false
protected

Definition at line 382 of file Skill.h.

◆ finished

std::atomic_bool finished = false
protected

Definition at line 383 of file Skill.h.

◆ initializing

std::atomic_bool initializing = false
protected

Definition at line 379 of file Skill.h.

◆ manager

manager::dti::SkillManagerInterfacePrx manager = nullptr
protected

Definition at line 363 of file Skill.h.

◆ parameters

armarx::aron::data::DictPtr parameters = nullptr
protected

Definition at line 369 of file Skill.h.

◆ parametersMutex

std::mutex parametersMutex
mutableprotected

Definition at line 368 of file Skill.h.

◆ preparing

std::atomic_bool preparing = false
protected

Definition at line 380 of file Skill.h.

◆ running

std::atomic_bool running = false
protected

Definition at line 381 of file Skill.h.

◆ started

◆ stopped

std::atomic_bool stopped = false
protected

Definition at line 386 of file Skill.h.

◆ taskOutcome_

armem::task_outcome::TaskOutcome taskOutcome_
protected

Definition at line 375 of file Skill.h.

◆ timeoutReached

std::atomic_bool timeoutReached = false
protected

Definition at line 387 of file Skill.h.


The documentation for this class was generated from the following files: