diff --git a/scenarios/SkillProviderTest/SkillProviderTest.scx b/scenarios/SkillProviderTest/SkillProviderTest.scx index aa275e46094978c888fe4732db5b70eca27052ac..7e5aa06a7ce69f63fcc6fc606f55d17b704b82a1 100644 --- a/scenarios/SkillProviderTest/SkillProviderTest.scx +++ b/scenarios/SkillProviderTest/SkillProviderTest.scx @@ -2,5 +2,9 @@ <scenario name="SkillProviderTest" creation="2022-06-02.15:33:15" globalConfigName="./config/global.cfg" package="RobotAPI" deploymentType="local" nodeName="NodeMain"> <application name="SkillProviderExample" instance="" package="RobotAPI" nodeName="" enabled="true" iceAutoRestart="false"/> <application name="SkillsMemory" instance="" package="RobotAPI" nodeName="" enabled="true" iceAutoRestart="false"/> + <application name="MemoryNameSystem" instance="" package="RobotAPI" nodeName="" enabled="true" iceAutoRestart="false"/> + <application name="RemoteGuiProviderApp" instance="" package="ArmarXGui" nodeName="" enabled="true" iceAutoRestart="false"/> + <application name="ArVizStorage" instance="" package="RobotAPI" nodeName="" enabled="true" iceAutoRestart="false"/> + <application name="DebugObserver" instance="" package="ArmarXCore" nodeName="" enabled="true" iceAutoRestart="false"/> </scenario> diff --git a/scenarios/SkillProviderTest/config/ArVizStorage.cfg b/scenarios/SkillProviderTest/config/ArVizStorage.cfg new file mode 100644 index 0000000000000000000000000000000000000000..302ac28c37dd28de3e68fb4fe4c2174faa4ec3bf --- /dev/null +++ b/scenarios/SkillProviderTest/config/ArVizStorage.cfg @@ -0,0 +1,212 @@ +# ================================================================== +# ArVizStorage properties +# ================================================================== + +# ArmarX.AdditionalPackages: List of additional ArmarX packages which should be in the list of default packages. If you have custom packages, which should be found by the gui or other apps, specify them here. Comma separated List. +# Attributes: +# - Default: Default value not mapped. +# - Case sensitivity: yes +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.ArVizStorage.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ArVizStorage.EnableProfiling = false + + +# ArmarX.ArVizStorage.HistoryPath: Destination path where the history is serialized to +# Attributes: +# - Default: RobotAPI/ArVizStorage +# - Case sensitivity: yes +# - Required: no +# ArmarX.ArVizStorage.HistoryPath = RobotAPI/ArVizStorage + + +# ArmarX.ArVizStorage.MaxHistorySize: How many layer updates are saved in the history until they are compressed +# Attributes: +# - Default: 1000 +# - Case sensitivity: yes +# - Required: no +# ArmarX.ArVizStorage.MaxHistorySize = 1000 + + +# ArmarX.ArVizStorage.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: yes +# - Required: no +# - Possible values: {Debug, Error, Fatal, Important, Info, Undefined, Verbose, Warning} +# ArmarX.ArVizStorage.MinimumLoggingLevel = Undefined + + +# ArmarX.ArVizStorage.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.ArVizStorage.ObjectName = "" + + +# ArmarX.ArVizStorage.TopicName: Layer updates are sent over this topic. +# Attributes: +# - Default: ArVizTopic +# - Case sensitivity: yes +# - Required: no +# ArmarX.ArVizStorage.TopicName = ArVizTopic + + +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) +# Attributes: +# - Default: mongo/.cache +# - Case sensitivity: yes +# - Required: no +# ArmarX.CachePath = mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.DataPath = "" + + +# ArmarX.DefaultPackages: List of ArmarX packages which are accessible by default. Comma separated List. If you want to add your own packages and use all default ArmarX packages, use the property 'AdditionalPackages'. +# Attributes: +# - Default: Default value not mapped. +# - Case sensitivity: yes +# - Required: no +# ArmarX.DefaultPackages = Default value not mapped. + + +# ArmarX.DependenciesConfig: Path to the (usually generated) config file containing all data paths of all dependent projects. This property usually does not need to be edited. +# Attributes: +# - Default: ./config/dependencies.cfg +# - Case sensitivity: yes +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.DisableLogging = false + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.EnableProfiling = false + + +# ArmarX.LoadLibraries: Libraries to load at start up of the application. Must be enabled by the Application with enableLibLoading(). Format: PackageName:LibraryName;... or /absolute/path/to/library;... +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.LoadLibraries = "" + + +# ArmarX.LoggingGroup: The logging group is transmitted with every ArmarX log message over Ice in order to group the message in the GUI. +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.LoggingGroup = "" + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: true +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.RedirectStdout = true + + +# ArmarX.RemoteHandlesDeletionTimeout: The timeout (in ms) before a remote handle deletes the managed object after the use count reached 0. This time can be used by a client to increment the count again (may be required when transmitting remote handles) +# Attributes: +# - Default: 3000 +# - Case sensitivity: yes +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.SecondsStartupDelay: The startup will be delayed by this number of seconds (useful for debugging) +# Attributes: +# - Default: 0 +# - Case sensitivity: yes +# - Required: no +# ArmarX.SecondsStartupDelay = 0 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.StartDebuggerOnCrash = false + + +# ArmarX.ThreadPoolSize: Size of the ArmarX ThreadPool that is always running. +# Attributes: +# - Default: 1 +# - Case sensitivity: yes +# - Required: no +# ArmarX.ThreadPoolSize = 1 + + +# ArmarX.TopicSuffix: Suffix appended to all topic names for outgoing topics. This is mainly used to direct all topics to another name for TopicReplaying purposes. +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.UseTimeServer = false + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: yes +# - Required: no +# - Possible values: {Debug, Error, Fatal, Important, Info, Undefined, Verbose, Warning} +# ArmarX.Verbosity = Info + + diff --git a/scenarios/SkillProviderTest/config/DebugObserver.cfg b/scenarios/SkillProviderTest/config/DebugObserver.cfg new file mode 100644 index 0000000000000000000000000000000000000000..8dc7ead26b3bd2f7678b3b3e7a1b00c01213225d --- /dev/null +++ b/scenarios/SkillProviderTest/config/DebugObserver.cfg @@ -0,0 +1,221 @@ +# ================================================================== +# DebugObserver properties +# ================================================================== + +# ArmarX.AdditionalPackages: List of additional ArmarX packages which should be in the list of default packages. If you have custom packages, which should be found by the gui or other apps, specify them here. Comma separated List. +# Attributes: +# - Default: Default value not mapped. +# - Case sensitivity: yes +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) +# Attributes: +# - Default: mongo/.cache +# - Case sensitivity: yes +# - Required: no +# ArmarX.CachePath = mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.DataPath = "" + + +# ArmarX.DebugObserver.CreateUpdateFrequenciesChannel: If true, an additional channel is created that shows the update frequency of every other channel in that observer. +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.DebugObserver.CreateUpdateFrequenciesChannel = false + + +# ArmarX.DebugObserver.DebugObserverTopicName: Name of the topic the DebugObserver listens on +# Attributes: +# - Default: DebugObserver +# - Case sensitivity: yes +# - Required: no +# ArmarX.DebugObserver.DebugObserverTopicName = DebugObserver + + +# ArmarX.DebugObserver.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.DebugObserver.EnableProfiling = false + + +# ArmarX.DebugObserver.MaxHistoryRecordFrequency: The Observer history is written with this maximum frequency. Everything faster is being skipped. +# Attributes: +# - Default: 50 +# - Case sensitivity: yes +# - Required: no +# ArmarX.DebugObserver.MaxHistoryRecordFrequency = 50 + + +# ArmarX.DebugObserver.MaxHistorySize: Maximum number of entries in the Observer history +# Attributes: +# - Default: 5000 +# - Case sensitivity: yes +# - Required: no +# ArmarX.DebugObserver.MaxHistorySize = 5000 + + +# ArmarX.DebugObserver.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: yes +# - Required: no +# - Possible values: {Debug, Error, Fatal, Important, Info, Undefined, Verbose, Warning} +# ArmarX.DebugObserver.MinimumLoggingLevel = Undefined + + +# ArmarX.DebugObserver.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.DebugObserver.ObjectName = "" + + +# ArmarX.DefaultPackages: List of ArmarX packages which are accessible by default. Comma separated List. If you want to add your own packages and use all default ArmarX packages, use the property 'AdditionalPackages'. +# Attributes: +# - Default: Default value not mapped. +# - Case sensitivity: yes +# - Required: no +# ArmarX.DefaultPackages = Default value not mapped. + + +# ArmarX.DependenciesConfig: Path to the (usually generated) config file containing all data paths of all dependent projects. This property usually does not need to be edited. +# Attributes: +# - Default: ./config/dependencies.cfg +# - Case sensitivity: yes +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.DisableLogging = false + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.EnableProfiling = false + + +# ArmarX.LoadLibraries: Libraries to load at start up of the application. Must be enabled by the Application with enableLibLoading(). Format: PackageName:LibraryName;... or /absolute/path/to/library;... +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.LoadLibraries = "" + + +# ArmarX.LoggingGroup: The logging group is transmitted with every ArmarX log message over Ice in order to group the message in the GUI. +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.LoggingGroup = "" + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: true +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.RedirectStdout = true + + +# ArmarX.RemoteHandlesDeletionTimeout: The timeout (in ms) before a remote handle deletes the managed object after the use count reached 0. This time can be used by a client to increment the count again (may be required when transmitting remote handles) +# Attributes: +# - Default: 3000 +# - Case sensitivity: yes +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.SecondsStartupDelay: The startup will be delayed by this number of seconds (useful for debugging) +# Attributes: +# - Default: 0 +# - Case sensitivity: yes +# - Required: no +# ArmarX.SecondsStartupDelay = 0 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.StartDebuggerOnCrash = false + + +# ArmarX.ThreadPoolSize: Size of the ArmarX ThreadPool that is always running. +# Attributes: +# - Default: 1 +# - Case sensitivity: yes +# - Required: no +# ArmarX.ThreadPoolSize = 1 + + +# ArmarX.TopicSuffix: Suffix appended to all topic names for outgoing topics. This is mainly used to direct all topics to another name for TopicReplaying purposes. +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.UseTimeServer = false + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: yes +# - Required: no +# - Possible values: {Debug, Error, Fatal, Important, Info, Undefined, Verbose, Warning} +# ArmarX.Verbosity = Info + + diff --git a/scenarios/SkillProviderTest/config/MemoryNameSystem.cfg b/scenarios/SkillProviderTest/config/MemoryNameSystem.cfg new file mode 100644 index 0000000000000000000000000000000000000000..b8bc70a66ca7f32a628886ad1bf13e373f9750d3 --- /dev/null +++ b/scenarios/SkillProviderTest/config/MemoryNameSystem.cfg @@ -0,0 +1,196 @@ +# ================================================================== +# MemoryNameSystem properties +# ================================================================== + +# ArmarX.AdditionalPackages: List of additional ArmarX packages which should be in the list of default packages. If you have custom packages, which should be found by the gui or other apps, specify them here. Comma separated List. +# Attributes: +# - Default: Default value not mapped. +# - Case sensitivity: yes +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) +# Attributes: +# - Default: mongo/.cache +# - Case sensitivity: yes +# - Required: no +# ArmarX.CachePath = mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.DataPath = "" + + +# ArmarX.DefaultPackages: List of ArmarX packages which are accessible by default. Comma separated List. If you want to add your own packages and use all default ArmarX packages, use the property 'AdditionalPackages'. +# Attributes: +# - Default: Default value not mapped. +# - Case sensitivity: yes +# - Required: no +# ArmarX.DefaultPackages = Default value not mapped. + + +# ArmarX.DependenciesConfig: Path to the (usually generated) config file containing all data paths of all dependent projects. This property usually does not need to be edited. +# Attributes: +# - Default: ./config/dependencies.cfg +# - Case sensitivity: yes +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.DisableLogging = false + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.EnableProfiling = false + + +# ArmarX.LoadLibraries: Libraries to load at start up of the application. Must be enabled by the Application with enableLibLoading(). Format: PackageName:LibraryName;... or /absolute/path/to/library;... +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.LoadLibraries = "" + + +# ArmarX.LoggingGroup: The logging group is transmitted with every ArmarX log message over Ice in order to group the message in the GUI. +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.LoggingGroup = "" + + +# ArmarX.MemoryNameSystem.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.MemoryNameSystem.EnableProfiling = false + + +# ArmarX.MemoryNameSystem.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: yes +# - Required: no +# - Possible values: {Debug, Error, Fatal, Important, Info, Undefined, Verbose, Warning} +# ArmarX.MemoryNameSystem.MinimumLoggingLevel = Undefined + + +# ArmarX.MemoryNameSystem.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.MemoryNameSystem.ObjectName = "" + + +# ArmarX.MemoryNameSystem.RemoteGuiName: Name of the remote gui provider +# Attributes: +# - Default: RemoteGuiProvider +# - Case sensitivity: yes +# - Required: no +# ArmarX.MemoryNameSystem.RemoteGuiName = RemoteGuiProvider + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: true +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.RedirectStdout = true + + +# ArmarX.RemoteHandlesDeletionTimeout: The timeout (in ms) before a remote handle deletes the managed object after the use count reached 0. This time can be used by a client to increment the count again (may be required when transmitting remote handles) +# Attributes: +# - Default: 3000 +# - Case sensitivity: yes +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.SecondsStartupDelay: The startup will be delayed by this number of seconds (useful for debugging) +# Attributes: +# - Default: 0 +# - Case sensitivity: yes +# - Required: no +# ArmarX.SecondsStartupDelay = 0 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.StartDebuggerOnCrash = false + + +# ArmarX.ThreadPoolSize: Size of the ArmarX ThreadPool that is always running. +# Attributes: +# - Default: 1 +# - Case sensitivity: yes +# - Required: no +# ArmarX.ThreadPoolSize = 1 + + +# ArmarX.TopicSuffix: Suffix appended to all topic names for outgoing topics. This is mainly used to direct all topics to another name for TopicReplaying purposes. +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.UseTimeServer = false + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: yes +# - Required: no +# - Possible values: {Debug, Error, Fatal, Important, Info, Undefined, Verbose, Warning} +# ArmarX.Verbosity = Info + + diff --git a/scenarios/SkillProviderTest/config/RemoteGuiProviderApp.cfg b/scenarios/SkillProviderTest/config/RemoteGuiProviderApp.cfg new file mode 100644 index 0000000000000000000000000000000000000000..4b6abea40d72afd7d313ee47a9b191f3b26de30d --- /dev/null +++ b/scenarios/SkillProviderTest/config/RemoteGuiProviderApp.cfg @@ -0,0 +1,196 @@ +# ================================================================== +# RemoteGuiProviderApp properties +# ================================================================== + +# ArmarX.AdditionalPackages: List of additional ArmarX packages which should be in the list of default packages. If you have custom packages, which should be found by the gui or other apps, specify them here. Comma separated List. +# Attributes: +# - Default: Default value not mapped. +# - Case sensitivity: yes +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) +# Attributes: +# - Default: mongo/.cache +# - Case sensitivity: yes +# - Required: no +# ArmarX.CachePath = mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.DataPath = "" + + +# ArmarX.DefaultPackages: List of ArmarX packages which are accessible by default. Comma separated List. If you want to add your own packages and use all default ArmarX packages, use the property 'AdditionalPackages'. +# Attributes: +# - Default: Default value not mapped. +# - Case sensitivity: yes +# - Required: no +# ArmarX.DefaultPackages = Default value not mapped. + + +# ArmarX.DependenciesConfig: Path to the (usually generated) config file containing all data paths of all dependent projects. This property usually does not need to be edited. +# Attributes: +# - Default: ./config/dependencies.cfg +# - Case sensitivity: yes +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.DisableLogging = false + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.EnableProfiling = false + + +# ArmarX.LoadLibraries: Libraries to load at start up of the application. Must be enabled by the Application with enableLibLoading(). Format: PackageName:LibraryName;... or /absolute/path/to/library;... +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.LoadLibraries = "" + + +# ArmarX.LoggingGroup: The logging group is transmitted with every ArmarX log message over Ice in order to group the message in the GUI. +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.LoggingGroup = "" + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: true +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.RedirectStdout = true + + +# ArmarX.RemoteGuiProvider.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.RemoteGuiProvider.EnableProfiling = false + + +# ArmarX.RemoteGuiProvider.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: yes +# - Required: no +# - Possible values: {Debug, Error, Fatal, Important, Info, Undefined, Verbose, Warning} +# ArmarX.RemoteGuiProvider.MinimumLoggingLevel = Undefined + + +# ArmarX.RemoteGuiProvider.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.RemoteGuiProvider.ObjectName = "" + + +# ArmarX.RemoteGuiProvider.TopicName: Name of the topic on which updates to the remote state are reported. +# Attributes: +# - Default: RemoteGuiTopic +# - Case sensitivity: yes +# - Required: no +# ArmarX.RemoteGuiProvider.TopicName = RemoteGuiTopic + + +# ArmarX.RemoteHandlesDeletionTimeout: The timeout (in ms) before a remote handle deletes the managed object after the use count reached 0. This time can be used by a client to increment the count again (may be required when transmitting remote handles) +# Attributes: +# - Default: 3000 +# - Case sensitivity: yes +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.SecondsStartupDelay: The startup will be delayed by this number of seconds (useful for debugging) +# Attributes: +# - Default: 0 +# - Case sensitivity: yes +# - Required: no +# ArmarX.SecondsStartupDelay = 0 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.StartDebuggerOnCrash = false + + +# ArmarX.ThreadPoolSize: Size of the ArmarX ThreadPool that is always running. +# Attributes: +# - Default: 1 +# - Case sensitivity: yes +# - Required: no +# ArmarX.ThreadPoolSize = 1 + + +# ArmarX.TopicSuffix: Suffix appended to all topic names for outgoing topics. This is mainly used to direct all topics to another name for TopicReplaying purposes. +# Attributes: +# - Default: "" +# - Case sensitivity: yes +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.UseTimeServer = false + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: yes +# - Required: no +# - Possible values: {Debug, Error, Fatal, Important, Info, Undefined, Verbose, Warning} +# ArmarX.Verbosity = Info + + diff --git a/source/RobotAPI/components/skills/SkillProviderExample/SkillProviderExample.cpp b/source/RobotAPI/components/skills/SkillProviderExample/SkillProviderExample.cpp index 985ef8171792570e6dad35d7a0abb09d78492006..5e5fb58b7ea03440fa7eb69ae8ccd12bc3752cd5 100644 --- a/source/RobotAPI/components/skills/SkillProviderExample/SkillProviderExample.cpp +++ b/source/RobotAPI/components/skills/SkillProviderExample/SkillProviderExample.cpp @@ -10,54 +10,60 @@ namespace armarx::skills::provider { - HelloWorldSkill::HelloWorldSkill() : - Skill(GetSkillDescription()) - {} + HelloWorldSkill::HelloWorldSkill() : Skill(GetSkillDescription()) + { + } - SkillDescription HelloWorldSkill::GetSkillDescription() + SkillDescription + HelloWorldSkill::GetSkillDescription() { - armarx::skills::Example::HelloWorldAcceptedType default_params; - default_params.some_float = 5; - default_params.some_int = 42; - default_params.some_text = "YOLO"; - default_params.some_list_of_matrices.push_back(Eigen::Matrix3f::Zero()); + armarx::skills::Example::HelloWorldAcceptedType root_profile_params; + root_profile_params.some_float = 5; + root_profile_params.some_int = 42; + root_profile_params.some_text = "YOLO"; + root_profile_params.some_list_of_matrices.push_back(Eigen::Matrix3f::Zero()); //default_params.some_matrix = Eigen::Matrix3f::Zero(); - return SkillDescription{ - "HelloWorld", - "This skill logs a message on ARMARX_IMPORTANT", - {}, - armarx::core::time::Duration::MilliSeconds(1000), - armarx::skills::Example::HelloWorldAcceptedType::ToAronType(), - default_params.toAron() - }; + SkillProfile rootProfile{SkillProfile::ROOT_PROFILE_NAME, + SkillProfile::NO_PREDECESSOR, + root_profile_params.toAron()}; + + return SkillDescription{"HelloWorld", + "This skill logs a message on ARMARX_IMPORTANT", + {{rootProfile.profileName, rootProfile}}, + armarx::core::time::Duration::MilliSeconds(1000), + armarx::skills::Example::HelloWorldAcceptedType::ToAronType()}; } - Skill::MainResult HelloWorldSkill::main(const MainInput& in) + Skill::MainResult + HelloWorldSkill::main(const MainInput& in) { - ARMARX_IMPORTANT << "Hi, from the Hello World Skill.\n" << - "I received the following data: \n" << - aron::converter::AronNlohmannJSONConverter::ConvertToNlohmannJSON(in.params).dump(2) << "\n" << - "(executed at: " << IceUtil::Time::now() << ")"; + ARMARX_IMPORTANT << "Hi, from the Hello World Skill.\n" + << "I received the following data: \n" + << aron::data::converter::AronNlohmannJSONConverter::ConvertToNlohmannJSON( + in.params) + .dump(2) + << "\n" + << "(executed at: " << IceUtil::Time::now() << ")"; return {TerminatedSkillStatus::Succeeded, nullptr}; } - ChainingSkill::ChainingSkill() : - Skill(GetSkillDescription()) - {} + ChainingSkill::ChainingSkill() : Skill(GetSkillDescription()) + { + } - SkillDescription ChainingSkill::GetSkillDescription() + SkillDescription + ChainingSkill::GetSkillDescription() { - return SkillDescription{ - "ChainingSkill", - "This skill calls the HelloWorld skill three times.", - {}, - armarx::core::time::Duration::MilliSeconds(3000), - nullptr - }; + return SkillDescription{"ChainingSkill", + "This skill calls the HelloWorld skill three times.", + {}, + armarx::core::time::Duration::MilliSeconds(3000), + nullptr}; } - Skill::MainResult ChainingSkill::main(const MainInput& in) + Skill::MainResult + ChainingSkill::main(const MainInput& in) { armarx::skills::Example::HelloWorldAcceptedType exec1; armarx::skills::Example::HelloWorldAcceptedType exec2; @@ -78,20 +84,21 @@ namespace armarx::skills::provider TimeoutSkill::TimeoutSkill() : PeriodicSkill(GetSkillDescription(), armarx::core::time::Frequency::Hertz(5)) - {} + { + } - SkillDescription TimeoutSkill::GetSkillDescription() + SkillDescription + TimeoutSkill::GetSkillDescription() { - return SkillDescription{ - "Timeout", - "This fails with timeout reached", - {}, - armarx::core::time::Duration::MilliSeconds(1000), - nullptr - }; + return SkillDescription{"Timeout", + "This fails with timeout reached", + {}, + armarx::core::time::Duration::MilliSeconds(1000), + nullptr}; } - PeriodicSkill::StepResult TimeoutSkill::step(const MainInput& in) + PeriodicSkill::StepResult + TimeoutSkill::step(const MainInput& in) { // do heavy work std::this_thread::sleep_for(std::chrono::milliseconds(200)); @@ -99,22 +106,22 @@ namespace armarx::skills::provider return {ActiveOrTerminatedSkillStatus::Running, nullptr}; } - CallbackSkill::CallbackSkill() : - Skill(GetSkillDescription()) - {} + CallbackSkill::CallbackSkill() : Skill(GetSkillDescription()) + { + } - SkillDescription CallbackSkill::GetSkillDescription() + SkillDescription + CallbackSkill::GetSkillDescription() { - return SkillDescription{ - "ShowMeCallbacks", - "This skill does shows callbacks", - {}, - armarx::core::time::Duration::MilliSeconds(1000), - nullptr - }; + return SkillDescription{"ShowMeCallbacks", + "This skill does shows callbacks", + {}, + armarx::core::time::Duration::MilliSeconds(1000), + nullptr}; } - Skill::MainResult CallbackSkill::main(const MainInput& in) + Skill::MainResult + CallbackSkill::main(const MainInput& in) { ARMARX_IMPORTANT << "Logging three updates via the callback"; auto up1 = std::make_shared<aron::data::Dict>(); @@ -132,23 +139,26 @@ namespace armarx::skills::provider return {TerminatedSkillStatus::Succeeded, nullptr}; } + SkillProviderExample::SkillProviderExample() : SkillProviderComponentPluginUser() + { + } - SkillProviderExample::SkillProviderExample() : - SkillProviderComponentPluginUser() - {} - - armarx::PropertyDefinitionsPtr SkillProviderExample::createPropertyDefinitions() + armarx::PropertyDefinitionsPtr + SkillProviderExample::createPropertyDefinitions() { - armarx::PropertyDefinitionsPtr defs = new ComponentPropertyDefinitions(getConfigIdentifier()); + armarx::PropertyDefinitionsPtr defs = + new ComponentPropertyDefinitions(getConfigIdentifier()); return defs; } - std::string SkillProviderExample::getDefaultName() const + std::string + SkillProviderExample::getDefaultName() const { return "SkillProviderExample"; } - void SkillProviderExample::onInitComponent() + void + SkillProviderExample::onInitComponent() { // Add example skill addSkill(std::make_unique<HelloWorldSkill>()); @@ -160,10 +170,32 @@ namespace armarx::skills::provider fooDesc.description = "This skill does exactly nothing."; fooDesc.skillName = "Foo"; fooDesc.timeout = armarx::core::time::Duration::MilliSeconds(1000); - addSkill([](const std::string& clientId, const aron::data::DictPtr&){ - std::cout << "Hello from Foo. The skill was called from " << clientId << "." << std::endl; - return TerminatedSkillStatus::Succeeded; - }, fooDesc); + addSkill( + [](const std::string& clientId, const aron::data::DictPtr&) + { + std::cout << "Hello from Foo. The skill was called from " << clientId << "." + << std::endl; + return TerminatedSkillStatus::Succeeded; + }, + fooDesc); + } + + // Add another lambda example skill + { + skills::SkillDescription fooDesc; + fooDesc.acceptedType = nullptr; // accept everything + fooDesc.description = "This skill dies hard."; + fooDesc.skillName = "Die"; + fooDesc.timeout = armarx::core::time::Duration::MilliSeconds(1000); + addSkill( + [](const std::string& clientId, const aron::data::DictPtr&) + { + std::cout << "bye bye... segfaulting on purpose now!" << std::endl; + Skill* nullSkill = NULL; + nullSkill->getSkillId(); // DEAD! + return TerminatedSkillStatus::Succeeded; + }, + fooDesc); } // Add another example skill @@ -176,18 +208,18 @@ namespace armarx::skills::provider addSkill(std::make_unique<ChainingSkill>()); } - void SkillProviderExample::onConnectComponent() + void + SkillProviderExample::onConnectComponent() { - } - void SkillProviderExample::onDisconnectComponent() + void + SkillProviderExample::onDisconnectComponent() { - } - void SkillProviderExample::onExitComponent() + void + SkillProviderExample::onExitComponent() { - } -} +} // namespace armarx::skills::provider diff --git a/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.cpp b/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.cpp index edc9eebb6d619dd09de033ac2959b4858d263246..28fa685ab34a4ce563613c20a9cd8daac78c6c70 100644 --- a/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.cpp +++ b/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.cpp @@ -428,10 +428,10 @@ namespace armarx } { - auto it = new QTreeWidgetItem( - widget.treeWidgetSkillDetails, - {QString::fromStdString("Robot"), - QString::fromStdString(simox::alg::join(skillDesc.robots, ", "))}); + auto it = new QTreeWidgetItem(widget.treeWidgetSkillDetails, + {QString::fromStdString("Available profiles"), + QString::fromStdString(simox::alg::join( + simox::alg::get_keys(skillDesc.profiles), ", "))}); widget.treeWidgetSkillDetails->addTopLevelItem(it); } @@ -453,7 +453,8 @@ namespace armarx skillsArgumentsTreeWidgetItem = new QTreeWidgetItem(widget.treeWidgetSkillDetails, {QString::fromStdString("Arguments")}); auto aron_args = aron::type::Object::FromAronObjectDTO(skillDesc.acceptedType); - auto default_args = aron::data::Dict::FromAronDictDTO(skillDesc.defaultParams); + auto default_args = + nullptr; //aron::data::Dict::FromAronDictDTO(skillDesc.defaultParams); TODO! aronTreeWidgetController = std::make_shared<AronTreeWidgetController>( widget.treeWidgetSkillDetails, skillsArgumentsTreeWidgetItem, aron_args, default_args); diff --git a/source/RobotAPI/interface/skills/SkillProviderInterface.ice b/source/RobotAPI/interface/skills/SkillProviderInterface.ice index ed40611c800bfccba6f44310ca5d88639d83c02f..b7aad029ed84a8918fd68c7fda76fc325e2c6241 100644 --- a/source/RobotAPI/interface/skills/SkillProviderInterface.ice +++ b/source/RobotAPI/interface/skills/SkillProviderInterface.ice @@ -58,26 +58,41 @@ module armarx string skillName; }; + // A parameterization profile + struct SkillProfile + { + string profileName; + string predecessorProfileName; // may be empty + aron::data::dto::Dict parameterization; + }; + + // A list of parameterization profiles. Note that the first element is recognized as root. Following elements overwrite the previous. + dictionary<string, SkillProfile> SkillProfileDict; + // Description of a skill, independant of a provider // A skill is nothing but a executable thing, which can be executed on one or more 'robots' (empty means all) struct SkillDescription { - string skillName; // the name of the skill - string description; // a human readable description of what the skill does. Used in GUI - StringList robots; // the names of the robots that are able to execute that skill - long timeoutMs; // in milliseconds, can be set to -1 for infinite - aron::type::dto::AronObject acceptedType; // the name of the object is irrelevant and only used in GUI. nullptr if not set - aron::data::dto::Dict defaultParams; // the default parameterization used in GUI. nullptr if not set + string skillName; // the name of the skill + string + description; // a human readable description of what the skill does. Used in GUI + SkillProfileDict profiles; // a dict of profiles + long timeoutMs; // in milliseconds, can be set to -1 for infinite + aron::type::dto::AronObject + acceptedType; // the name of the object is irrelevant and only used in GUI. nullptr if not set }; + dictionary<string, SkillDescription> SkillDescriptionMap; // Input to a provider to execute a skill struct SkillExecutionRequest { string skillName; // the id of the skill - string executorName; // the name of the component/lib/skill that called the execution of the skill + string + executorName; // the name of the component/lib/skill that called the execution of the skill aron::data::dto::Dict params; // the used parameterization - callback::dti::SkillProviderCallbackInterface* callbackInterface; // use nullptr if you do not want to have callbacks + callback::dti::SkillProviderCallbackInterface* + callbackInterface; // use nullptr if you do not want to have callbacks }; // The status enum of a skill @@ -99,17 +114,20 @@ module armarx // Status updates of a skill struct SkillStatusUpdateHeader { - SkillID skillId; // the id of the skill - string executorName; // the name of the component/lib/skill that called the execution of the skill - aron::data::dto::Dict usedParams; // the used parameterization - callback::dti::SkillProviderCallbackInterface* usedCallbackInterface; // the used callback interface. Probably a prx to the manager - Execution::Status status; // the current status of the skill + SkillID skillId; // the id of the skill + string + executorName; // the name of the component/lib/skill that called the execution of the skill + aron::data::dto::Dict usedParams; // the used parameterization + callback::dti::SkillProviderCallbackInterface* + usedCallbackInterface; // the used callback interface. Probably a prx to the manager + Execution::Status status; // the current status of the skill }; struct SkillStatusUpdate { - SkillStatusUpdateHeader header; - aron::data::dto::Dict data; // data, attached to the status update. If send via a callback, this data may be used by the callback interface + SkillStatusUpdateHeader header; + aron::data::dto::Dict + data; // data, attached to the status update. If send via a callback, this data may be used by the callback interface }; dictionary<string, SkillStatusUpdate> SkillStatusUpdateMap; @@ -155,4 +173,3 @@ module armarx } } } - diff --git a/source/RobotAPI/libraries/armem_skills/aron/Skill.xml b/source/RobotAPI/libraries/armem_skills/aron/Skill.xml index abd89ebd82a7d30d19c1945444d1dd8f5d650bfd..a4f7400e94ae9ee33d5eb82034b1c6eb37799484 100644 --- a/source/RobotAPI/libraries/armem_skills/aron/Skill.xml +++ b/source/RobotAPI/libraries/armem_skills/aron/Skill.xml @@ -11,21 +11,38 @@ The memory should look like the following: <?xml version="1.0" encoding="UTF-8" ?> <AronTypeDefinition> <GenerateTypes> - <Object name='armarx::skills::arondto::SkillDescription'> - <ObjectChild key='skillName'> + <Object name='armarx::skills::arondto::SkillProfile'> + + <ObjectChild key='profileName'> <String /> </ObjectChild> - <ObjectChild key='robots'> - <List> - <String /> - </List> + <ObjectChild key='predecessorProfileName'> + <String /> + </ObjectChild> + + <ObjectChild key='parameterization'> + <AnyObject shared_ptr="1" /> + </ObjectChild> + + </Object> + + + <Object name='armarx::skills::arondto::SkillDescription'> + <ObjectChild key='skillName'> + <String /> </ObjectChild> <ObjectChild key='description'> <String /> </ObjectChild> + <ObjectChild key='profiles'> + <Dict> + <armarx::skills::arondto::SkillProfile /> + </Dict> + </ObjectChild> + <ObjectChild key='iceInfo'> <String /> </ObjectChild> @@ -40,7 +57,7 @@ The memory should look like the following: </Object> - <Object name='armarx::skills::arondto::SkillExecutionRequest'> + <Object name='armarx::skills::arondto::SkillExecutionInfo'> <ObjectChild key='providerName'> <String /> </ObjectChild> @@ -49,33 +66,30 @@ The memory should look like the following: <String /> </ObjectChild> - <ObjectChild key='executorName'> - <String /> - </ObjectChild> - <ObjectChild key='params'> <AnyObject shared_ptr="1" /> </ObjectChild> - </Object> - <Object name='armarx::skills::arondto::SkillExecutionEvent'> + <Object name='armarx::skills::arondto::CompositeSkillExecutionParams'> <ObjectChild key='providerName'> - <String /> + <List> + <armarx::skills::arondto::SkillExecutionInfo /> + </List> </ObjectChild> + </Object> - <ObjectChild key='skillName'> + <Object name='armarx::skills::arondto::SkillExecutionRequest' extends="armarx::skills::arondto::SkillExecutionInfo"> + <ObjectChild key='executorName'> <String /> </ObjectChild> + </Object> + <Object name='armarx::skills::arondto::SkillExecutionEvent' extends="armarx::skills::arondto::SkillExecutionInfo"> <ObjectChild key='status'> <String /> </ObjectChild> - <ObjectChild key='params'> - <AnyObject shared_ptr="1" /> - </ObjectChild> - <ObjectChild key='data'> <AnyObject shared_ptr="1" /> </ObjectChild> diff --git a/source/RobotAPI/libraries/armem_skills/server/segment/ExecutableSkillLibrarySegment.cpp b/source/RobotAPI/libraries/armem_skills/server/segment/ExecutableSkillLibrarySegment.cpp index 1a342fe0cde09bd59821bb93374025cd8866e782..068715f2ffba5accd7b1fcd6729578377ccf707f 100644 --- a/source/RobotAPI/libraries/armem_skills/server/segment/ExecutableSkillLibrarySegment.cpp +++ b/source/RobotAPI/libraries/armem_skills/server/segment/ExecutableSkillLibrarySegment.cpp @@ -38,7 +38,14 @@ namespace armarx::skills::segment skillDescription.skillName = desc.skillName; skillDescription.description = desc.description; skillDescription.iceInfo = info.provider->ice_toString(); - skillDescription.robots = desc.robots; + for (const auto& [key, p] : desc.profiles) + { + skillDescription.profiles[key] = {}; + skillDescription.profiles[key].profileName = p.profileName; + skillDescription.profiles[key].predecessorProfileName = p.predecessorProfileName; + skillDescription.profiles[key].parameterization = + aron::data::Dict::FromAronDictDTO(p.parameterization); + } skillDescription.timeoutMs = desc.timeoutMs; if (desc.acceptedType) diff --git a/source/RobotAPI/libraries/skills/provider/SkillDescription.cpp b/source/RobotAPI/libraries/skills/provider/SkillDescription.cpp index 4e195f39e3953d47c98371023ecb90d4c95f9fab..3fec65dd9e1d1edf405202c3aaa0bc6df89392ad 100644 --- a/source/RobotAPI/libraries/skills/provider/SkillDescription.cpp +++ b/source/RobotAPI/libraries/skills/provider/SkillDescription.cpp @@ -1,19 +1,35 @@ #include "SkillDescription.h" +#include <ArmarXCore/core/ice_conversions.h> + namespace armarx { namespace skills { - provider::dto::SkillDescription SkillDescription::toIce() const + + provider::dto::SkillProfile + SkillProfile::toIce() const + { + provider::dto::SkillProfile ret; + ret.profileName = profileName; + ret.predecessorProfileName = predecessorProfileName; + ret.parameterization = parameterization->toAronDictDTO(); + return ret; + } + + provider::dto::SkillDescription + SkillDescription::toIce() const { provider::dto::SkillDescription ret; ret.acceptedType = aron::type::Object::ToAronObjectDTO(acceptedType); ret.description = description; ret.skillName = skillName; - ret.robots = robots; + for (const auto& [key, p] : profiles) + { + ret.profiles[key] = p.toIce(); + } ret.timeoutMs = timeout.toMilliSeconds(); - ret.defaultParams = aron::data::Dict::ToAronDictDTO(defaultParams); return ret; } - } -} + } // namespace skills +} // namespace armarx diff --git a/source/RobotAPI/libraries/skills/provider/SkillDescription.h b/source/RobotAPI/libraries/skills/provider/SkillDescription.h index 57c3c93b18230c81b4152d9d915e4d2337beb294..42dbd46e8661fb1c1e23e223139835e2524b8fb0 100644 --- a/source/RobotAPI/libraries/skills/provider/SkillDescription.h +++ b/source/RobotAPI/libraries/skills/provider/SkillDescription.h @@ -13,16 +13,29 @@ namespace armarx { namespace skills { + struct SkillProfile + { + static const constexpr char* ROOT_PROFILE_NAME = "root"; + static const constexpr char* NO_PREDECESSOR = ""; + + std::string profileName = ROOT_PROFILE_NAME; + std::string predecessorProfileName = ""; + aron::data::DictPtr parameterization = nullptr; + + provider::dto::SkillProfile toIce() const; + }; + struct SkillDescription { - std::string skillName = "NOT INITIALIZED YET"; - std::string description = "NOT INITIALIZED YET"; - std::vector<std::string> robots = {}; - armarx::core::time::Duration timeout = armarx::core::time::Duration::MilliSeconds(-1); - aron::type::ObjectPtr acceptedType = nullptr; - aron::data::DictPtr defaultParams = nullptr; + static const constexpr char* SKILL_NOT_INITIALIZED = "NOT INITIALIZED YET"; + + std::string skillName = SKILL_NOT_INITIALIZED; + std::string description = SKILL_NOT_INITIALIZED; + std::map<std::string, SkillProfile> profiles = {}; + armarx::core::time::Duration timeout = armarx::core::time::Duration::MilliSeconds(-1); + aron::type::ObjectPtr acceptedType = nullptr; provider::dto::SkillDescription toIce() const; }; - } -} + } // namespace skills +} // namespace armarx diff --git a/source/RobotAPI/libraries/skills/provider/SkillProxy.cpp b/source/RobotAPI/libraries/skills/provider/SkillProxy.cpp index e0ebdb3b653a1be1d59d9b945ac6b35c58962595..be2aa65cb30d2c385c4977bf1dea98c7d3a0a4ea 100644 --- a/source/RobotAPI/libraries/skills/provider/SkillProxy.cpp +++ b/source/RobotAPI/libraries/skills/provider/SkillProxy.cpp @@ -4,25 +4,29 @@ namespace armarx { namespace skills { - SkillProxy::SkillProxy(const manager::dti::SkillManagerInterfacePrx& manager, const SkillID& skillId) : - manager(manager), - skillId(skillId) + SkillProxy::SkillProxy(const manager::dti::SkillManagerInterfacePrx& manager, + const SkillID& skillId) : + manager(manager), skillId(skillId) { } - SkillProxy::SkillProxy(const manager::dti::SkillManagerInterfacePrx& manager, const std::string& skillProviderName, const std::string& skillName) : - manager(manager), - skillId(skillProviderName, skillName) + SkillProxy::SkillProxy(const manager::dti::SkillManagerInterfacePrx& manager, + const std::string& skillProviderName, + const std::string& skillName) : + manager(manager), skillId(skillProviderName, skillName) { } - SkillProxy::SkillProxy(const manager::dti::SkillManagerInterfacePrx& manager, const std::string& skillProviderName, const SkillDescription& skillDesc) : - manager(manager), - skillId(skillProviderName, skillDesc.skillName) + SkillProxy::SkillProxy(const manager::dti::SkillManagerInterfacePrx& manager, + const std::string& skillProviderName, + const SkillDescription& skillDesc) : + manager(manager), skillId(skillProviderName, skillDesc.skillName) { } - TerminatedSkillStatusUpdate SkillProxy::executeFullSkill(const std::string& executorName, const aron::data::DictPtr& params) + TerminatedSkillStatusUpdate + SkillProxy::executeFullSkill(const std::string& executorName, + const aron::data::DictPtr& params) { skills::manager::dto::SkillExecutionRequest req; req.executorName = executorName; @@ -33,7 +37,9 @@ namespace armarx return TerminatedSkillStatusUpdate::FromIce(terminatingUpdate); } - IceInternal::Handle<Ice::AsyncResult> SkillProxy::begin_executeFullSkill(const std::string& executorName, const aron::data::DictPtr& params) + IceInternal::Handle<Ice::AsyncResult> + SkillProxy::begin_executeFullSkill(const std::string& executorName, + const aron::data::DictPtr& params) { skills::manager::dto::SkillExecutionRequest req; req.executorName = executorName; @@ -43,5 +49,36 @@ namespace armarx auto future = manager->begin_executeSkill(req); return future; } - } -} + + void + SkillProxy::abortSkill(const std::string& executorName) + { + // TODO: This will be used in the future, do not remove it! + (void)executorName; + manager->abortSkill(skillId.providerName, skillId.skillName); + } + + aron::data::DictPtr + SkillProxy::getDefaultParameters(const std::string& profileName) + { + // fabian.peller TODO: + return nullptr; + } + + TerminatedSkillStatusUpdate + SkillProxy::executeFullSkillWithDefaultParams(const std::string& executorName, + const std::string& profileName, + const aron::data::DictPtr& params) + { + return executeFullSkill(executorName, params); + } + + IceInternal::Handle<Ice::AsyncResult> + SkillProxy::begin_executeFullSkillWithDefaultParams(const std::string& executorName, + const std::string& profileName, + const aron::data::DictPtr& params) + { + return begin_executeFullSkill(executorName, params); + } + } // namespace skills +} // namespace armarx diff --git a/source/RobotAPI/libraries/skills/provider/SkillProxy.h b/source/RobotAPI/libraries/skills/provider/SkillProxy.h index 6e8ddc5c74ec5e3d36423984d67807ae12da0680..1ea41ec695bd3743f210ca48bb7636f2667c8c2a 100644 --- a/source/RobotAPI/libraries/skills/provider/SkillProxy.h +++ b/source/RobotAPI/libraries/skills/provider/SkillProxy.h @@ -10,17 +10,42 @@ namespace armarx class SkillProxy : public armarx::Logging { public: - SkillProxy(const manager::dti::SkillManagerInterfacePrx& manager, const SkillID& skillId); - SkillProxy(const manager::dti::SkillManagerInterfacePrx& manager, const std::string& skillProviderName, const std::string& skillName); - SkillProxy(const manager::dti::SkillManagerInterfacePrx& manager, const std::string& skillProviderName, const SkillDescription& skillDesc); + SkillProxy(const manager::dti::SkillManagerInterfacePrx& manager, + const SkillID& skillId); + SkillProxy(const manager::dti::SkillManagerInterfacePrx& manager, + const std::string& skillProviderName, + const std::string& skillName); + SkillProxy(const manager::dti::SkillManagerInterfacePrx& manager, + const std::string& skillProviderName, + const SkillDescription& skillDesc); + + // Provide a similar API as the skillprovider + TerminatedSkillStatusUpdate + executeFullSkill(const std::string& executorName, + const aron::data::DictPtr& params = nullptr); + IceInternal::Handle<Ice::AsyncResult> + begin_executeFullSkill(const std::string& executorName, + const aron::data::DictPtr& params = nullptr); + + void abortSkill(const std::string& executorName); + + // Utiliy methods + aron::data::DictPtr getDefaultParameters(const std::string& profileName); + + TerminatedSkillStatusUpdate + executeFullSkillWithDefaultParams(const std::string& executorName, + const std::string& profileName, + const aron::data::DictPtr& params = nullptr); + IceInternal::Handle<Ice::AsyncResult> + begin_executeFullSkillWithDefaultParams(const std::string& executorName, + const std::string& profileName, + const aron::data::DictPtr& params = nullptr); - TerminatedSkillStatusUpdate executeFullSkill(const std::string& executorName, const aron::data::DictPtr& params = nullptr); - IceInternal::Handle<Ice::AsyncResult> begin_executeFullSkill(const std::string& executorName, const aron::data::DictPtr& params = nullptr); private: const manager::dti::SkillManagerInterfacePrx& manager; const SkillID skillId; }; - } -} + } // namespace skills +} // namespace armarx