diff --git a/data/RobotAPI/sensors/OptoForceCalibration.xml b/data/RobotAPI/sensors/OptoForceCalibration.xml new file mode 100644 index 0000000000000000000000000000000000000000..b863b0de893b1dc467e5ff2b0418c163539badc5 --- /dev/null +++ b/data/RobotAPI/sensors/OptoForceCalibration.xml @@ -0,0 +1,11 @@ +<Calibration> + <Daq serialNumber="KIT0A003"> + <Sensor nominalCapacity="10" counts_at_nc="3870" name="DSE0A102"/> + <Sensor nominalCapacity="10" counts_at_nc="4001" name="DSE0A103"/> + <Sensor nominalCapacity="10" counts_at_nc="4021" name="DSE0A104"/> + <Sensor nominalCapacity="10" counts_at_nc="4048" name="DSE0A108"/> + </Daq> + <Daq serialNumber="DSE0A114"> + <Sensor nominalCapacity="10" counts_at_nc="4048" name="DSE0A114" /> + </Daq> +</Calibration> diff --git a/etc/cmake/FindOptoForceOMD.cmake b/etc/cmake/FindOptoForceOMD.cmake new file mode 100644 index 0000000000000000000000000000000000000000..44b699650be8468416e08521b40a0b41a4cf8e4f --- /dev/null +++ b/etc/cmake/FindOptoForceOMD.cmake @@ -0,0 +1,49 @@ +# - Try to find OptoForceOMD +# Once done this will define +# +# OptoForceOMD_FOUND - OptoForceOMD found +# OptoForceOMD_INCLUDE_DIR - the OptoForceOMD include directory +# OptoForceOMD_LIBRARIES - OptoForceOMD library +# + +FIND_PATH(OptoForceOMD_INCLUDE_DIR NAMES opto.h + PATHS + $ENV{OptoForceOMD_DIR}/include/ + $ENV{OptoForceOMD_DIR}/include/OptoForceOMD/ + ${OptoForceOMD_DIR}/include/ + ${OptoForceOMD_DIR}/include/OptoForceOMD/ + ENV CPATH + /usr/include/OptoForceOMD/ + /usr/local/include/OptoForceOMD/ + /opt/local/include/OptoForceOMD/ + NO_DEFAULT_PATH +) + + +FIND_LIBRARY(OptoForceOMD_LIBRARIES NAMES libOMD.so + PATHS + $ENV{OptoForceOMD_DIR}/lib + ${OptoForceOMD_DIR}/lib + ENV LD_LIBRARY_PATH + ENV LIBRARY_PATH + /usr/lib + /usr/local/lib + /opt/local/lib + NO_DEFAULT_PATH +) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set OODL_YOUBOT_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(OptoForceOMD DEFAULT_MSG + OptoForceOMD_LIBRARIES OptoForceOMD_INCLUDE_DIR) + +set(OptoForceOMD_FOUND ${OPTOFORCEOMD_FOUND}) # CMake UPPERCASE-FUNTIME! + +#message( "OptoForceOMD_FOUND:" ${OptoForceOMD_FOUND}) +#message( "OPTOFORCEOMD_FOUND:" ${OPTOFORCEOMD_FOUND}) +#message( "OptoForceOMD_LIBRARIES:" ${OptoForceOMD_LIBRARIES}) +#message( "OptoForceOMD_INCLUDE_DIR:" ${OptoForceOMD_INCLUDE_DIR}) + +# show the OptoForceOMD_INCLUDE_DIR and OptoForceOMD_LIBRARY_DIR variables only in the advanced view +MARK_AS_ADVANCED(OptoForceOMD_INCLUDE_DIR OptoForceOMD_LIBRARIES) diff --git a/scenarios/Armar3Replay/Armar3Replay.scx b/scenarios/Armar3Replay/Armar3Replay.scx new file mode 100644 index 0000000000000000000000000000000000000000..5d05f1e1ff57737f4a15bf97ada9840e38fc56a7 --- /dev/null +++ b/scenarios/Armar3Replay/Armar3Replay.scx @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<scenario name="Armar3Replay" lastChange="2017-03-01.15:34:31" creation="2017-02-14.19:27:46" globalConfigName="./config/global.cfg" package="RobotAPI"> + <application name="SystemObserver" instance="" package="ArmarXCore"/> + <application name="DebugObserver" instance="" package="ArmarXCore"/> + <application name="KinematicUnitObserver" instance="" package="RobotAPI"/> + <application name="PlatformUnitObserver" instance="" package="RobotAPI"/> + <application name="ForceTorqueObserver" instance="" package="RobotAPI"/> + <application name="KinematicUnitSimulation" instance="" package="RobotAPI"/> + <application name="RobotStateComponent" instance="" package="RobotAPI"/> + <application name="InertialMeasurementUnitObserverApp" instance="" package="RobotAPI"/> + <application name="ConditionHandler" instance="" package="ArmarXCore"/> +</scenario> + diff --git a/scenarios/Armar3Replay/config/ConditionHandler.cfg b/scenarios/Armar3Replay/config/ConditionHandler.cfg new file mode 100644 index 0000000000000000000000000000000000000000..c914eec2429e53ce91bb74c8da5201318c468783 --- /dev/null +++ b/scenarios/Armar3Replay/config/ConditionHandler.cfg @@ -0,0 +1,172 @@ +# ================================================================== +# ConditionHandler 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: no +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files +# Attributes: +# - Default: ${HOME}/.armarx/mongo/.cache +# - Case sensitivity: no +# - Required: no +# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache + + +# ArmarX.ConditionHandler.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.ConditionHandler.EnableProfiling = 0 + + +# ArmarX.ConditionHandler.HistoryLength: Length of condition history kept by the conditionhandler +# Attributes: +# - Default: 1000 +# - Case sensitivity: no +# - Required: no +# ArmarX.ConditionHandler.HistoryLength = 1000 + + +# ArmarX.ConditionHandler.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.ConditionHandler.MinimumLoggingLevel = Undefined + + +# ArmarX.ConditionHandler.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ConditionHandler.ObjectName = "" + + +# ArmarX.ConditionHandler.Observers: Comma seperated observer list +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ConditionHandler.Observers = "" + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: no +# - 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: no +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DisableLogging = 0 + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.EnableProfiling = 0 + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RedirectStdout = 1 + + +# 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: no +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.StartDebuggerOnCrash = 0 + + +# 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: no +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.UseTimeServer = 0 + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: no +# - Required: no +# ArmarX.Verbosity = Info + + +# Ice.Config: Custom Property +# Attributes: +# - Default: ::NOT_DEFINED:: +# - Case sensitivity: no +# - Required: no +# Ice.Config = ::NOT_DEFINED:: + + diff --git a/scenarios/Armar3Replay/config/DebugObserver.cfg b/scenarios/Armar3Replay/config/DebugObserver.cfg new file mode 100644 index 0000000000000000000000000000000000000000..9d886530a24b6eed9b407280060d0cd8566fcca7 --- /dev/null +++ b/scenarios/Armar3Replay/config/DebugObserver.cfg @@ -0,0 +1,183 @@ +# ================================================================== +# 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: no +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files +# Attributes: +# - Default: ${HOME}/.armarx/mongo/.cache +# - Case sensitivity: no +# - Required: no +# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DebugObserver.CreateUpdateFrequenciesChannel = 0 + + +# ArmarX.DebugObserver.DebugObserverTopicName: Name of the topic the DebugObserver listens on +# Attributes: +# - Default: DebugObserver +# - Case sensitivity: no +# - Required: no +# ArmarX.DebugObserver.DebugObserverTopicName = DebugObserver + + +# ArmarX.DebugObserver.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DebugObserver.EnableProfiling = 0 + + +# ArmarX.DebugObserver.MaxHistoryRecordFrequency: The Observer history is written with this maximum frequency. Everything faster is being skipped. +# Attributes: +# - Default: 50 +# - Case sensitivity: no +# - Required: no +# ArmarX.DebugObserver.MaxHistoryRecordFrequency = 50 + + +# ArmarX.DebugObserver.MaxHistorySize: Maximum number of entries in the Observer history +# Attributes: +# - Default: 5000 +# - Case sensitivity: no +# - Required: no +# ArmarX.DebugObserver.MaxHistorySize = 5000 + + +# ArmarX.DebugObserver.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.DebugObserver.MinimumLoggingLevel = Undefined + + +# ArmarX.DebugObserver.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: no +# - 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: no +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DisableLogging = 0 + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.EnableProfiling = 0 + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RedirectStdout = 1 + + +# 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: no +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.StartDebuggerOnCrash = 0 + + +# 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: no +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.UseTimeServer = 0 + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: no +# - Required: no +# ArmarX.Verbosity = Info + + + + + diff --git a/scenarios/Armar3Replay/config/ForceTorqueObserver.cfg b/scenarios/Armar3Replay/config/ForceTorqueObserver.cfg new file mode 100644 index 0000000000000000000000000000000000000000..a347a99273cf88aebad227ab50bfc6d07a358f44 --- /dev/null +++ b/scenarios/Armar3Replay/config/ForceTorqueObserver.cfg @@ -0,0 +1,254 @@ +# ================================================================== +# ForceTorqueObserver 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: no +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files +# Attributes: +# - Default: ${HOME}/.armarx/mongo/.cache +# - Case sensitivity: no +# - Required: no +# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: no +# - 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: no +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DisableLogging = 0 + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.EnableProfiling = 0 + + +# ArmarX.ForceTorqueUnitObserver.CreateUpdateFrequenciesChannel: If true, an additional channel is created that shows the update frequency of every other channel in that observer. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.ForceTorqueUnitObserver.CreateUpdateFrequenciesChannel = 0 + + +# ArmarX.ForceTorqueUnitObserver.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.ForceTorqueUnitObserver.EnableProfiling = 0 + + +# ArmarX.ForceTorqueUnitObserver.ForceTorqueTopicName: Name of the ForceTorqueUnit Topic +# Attributes: +# - Case sensitivity: no +# - Required: yes +ArmarX.ForceTorqueUnitObserver.ForceTorqueTopicName = Armar3ForceTorqueUnitState + + +# ArmarX.ForceTorqueUnitObserver.ForceVisualizerFactor: Factor by which the forces are scaled to fit into 0..1 (only for visulization) +# Attributes: +# - Default: 0.00999999978 +# - Case sensitivity: no +# - Required: no +# ArmarX.ForceTorqueUnitObserver.ForceVisualizerFactor = 0.00999999978 + + +# ArmarX.ForceTorqueUnitObserver.MaxExpectedTorqueValue: The torque visualization circle reaches the full circle at this value +# Attributes: +# - Default: 30 +# - Case sensitivity: no +# - Required: no +# ArmarX.ForceTorqueUnitObserver.MaxExpectedTorqueValue = 30 + + +# ArmarX.ForceTorqueUnitObserver.MaxForceArrowLength: Length of the force visu arrow in mm +# Attributes: +# - Default: 150 +# - Case sensitivity: no +# - Required: no +# ArmarX.ForceTorqueUnitObserver.MaxForceArrowLength = 150 + + +# ArmarX.ForceTorqueUnitObserver.MaxHistoryRecordFrequency: The Observer history is written with this maximum frequency. Everything faster is being skipped. +# Attributes: +# - Default: 50 +# - Case sensitivity: no +# - Required: no +# ArmarX.ForceTorqueUnitObserver.MaxHistoryRecordFrequency = 50 + + +# ArmarX.ForceTorqueUnitObserver.MaxHistorySize: Maximum number of entries in the Observer history +# Attributes: +# - Default: 5000 +# - Case sensitivity: no +# - Required: no +# ArmarX.ForceTorqueUnitObserver.MaxHistorySize = 5000 + + +# ArmarX.ForceTorqueUnitObserver.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.ForceTorqueUnitObserver.MinimumLoggingLevel = Undefined + + +# ArmarX.ForceTorqueUnitObserver.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +ArmarX.ForceTorqueUnitObserver.ObjectName = "Armar3ForceTorqueObserver" + + +# ArmarX.ForceTorqueUnitObserver.RobotStateComponentName: Name of the RobotStateComponent that should be used +# Attributes: +# - Default: RobotStateComponent +# - Case sensitivity: no +# - Required: no +# ArmarX.ForceTorqueUnitObserver.RobotStateComponentName = RobotStateComponent + + +# ArmarX.ForceTorqueUnitObserver.RobotUpdateFrequency: Update frequency of the local robot +# Attributes: +# - Default: 50 +# - Case sensitivity: no +# - Required: no +# ArmarX.ForceTorqueUnitObserver.RobotUpdateFrequency = 50 + + +# ArmarX.ForceTorqueUnitObserver.SensorRobotNodeMapping: Triplets of sensor node name, target frame robot node name and optional channel name: Sensor values are also reported in the frame of the robot node: e. g. SensorName:RobotNodeName[:ChannelName],SensorName2:RobotNodeName2[:ChannelName2] +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ForceTorqueUnitObserver.SensorRobotNodeMapping = "" + + +# ArmarX.ForceTorqueUnitObserver.TorqueVisuDeadZone: Torques below this threshold are not visualized. +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.ForceTorqueUnitObserver.TorqueVisuDeadZone = 1 + + +# ArmarX.ForceTorqueUnitObserver.VisualizeForce: Visualize the force with an arrow in the debug drawer +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.ForceTorqueUnitObserver.VisualizeForce = 1 + + +# ArmarX.ForceTorqueUnitObserver.VisualizeForceUpdateFrequency: Frequency with which the force is visualized +# Attributes: +# - Default: 30 +# - Case sensitivity: no +# - Required: no +# ArmarX.ForceTorqueUnitObserver.VisualizeForceUpdateFrequency = 30 + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RedirectStdout = 1 + + +# 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: no +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.StartDebuggerOnCrash = 0 + + +# 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: no +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.UseTimeServer = 0 + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: no +# - Required: no +# ArmarX.Verbosity = Info + + + + + diff --git a/scenarios/Armar3Replay/config/InertialMeasurementUnitObserverApp.cfg b/scenarios/Armar3Replay/config/InertialMeasurementUnitObserverApp.cfg new file mode 100644 index 0000000000000000000000000000000000000000..945ffa53ff237fe008cdd8732583df76642be278 --- /dev/null +++ b/scenarios/Armar3Replay/config/InertialMeasurementUnitObserverApp.cfg @@ -0,0 +1,191 @@ +# ================================================================== +# InertialMeasurementUnitObserverApp 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: no +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files +# Attributes: +# - Default: ${HOME}/.armarx/mongo/.cache +# - Case sensitivity: no +# - Required: no +# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: no +# - 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: no +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DisableLogging = 0 + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.EnableProfiling = 0 + + +# ArmarX.InertialMeasurementUnitObserver.CreateUpdateFrequenciesChannel: If true, an additional channel is created that shows the update frequency of every other channel in that observer. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.InertialMeasurementUnitObserver.CreateUpdateFrequenciesChannel = 0 + + +# ArmarX.InertialMeasurementUnitObserver.DebugDrawerTopic: Name of the DebugDrawerTopic +# Attributes: +# - Default: DebugDrawerUpdates +# - Case sensitivity: no +# - Required: no +# ArmarX.InertialMeasurementUnitObserver.DebugDrawerTopic = DebugDrawerUpdates + + +# ArmarX.InertialMeasurementUnitObserver.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.InertialMeasurementUnitObserver.EnableProfiling = 0 + + +# ArmarX.InertialMeasurementUnitObserver.IMUTopicName: Name of the IMU Topic. +# Attributes: +# - Default: IMUValues +# - Case sensitivity: no +# - Required: no +# ArmarX.InertialMeasurementUnitObserver.IMUTopicName = IMUValues + + +# ArmarX.InertialMeasurementUnitObserver.MaxHistoryRecordFrequency: The Observer history is written with this maximum frequency. Everything faster is being skipped. +# Attributes: +# - Default: 50 +# - Case sensitivity: no +# - Required: no +# ArmarX.InertialMeasurementUnitObserver.MaxHistoryRecordFrequency = 50 + + +# ArmarX.InertialMeasurementUnitObserver.MaxHistorySize: Maximum number of entries in the Observer history +# Attributes: +# - Default: 5000 +# - Case sensitivity: no +# - Required: no +# ArmarX.InertialMeasurementUnitObserver.MaxHistorySize = 5000 + + +# ArmarX.InertialMeasurementUnitObserver.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.InertialMeasurementUnitObserver.MinimumLoggingLevel = Undefined + + +# ArmarX.InertialMeasurementUnitObserver.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.InertialMeasurementUnitObserver.ObjectName = "" + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RedirectStdout = 1 + + +# 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: no +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.StartDebuggerOnCrash = 0 + + +# 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: no +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.UseTimeServer = 0 + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: no +# - Required: no +# ArmarX.Verbosity = Info + + + + + diff --git a/scenarios/Armar3Replay/config/KinematicUnitObserver.cfg b/scenarios/Armar3Replay/config/KinematicUnitObserver.cfg new file mode 100644 index 0000000000000000000000000000000000000000..6c97ffd09196717d33d192cbd0aaf0e1905ff71b --- /dev/null +++ b/scenarios/Armar3Replay/config/KinematicUnitObserver.cfg @@ -0,0 +1,205 @@ +# ================================================================== +# KinematicUnitObserver 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: no +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files +# Attributes: +# - Default: ${HOME}/.armarx/mongo/.cache +# - Case sensitivity: no +# - Required: no +# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: no +# - 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: no +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DisableLogging = 0 + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.EnableProfiling = 0 + + +# ArmarX.KinematicUnitObserver.CreateUpdateFrequenciesChannel: If true, an additional channel is created that shows the update frequency of every other channel in that observer. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitObserver.CreateUpdateFrequenciesChannel = 0 + + +# ArmarX.KinematicUnitObserver.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitObserver.EnableProfiling = 0 + + +# ArmarX.KinematicUnitObserver.MaxHistoryRecordFrequency: The Observer history is written with this maximum frequency. Everything faster is being skipped. +# Attributes: +# - Default: 50 +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitObserver.MaxHistoryRecordFrequency = 50 + + +# ArmarX.KinematicUnitObserver.MaxHistorySize: Maximum number of entries in the Observer history +# Attributes: +# - Default: 5000 +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitObserver.MaxHistorySize = 5000 + + +# ArmarX.KinematicUnitObserver.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitObserver.MinimumLoggingLevel = Undefined + + +# ArmarX.KinematicUnitObserver.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitObserver.ObjectName = "" + + +# ArmarX.KinematicUnitObserver.RobotFileName: Robot file name, e.g. robot_model.xml +# Attributes: +# - Case sensitivity: no +# - Required: yes +# ArmarX.KinematicUnitObserver.RobotFileName = ::_NOT_SET_:: + + +# ArmarX.KinematicUnitObserver.RobotFileNameProject: Project in which the robot filename is located (if robot is loaded from an external project) +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitObserver.RobotFileNameProject = "" + + +# ArmarX.KinematicUnitObserver.RobotNodeSetName: Robot node set name as defined in robot xml file, e.g. 'LeftArm' +# Attributes: +# - Case sensitivity: no +# - Required: yes +# ArmarX.KinematicUnitObserver.RobotNodeSetName = ::_NOT_SET_:: + + +# ArmarX.KinematicUnitObserver.inheritFrom: No Description +# Attributes: +# - Default: RobotConfig +# - Case sensitivity: no +# - Required: no +ArmarX.KinematicUnitObserver.inheritFrom = RobotConfig + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RedirectStdout = 1 + + +# 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: no +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.StartDebuggerOnCrash = 0 + + +# 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: no +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.UseTimeServer = 0 + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: no +# - Required: no +# ArmarX.Verbosity = Info + + + + + diff --git a/scenarios/Armar3Replay/config/KinematicUnitSimulation.cfg b/scenarios/Armar3Replay/config/KinematicUnitSimulation.cfg new file mode 100644 index 0000000000000000000000000000000000000000..c51ef744521dbdd5238bb7dc6fd020a38dfe6b15 --- /dev/null +++ b/scenarios/Armar3Replay/config/KinematicUnitSimulation.cfg @@ -0,0 +1,245 @@ +# ================================================================== +# KinematicUnitSimulation 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: no +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files +# Attributes: +# - Default: ${HOME}/.armarx/mongo/.cache +# - Case sensitivity: no +# - Required: no +# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: no +# - 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: no +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DisableLogging = 0 + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.EnableProfiling = 0 + + +# ArmarX.KinematicUnitSimulation.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitSimulation.EnableProfiling = 0 + + +# ArmarX.KinematicUnitSimulation.IntervalMs: The time in milliseconds between two calls to the simulation method. +# Attributes: +# - Default: 10 +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitSimulation.IntervalMs = 10 + + +# ArmarX.KinematicUnitSimulation.Kd: derivative gain of the PID position controller. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitSimulation.Kd = 0 + + +# ArmarX.KinematicUnitSimulation.Ki: integral gain of the PID position controller. +# Attributes: +# - Default: 0.00100000005 +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitSimulation.Ki = 0.00100000005 + + +# ArmarX.KinematicUnitSimulation.Kp: proportional gain of the PID position controller. +# Attributes: +# - Default: 3 +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitSimulation.Kp = 3 + + +# ArmarX.KinematicUnitSimulation.MaxAcceleration: Max acceleration of joints +# Attributes: +# - Default: 3.40282347e+38 +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitSimulation.MaxAcceleration = 3.40282347e+38 + + +# ArmarX.KinematicUnitSimulation.MaxDecceleration: Max decceleration of joints +# Attributes: +# - Default: 3.40282347e+38 +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitSimulation.MaxDecceleration = 3.40282347e+38 + + +# ArmarX.KinematicUnitSimulation.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitSimulation.MinimumLoggingLevel = Undefined + + +# ArmarX.KinematicUnitSimulation.Noise: Gaussian noise is added to the velocity. Value in Degree +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitSimulation.Noise = 0 + + +# ArmarX.KinematicUnitSimulation.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +ArmarX.KinematicUnitSimulation.ObjectName = Armar3KinematicUnit + + +# ArmarX.KinematicUnitSimulation.RobotFileName: Robot file name, e.g. robot_model.xml +# Attributes: +# - Case sensitivity: no +# - Required: yes +# ArmarX.KinematicUnitSimulation.RobotFileName = ::_NOT_SET_:: + + +# ArmarX.KinematicUnitSimulation.RobotFileNameProject: Project in which the robot filename is located (if robot is loaded from an external project) +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitSimulation.RobotFileNameProject = "" + + +# ArmarX.KinematicUnitSimulation.RobotNodeSetName: Robot node set name as defined in robot xml file, e.g. 'LeftArm' +# Attributes: +# - Case sensitivity: no +# - Required: yes +# ArmarX.KinematicUnitSimulation.RobotNodeSetName = ::_NOT_SET_:: + + +# ArmarX.KinematicUnitSimulation.UsePDControllerForJointControl: If true a PD controller is also used in Position Mode instead of setting the joint angles instantly +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.KinematicUnitSimulation.UsePDControllerForJointControl = 1 + + +# ArmarX.KinematicUnitSimulation.inheritFrom: No Description +# Attributes: +# - Default: RobotConfig +# - Case sensitivity: no +# - Required: no +ArmarX.KinematicUnitSimulation.inheritFrom = RobotConfig + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RedirectStdout = 1 + + +# 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: no +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.StartDebuggerOnCrash = 0 + + +# 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: no +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.UseTimeServer = 0 + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: no +# - Required: no +# ArmarX.Verbosity = Info + + + + + diff --git a/scenarios/Armar3Replay/config/PlatformUnitObserver.cfg b/scenarios/Armar3Replay/config/PlatformUnitObserver.cfg new file mode 100644 index 0000000000000000000000000000000000000000..3ee60be8d5cee4012e8b442e5287d6b4d9c3fc25 --- /dev/null +++ b/scenarios/Armar3Replay/config/PlatformUnitObserver.cfg @@ -0,0 +1,191 @@ +# ================================================================== +# PlatformUnitObserver 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: no +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files +# Attributes: +# - Default: ${HOME}/.armarx/mongo/.cache +# - Case sensitivity: no +# - Required: no +# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: no +# - 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: no +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DisableLogging = 0 + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.EnableProfiling = 0 + + +# ArmarX.KinematicUnitObserver.inheritFrom: No Description +# Attributes: +# - Default: RobotConfig +# - Case sensitivity: no +# - Required: no +ArmarX.KinematicUnitObserver.inheritFrom = RobotConfig + + +# ArmarX.PlatformUnitObserver.CreateUpdateFrequenciesChannel: If true, an additional channel is created that shows the update frequency of every other channel in that observer. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.PlatformUnitObserver.CreateUpdateFrequenciesChannel = 0 + + +# ArmarX.PlatformUnitObserver.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.PlatformUnitObserver.EnableProfiling = 0 + + +# ArmarX.PlatformUnitObserver.MaxHistoryRecordFrequency: The Observer history is written with this maximum frequency. Everything faster is being skipped. +# Attributes: +# - Default: 50 +# - Case sensitivity: no +# - Required: no +# ArmarX.PlatformUnitObserver.MaxHistoryRecordFrequency = 50 + + +# ArmarX.PlatformUnitObserver.MaxHistorySize: Maximum number of entries in the Observer history +# Attributes: +# - Default: 5000 +# - Case sensitivity: no +# - Required: no +# ArmarX.PlatformUnitObserver.MaxHistorySize = 5000 + + +# ArmarX.PlatformUnitObserver.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.PlatformUnitObserver.MinimumLoggingLevel = Undefined + + +# ArmarX.PlatformUnitObserver.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.PlatformUnitObserver.ObjectName = "" + + +# ArmarX.PlatformUnitObserver.PlatformName: Name of the platform (will publish values on PlatformName + 'State') +# Attributes: +# - Default: Platform +# - Case sensitivity: no +# - Required: no +# ArmarX.PlatformUnitObserver.PlatformName = Platform + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RedirectStdout = 1 + + +# 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: no +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.StartDebuggerOnCrash = 0 + + +# 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: no +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.UseTimeServer = 0 + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: no +# - Required: no +# ArmarX.Verbosity = Info + + + + + diff --git a/scenarios/Armar3Replay/config/RobotStateComponent.cfg b/scenarios/Armar3Replay/config/RobotStateComponent.cfg new file mode 100644 index 0000000000000000000000000000000000000000..48a9b5a91049b670bb9dd98fd7e08989d2630fa8 --- /dev/null +++ b/scenarios/Armar3Replay/config/RobotStateComponent.cfg @@ -0,0 +1,260 @@ +# ================================================================== +# RobotStateComponent 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: no +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files +# Attributes: +# - Default: ${HOME}/.armarx/mongo/.cache +# - Case sensitivity: no +# - Required: no +# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: no +# - 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: no +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DisableLogging = 0 + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.EnableProfiling = 0 + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RedirectStdout = 1 + + +# 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: no +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.RobotStateComponent.AgentName: Name of the agent for which the sensor values are provided +# Attributes: +# - Case sensitivity: no +# - Required: yes +# ArmarX.RobotStateComponent.AgentName = ::_NOT_SET_:: + + +# ArmarX.RobotStateComponent.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.RobotStateComponent.EnableProfiling = 0 + + +# ArmarX.RobotStateComponent.HistoryLength: Number of entries in the robot state history +# Attributes: +# - Default: 10000 +# - Case sensitivity: no +# - Required: no +# ArmarX.RobotStateComponent.HistoryLength = 10000 + + +# ArmarX.RobotStateComponent.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.RobotStateComponent.MinimumLoggingLevel = Undefined + + +# ArmarX.RobotStateComponent.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.RobotStateComponent.ObjectName = "" + + +# ArmarX.RobotStateComponent.RobotFileName: Filename of VirtualRobot robot model (e.g. robot_model.xml) +# Attributes: +# - Case sensitivity: no +# - Required: yes +# ArmarX.RobotStateComponent.RobotFileName = ::_NOT_SET_:: + + +# ArmarX.RobotStateComponent.RobotModelScaling: Scaling of the robot model +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RobotStateComponent.RobotModelScaling = 1 + + +# ArmarX.RobotStateComponent.RobotNodeSetName: Set of nodes that is controlled by the KinematicUnit +# Attributes: +# - Case sensitivity: no +# - Required: yes +# ArmarX.RobotStateComponent.RobotNodeSetName = ::_NOT_SET_:: + + +# ArmarX.RobotStateComponent.RobotStateReportingTopic: Name of the topic on which updates of the robot state are reported. +# Attributes: +# - Default: RobotStateUpdates +# - Case sensitivity: no +# - Required: no +# ArmarX.RobotStateComponent.RobotStateReportingTopic = RobotStateUpdates + + +# ArmarX.RobotStateComponent.inheritFrom: No Description +# Attributes: +# - Default: RobotConfig +# - Case sensitivity: no +# - Required: no +ArmarX.RobotStateComponent.inheritFrom = RobotConfig + + +# ArmarX.RobotStateObserver.CreateUpdateFrequenciesChannel: If true, an additional channel is created that shows the update frequency of every other channel in that observer. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.RobotStateObserver.CreateUpdateFrequenciesChannel = 0 + + +# ArmarX.RobotStateObserver.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.RobotStateObserver.EnableProfiling = 0 + + +# ArmarX.RobotStateObserver.MaxHistoryRecordFrequency: The Observer history is written with this maximum frequency. Everything faster is being skipped. +# Attributes: +# - Default: 50 +# - Case sensitivity: no +# - Required: no +# ArmarX.RobotStateObserver.MaxHistoryRecordFrequency = 50 + + +# ArmarX.RobotStateObserver.MaxHistorySize: Maximum number of entries in the Observer history +# Attributes: +# - Default: 5000 +# - Case sensitivity: no +# - Required: no +# ArmarX.RobotStateObserver.MaxHistorySize = 5000 + + +# ArmarX.RobotStateObserver.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.RobotStateObserver.MinimumLoggingLevel = Undefined + + +# ArmarX.RobotStateObserver.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.RobotStateObserver.ObjectName = "" + + +# ArmarX.RobotStateObserver.TCPsToReport: comma seperated list of nodesets' endeffectors, which poses and velocities that should be reported. * for all, empty for none +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.RobotStateObserver.TCPsToReport = "" + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.StartDebuggerOnCrash = 0 + + +# 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: no +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.UseTimeServer = 0 + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: no +# - Required: no +# ArmarX.Verbosity = Info + + + + + diff --git a/scenarios/Armar3Replay/config/SystemObserver.cfg b/scenarios/Armar3Replay/config/SystemObserver.cfg new file mode 100644 index 0000000000000000000000000000000000000000..759d45eb6531f66c46eb49b1883cbdd0b318b9c1 --- /dev/null +++ b/scenarios/Armar3Replay/config/SystemObserver.cfg @@ -0,0 +1,175 @@ +# ================================================================== +# SystemObserver 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: no +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files +# Attributes: +# - Default: ${HOME}/.armarx/mongo/.cache +# - Case sensitivity: no +# - Required: no +# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: no +# - 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: no +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DisableLogging = 0 + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.EnableProfiling = 0 + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RedirectStdout = 1 + + +# 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: no +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.StartDebuggerOnCrash = 0 + + +# ArmarX.SystemObserver.CreateUpdateFrequenciesChannel: If true, an additional channel is created that shows the update frequency of every other channel in that observer. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.SystemObserver.CreateUpdateFrequenciesChannel = 0 + + +# ArmarX.SystemObserver.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.SystemObserver.EnableProfiling = 0 + + +# ArmarX.SystemObserver.MaxHistoryRecordFrequency: The Observer history is written with this maximum frequency. Everything faster is being skipped. +# Attributes: +# - Default: 50 +# - Case sensitivity: no +# - Required: no +# ArmarX.SystemObserver.MaxHistoryRecordFrequency = 50 + + +# ArmarX.SystemObserver.MaxHistorySize: Maximum number of entries in the Observer history +# Attributes: +# - Default: 5000 +# - Case sensitivity: no +# - Required: no +# ArmarX.SystemObserver.MaxHistorySize = 5000 + + +# ArmarX.SystemObserver.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.SystemObserver.MinimumLoggingLevel = Undefined + + +# ArmarX.SystemObserver.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.SystemObserver.ObjectName = "" + + +# 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: no +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.UseTimeServer = 0 + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: no +# - Required: no +# ArmarX.Verbosity = Info + + + + + diff --git a/scenarios/Armar3Replay/config/global.cfg b/scenarios/Armar3Replay/config/global.cfg new file mode 100644 index 0000000000000000000000000000000000000000..db76b16bc8a504b744a44c74771225c16a4b5158 --- /dev/null +++ b/scenarios/Armar3Replay/config/global.cfg @@ -0,0 +1,87 @@ +# ================================================================== +# Global Config from Scenario Armar3Replay +# ================================================================== + +# ArmarX.DisableLogging: Custom Property +# Attributes: +# - Default: ::NOT_DEFINED:: +# - Case sensitivity: no +# - Required: no +ArmarX.DisableLogging = no + + +# ArmarX.EnableProfiling: Custom Property +# Attributes: +# - Default: ::NOT_DEFINED:: +# - Case sensitivity: no +# - Required: no +ArmarX.EnableProfiling = 1 + + +# ArmarX.GlobalMinimumLoggingLevel: Custom Property +# Attributes: +# - Default: ::NOT_DEFINED:: +# - Case sensitivity: no +# - Required: no +ArmarX.GlobalMinimumLoggingLevel = Verbose + + +# ArmarX.UseTimeServer: Custom Property +# Attributes: +# - Default: ::NOT_DEFINED:: +# - Case sensitivity: no +# - Required: no +ArmarX.UseTimeServer = 0 + + + + + +# RobotConfig.AgentName: Custom Property +# Attributes: +# - Default: ::NOT_DEFINED:: +# - Case sensitivity: no +# - Required: no +RobotConfig.AgentName = Armar3 + + +# RobotConfig.PlatformName: Custom Property +# Attributes: +# - Default: ::NOT_DEFINED:: +# - Case sensitivity: no +# - Required: no +RobotConfig.PlatformName = Platform + + +# RobotConfig.RobotFileName: Custom Property +# Attributes: +# - Default: ::NOT_DEFINED:: +# - Case sensitivity: no +# - Required: no +RobotConfig.RobotFileName = RobotAPI/robots/Armar3/ArmarIII.xml + + +# RobotConfig.RobotNodeSetName: Custom Property +# Attributes: +# - Default: ::NOT_DEFINED:: +# - Case sensitivity: no +# - Required: no +RobotConfig.RobotNodeSetName = Robot + + +# VisionX.DisableLogging: Custom Property +# Attributes: +# - Default: ::NOT_DEFINED:: +# - Case sensitivity: no +# - Required: no +VisionX.DisableLogging = no + + +# VisionX.Verbosity: Custom Property +# Attributes: +# - Default: ::NOT_DEFINED:: +# - Case sensitivity: no +# - Required: no +VisionX.Verbosity = Debug + + diff --git a/scenarios/OptoForceUnit/OptoForceUnit.scx b/scenarios/OptoForceUnit/OptoForceUnit.scx new file mode 100644 index 0000000000000000000000000000000000000000..217d563cb8db1edbd5df43ab05e530c71b970069 --- /dev/null +++ b/scenarios/OptoForceUnit/OptoForceUnit.scx @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<scenario name="OptoForceUnit" lastChange="2017-03-06.18:50:02" creation="2017-03-03.15:11:40" globalConfigName="./config/global.cfg" package="RobotAPI"> + <application name="OptoForceUnitApp" instance="" package="RobotAPI"/> + <application name="OptoForceUnitObserverApp" instance="" package="RobotAPI"/> +</scenario> + diff --git a/scenarios/OptoForceUnit/config/OptoForceUnitApp.cfg b/scenarios/OptoForceUnit/config/OptoForceUnitApp.cfg new file mode 100644 index 0000000000000000000000000000000000000000..d36d393fe461df989545cbfd931333583a68c0aa --- /dev/null +++ b/scenarios/OptoForceUnit/config/OptoForceUnitApp.cfg @@ -0,0 +1,151 @@ +# ================================================================== +# OptoForceUnitApp 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: no +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files +# Attributes: +# - Default: ${HOME}/.armarx/mongo/.cache +# - Case sensitivity: no +# - Required: no +# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: no +# - 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: no +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DisableLogging = 0 + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.EnableProfiling = 0 + + +# ArmarX.OptoForceUnit.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.OptoForceUnit.EnableProfiling = 0 + + +# ArmarX.OptoForceUnit.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.OptoForceUnit.MinimumLoggingLevel = Undefined + + +# ArmarX.OptoForceUnit.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.OptoForceUnit.ObjectName = "" + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RedirectStdout = 1 + + +# 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: no +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.StartDebuggerOnCrash = 0 + + +# 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: no +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.UseTimeServer = 0 + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: no +# - Required: no +# ArmarX.Verbosity = Info + + + + + diff --git a/scenarios/OptoForceUnit/config/OptoForceUnitObserverApp.cfg b/scenarios/OptoForceUnit/config/OptoForceUnitObserverApp.cfg new file mode 100644 index 0000000000000000000000000000000000000000..f834041ce30668ad17b90bc1f64f5efdbf7954d1 --- /dev/null +++ b/scenarios/OptoForceUnit/config/OptoForceUnitObserverApp.cfg @@ -0,0 +1,196 @@ +# ================================================================== +# OptoForceUnitObserverApp 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: no +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files +# Attributes: +# - Default: ${HOME}/.armarx/mongo/.cache +# - Case sensitivity: no +# - Required: no +# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: no +# - 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: no +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DisableLogging = 0 + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.EnableProfiling = 0 + + +# ArmarX.OptoForceUnitObserver.CreateUpdateFrequenciesChannel: If true, an additional channel is created that shows the update frequency of every other channel in that observer. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.OptoForceUnitObserver.CreateUpdateFrequenciesChannel = 0 + + +# ArmarX.OptoForceUnitObserver.DebugDrawerTopic: Name of the DebugDrawerTopic +# Attributes: +# - Default: DebugDrawerUpdates +# - Case sensitivity: no +# - Required: no +# ArmarX.OptoForceUnitObserver.DebugDrawerTopic = DebugDrawerUpdates + + +# ArmarX.OptoForceUnitObserver.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.OptoForceUnitObserver.EnableProfiling = 0 + + +# ArmarX.OptoForceUnitObserver.MaxHistoryRecordFrequency: The Observer history is written with this maximum frequency. Everything faster is being skipped. +# Attributes: +# - Default: 50 +# - Case sensitivity: no +# - Required: no +# ArmarX.OptoForceUnitObserver.MaxHistoryRecordFrequency = 50 + + +# ArmarX.OptoForceUnitObserver.MaxHistorySize: Maximum number of entries in the Observer history +# Attributes: +# - Default: 5000 +# - Case sensitivity: no +# - Required: no +# ArmarX.OptoForceUnitObserver.MaxHistorySize = 5000 + + +# ArmarX.OptoForceUnitObserver.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.OptoForceUnitObserver.MinimumLoggingLevel = Undefined + + +# ArmarX.OptoForceUnitObserver.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.OptoForceUnitObserver.ObjectName = "" + + +# ArmarX.OptoForceUnitObserver.OptoForceTopicName: Name of the OptoForce Topic +# Attributes: +# - Default: OptoForceValues +# - Case sensitivity: no +# - Required: no +# ArmarX.OptoForceUnitObserver.OptoForceTopicName = OptoForceValues + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RedirectStdout = 1 + + +# 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: no +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.StartDebuggerOnCrash = 0 + + +# 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: no +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.UseTimeServer = 0 + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: no +# - Required: no +# ArmarX.Verbosity = Info + + +# Ice.Config: Custom Property +# Attributes: +# - Default: ::NOT_DEFINED:: +# - Case sensitivity: no +# - Required: no +# Ice.Config = ::NOT_DEFINED:: + + diff --git a/scenarios/OptoForceUnit/config/global.cfg b/scenarios/OptoForceUnit/config/global.cfg new file mode 100644 index 0000000000000000000000000000000000000000..4602696c2afa4afbeb2dc4495d91705b6bfb5e46 --- /dev/null +++ b/scenarios/OptoForceUnit/config/global.cfg @@ -0,0 +1,7 @@ +# ================================================================== +# Global Config from Scenario OptoForceUnit +# ================================================================== + + + + diff --git a/scenarios/OrientedTactileSensor/OrientedTactileSensor.scx b/scenarios/OrientedTactileSensor/OrientedTactileSensor.scx new file mode 100644 index 0000000000000000000000000000000000000000..443162d742ef69c2d3d6bedc728ac05494254fc2 --- /dev/null +++ b/scenarios/OrientedTactileSensor/OrientedTactileSensor.scx @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<scenario name="OrientedTactileSensor" lastChange="2017-03-06.17:30:06" creation="2017-02-27.01:48:55 PM" globalConfigName="./config/global.cfg" package="RobotAPI"> + <application name="OrientedTactileSensorUnitApp" instance="" package="RobotAPI"/> + <application name="OrientedTactileSensorUnitObserverApp" instance="" package="RobotAPI"/> +</scenario> + diff --git a/scenarios/OrientedTactileSensor/config/OrientedTactileSensorUnitApp.cfg b/scenarios/OrientedTactileSensor/config/OrientedTactileSensorUnitApp.cfg new file mode 100644 index 0000000000000000000000000000000000000000..1ec6764f36d51be5c6b8501bb6ef5e5046114c79 --- /dev/null +++ b/scenarios/OrientedTactileSensor/config/OrientedTactileSensorUnitApp.cfg @@ -0,0 +1,207 @@ +# ================================================================== +# OrientedTactileSensorUnitApp 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: no +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files +# Attributes: +# - Default: ${HOME}/.armarx/mongo/.cache +# - Case sensitivity: no +# - Required: no +# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: no +# - 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: no +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DisableLogging = 0 + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.EnableProfiling = 0 + + +# ArmarX.OrientedTactileSensorUnit.CalibrationData: Sensor Register Data to calibrate the sensor +# Attributes: +# - Default: 65524 3 12 65534 65534 1 1208 119 58726 1000 943 +# - Case sensitivity: no +# - Required: no +ArmarX.OrientedTactileSensorUnit.CalibrationData = 65524 3 12 65534 65534 1 1208 119 58726 1000 943 + + +# ArmarX.OrientedTactileSensorUnit.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.OrientedTactileSensorUnit.EnableProfiling = 0 + + +# ArmarX.OrientedTactileSensorUnit.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.OrientedTactileSensorUnit.MinimumLoggingLevel = Undefined + + +# ArmarX.OrientedTactileSensorUnit.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.OrientedTactileSensorUnit.ObjectName = "" + + +# ArmarX.OrientedTactileSensorUnit.SamplesAcceleration: number of pressure values to differentiate +# Attributes: +# - Default: 20 +# - Case sensitivity: no +# - Required: no +ArmarX.OrientedTactileSensorUnit.SamplesAcceleration = 20 + + +# ArmarX.OrientedTactileSensorUnit.SamplesPressure: number of pressure values to differentiate +# Attributes: +# - Default: 10 +# - Case sensitivity: no +# - Required: no +ArmarX.OrientedTactileSensorUnit.SamplesPressure = 20 + + +# ArmarX.OrientedTactileSensorUnit.SamplesRotation: number of orientation values to differentiate +# Attributes: +# - Default: 20 +# - Case sensitivity: no +# - Required: no +ArmarX.OrientedTactileSensorUnit.SamplesRotation = 20 + + +# ArmarX.OrientedTactileSensorUnit.SerialInterfaceDevice: The serial device the arduino is connected to. +# Attributes: +# - Default: /dev/ttyACM0 +# - Case sensitivity: no +# - Required: no +ArmarX.OrientedTactileSensorUnit.SerialInterfaceDevice = /dev/ttyACM0 + + +# ArmarX.OrientedTactileSensorUnit.TopicName: Name of the topic on which the sensor values are provided +# Attributes: +# - Default: OrientedTactileSensorValues +# - Case sensitivity: no +# - Required: no +# ArmarX.OrientedTactileSensorUnit.TopicName = OrientedTactileSensorValues + + +# ArmarX.OrientedTactileSensorUnit.calibrateSensor: +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +ArmarX.OrientedTactileSensorUnit.calibrateSensor = 0 + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RedirectStdout = 1 + + +# 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: no +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.StartDebuggerOnCrash = 0 + + +# 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: no +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.UseTimeServer = 0 + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: no +# - Required: no +# ArmarX.Verbosity = Info + + + + + diff --git a/scenarios/OrientedTactileSensor/config/OrientedTactileSensorUnitObserverApp.cfg b/scenarios/OrientedTactileSensor/config/OrientedTactileSensorUnitObserverApp.cfg new file mode 100644 index 0000000000000000000000000000000000000000..5f35ab28581e987287c8ed60661bc575f4a73d26 --- /dev/null +++ b/scenarios/OrientedTactileSensor/config/OrientedTactileSensorUnitObserverApp.cfg @@ -0,0 +1,191 @@ +# ================================================================== +# OrientedTactileSensorUnitObserverApp 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: no +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files +# Attributes: +# - Default: ${HOME}/.armarx/mongo/.cache +# - Case sensitivity: no +# - Required: no +# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: no +# - 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: no +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DisableLogging = 0 + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.EnableProfiling = 0 + + +# ArmarX.OrientedTactileSensorUnitObserver.CreateUpdateFrequenciesChannel: If true, an additional channel is created that shows the update frequency of every other channel in that observer. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.OrientedTactileSensorUnitObserver.CreateUpdateFrequenciesChannel = 0 + + +# ArmarX.OrientedTactileSensorUnitObserver.DebugDrawerTopic: Name of the DebugDrawerTopic +# Attributes: +# - Default: DebugDrawerUpdates +# - Case sensitivity: no +# - Required: no +# ArmarX.OrientedTactileSensorUnitObserver.DebugDrawerTopic = DebugDrawerUpdates + + +# ArmarX.OrientedTactileSensorUnitObserver.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.OrientedTactileSensorUnitObserver.EnableProfiling = 0 + + +# ArmarX.OrientedTactileSensorUnitObserver.MaxHistoryRecordFrequency: The Observer history is written with this maximum frequency. Everything faster is being skipped. +# Attributes: +# - Default: 50 +# - Case sensitivity: no +# - Required: no +# ArmarX.OrientedTactileSensorUnitObserver.MaxHistoryRecordFrequency = 50 + + +# ArmarX.OrientedTactileSensorUnitObserver.MaxHistorySize: Maximum number of entries in the Observer history +# Attributes: +# - Default: 5000 +# - Case sensitivity: no +# - Required: no +# ArmarX.OrientedTactileSensorUnitObserver.MaxHistorySize = 5000 + + +# ArmarX.OrientedTactileSensorUnitObserver.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.OrientedTactileSensorUnitObserver.MinimumLoggingLevel = Undefined + + +# ArmarX.OrientedTactileSensorUnitObserver.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.OrientedTactileSensorUnitObserver.ObjectName = "" + + +# ArmarX.OrientedTactileSensorUnitObserver.SensorTopicName: Name of the Sensor Topic. +# Attributes: +# - Default: OrientedTactileSensorValues +# - Case sensitivity: no +# - Required: no +# ArmarX.OrientedTactileSensorUnitObserver.SensorTopicName = OrientedTactileSensorValues + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RedirectStdout = 1 + + +# 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: no +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.StartDebuggerOnCrash = 0 + + +# 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: no +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.UseTimeServer = 0 + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: no +# - Required: no +# ArmarX.Verbosity = Info + + + + + diff --git a/scenarios/OrientedTactileSensor/config/global.cfg b/scenarios/OrientedTactileSensor/config/global.cfg new file mode 100644 index 0000000000000000000000000000000000000000..e3da6095b2689ee8257c2909a5ed2df0107a2d64 --- /dev/null +++ b/scenarios/OrientedTactileSensor/config/global.cfg @@ -0,0 +1,7 @@ +# ================================================================== +# Global Config from Scenario OrientedTactileSensor +# ================================================================== + + + + diff --git a/scenarios/SensorPackage/SensorPackage.scx b/scenarios/SensorPackage/SensorPackage.scx new file mode 100644 index 0000000000000000000000000000000000000000..3732d9201b2e4cff86d1eee6f1386569922a659e --- /dev/null +++ b/scenarios/SensorPackage/SensorPackage.scx @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<scenario name="SensorPackage" lastChange="2017-02-27.11:57:43" creation="2017-02-27.11:57:30" globalConfigName="./config/global.cfg" package="RobotAPI"> + <application name="SensorPackageUnitApp" instance="" package="RobotAPI"/> +</scenario> + diff --git a/scenarios/SensorPackage/config/SensorPackageUnitApp.cfg b/scenarios/SensorPackage/config/SensorPackageUnitApp.cfg new file mode 100644 index 0000000000000000000000000000000000000000..f427f4873dee5f7dad887780f41da8447f82131a --- /dev/null +++ b/scenarios/SensorPackage/config/SensorPackageUnitApp.cfg @@ -0,0 +1,172 @@ +# ================================================================== +# SensorPackageUnitApp 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: no +# - Required: no +# ArmarX.AdditionalPackages = Default value not mapped. + + +# ArmarX.ApplicationName: Application name +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.ApplicationName = "" + + +# ArmarX.CachePath: Path for cache files +# Attributes: +# - Default: ${HOME}/.armarx/mongo/.cache +# - Case sensitivity: no +# - Required: no +# ArmarX.CachePath = ${HOME}/.armarx/mongo/.cache + + +# ArmarX.Config: Comma-separated list of configuration files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.Config = "" + + +# ArmarX.DataPath: Semicolon-separated search list for data files +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - 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: no +# - 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: no +# - Required: no +# ArmarX.DependenciesConfig = ./config/dependencies.cfg + + +# ArmarX.DisableLogging: Turn logging off in whole application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.DisableLogging = 0 + + +# ArmarX.EnableProfiling: Enable profiling of CPU load produced by this application +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.EnableProfiling = 0 + + +# ArmarX.RedirectStdout: Redirect std::cout and std::cerr to ArmarXLog +# Attributes: +# - Default: 1 +# - Case sensitivity: no +# - Required: no +# ArmarX.RedirectStdout = 1 + + +# 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: no +# - Required: no +# ArmarX.RemoteHandlesDeletionTimeout = 3000 + + +# ArmarX.SensorPackageUnit.EnableProfiling: enable profiler which is used for logging performance events +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.SensorPackageUnit.EnableProfiling = 0 + + +# ArmarX.SensorPackageUnit.MinimumLoggingLevel: Local logging level only for this component +# Attributes: +# - Default: Undefined +# - Case sensitivity: no +# - Required: no +# ArmarX.SensorPackageUnit.MinimumLoggingLevel = Undefined + + +# ArmarX.SensorPackageUnit.ObjectName: Name of IceGrid well-known object +# Attributes: +# - Default: "" +# - Case sensitivity: no +# - Required: no +# ArmarX.SensorPackageUnit.ObjectName = "" + + +# ArmarX.SensorPackageUnit.SerialInterfaceDevice: The serial device the arduino is connected to. +# Attributes: +# - Default: /dev/ttyACM0 +# - Case sensitivity: no +# - Required: no +# ArmarX.SensorPackageUnit.SerialInterfaceDevice = /dev/ttyACM0 + + +# ArmarX.SensorPackageUnit.TopicName: Name of the topic on which the sensor values are provided +# Attributes: +# - Default: SensorPackageUnit +# - Case sensitivity: no +# - Required: no +# ArmarX.SensorPackageUnit.TopicName = SensorPackageUnit + + +# ArmarX.StartDebuggerOnCrash: If this application crashes (segmentation fault) qtcreator will attach to this process and start the debugger. +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.StartDebuggerOnCrash = 0 + + +# 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: no +# - Required: no +# ArmarX.TopicSuffix = "" + + +# ArmarX.UseTimeServer: Enable using a global Timeserver (e.g. from ArmarXSimulator) +# Attributes: +# - Default: 0 +# - Case sensitivity: no +# - Required: no +# ArmarX.UseTimeServer = 0 + + +# ArmarX.Verbosity: Global logging level for whole application +# Attributes: +# - Default: Info +# - Case sensitivity: no +# - Required: no +# ArmarX.Verbosity = Info + + +# Ice.Config: Custom Property +# Attributes: +# - Default: ::NOT_DEFINED:: +# - Case sensitivity: no +# - Required: no +# Ice.Config = ::NOT_DEFINED:: + + diff --git a/scenarios/SensorPackage/config/global.cfg b/scenarios/SensorPackage/config/global.cfg new file mode 100644 index 0000000000000000000000000000000000000000..62f0a2b32fc1bfe619ddb6d311cd6169ebb188fe --- /dev/null +++ b/scenarios/SensorPackage/config/global.cfg @@ -0,0 +1,7 @@ +# ================================================================== +# Global Config from Scenario SensorPackage +# ================================================================== + + + + diff --git a/source/RobotAPI/applications/CMakeLists.txt b/source/RobotAPI/applications/CMakeLists.txt index 6e2a03e85e7555bfc260940f1351620f6e1972d4..bf014d1e57376f3b1d8b369bd654fcfbdfefe863 100644 --- a/source/RobotAPI/applications/CMakeLists.txt +++ b/source/RobotAPI/applications/CMakeLists.txt @@ -23,4 +23,10 @@ add_subdirectory(InertialMeasurementUnitObserver) add_subdirectory(ViewSelection) add_subdirectory(HokuyoLaserUnit) -add_subdirectory(LaserScannerUnitObserver) \ No newline at end of file +add_subdirectory(LaserScannerUnitObserver) + +add_subdirectory(OrientedTactileSensorUnit) +add_subdirectory(OrientedTactileSensorUnitObserver) + +add_subdirectory(OptoForceUnit) +add_subdirectory(OptoForceUnitObserver) \ No newline at end of file diff --git a/source/RobotAPI/applications/CMakeLists.txt.orig b/source/RobotAPI/applications/CMakeLists.txt.orig new file mode 100644 index 0000000000000000000000000000000000000000..ede34006a9c58f2e6538cb7b3f6fd9dee49b318f --- /dev/null +++ b/source/RobotAPI/applications/CMakeLists.txt.orig @@ -0,0 +1,33 @@ +add_subdirectory(ForceTorqueObserver) +add_subdirectory(HeadIKUnit) +add_subdirectory(TCPControlUnit) + +add_subdirectory(WeissHapticUnit) +add_subdirectory(HapticObserver) + + +add_subdirectory(RobotControl) +add_subdirectory(RobotControlUI) +add_subdirectory(KinematicUnitObserver) +add_subdirectory(KinematicUnitSimulation) +add_subdirectory(PlatformUnitSimulation) +add_subdirectory(PlatformUnitObserver) +add_subdirectory(RobotStateComponent) +add_subdirectory(HandUnitSimulation) +add_subdirectory(ForceTorqueUnitSimulation) + + +add_subdirectory(XsensIMU) +add_subdirectory(InertialMeasurementUnitObserver) + +add_subdirectory(ViewSelection) + +<<<<<<< HEAD +add_subdirectory(OrientedTactileSensorUnit) + +add_subdirectory(OrientedTactileSensorUnitObserver) +======= +add_subdirectory(OptoForceUnit) + +add_subdirectory(OptoForceUnitObserver) +>>>>>>> master diff --git a/source/RobotAPI/applications/OptoForceUnit/CMakeLists.txt b/source/RobotAPI/applications/OptoForceUnit/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..be1955e8199bd33e62b90ef6514c12cf1f28d60f --- /dev/null +++ b/source/RobotAPI/applications/OptoForceUnit/CMakeLists.txt @@ -0,0 +1,23 @@ +armarx_component_set_name("OptoForceUnitApp") + +find_package(OptoForceOMD QUIET) +armarx_build_if(OptoForceOMD_FOUND "OptoForceOMD not available") + +if(OptoForceOMD_FOUND) + include_directories(${OptoForceOMD_INCLUDE_DIR}) +endif() + +#message("OptoForceOMD_INCLUDE_DIR: " ${OptoForceOMD_INCLUDE_DIR}) +#message("OptoForceOMD_LIBRARIES: " ${OptoForceOMD_LIBRARIES}) + +set(COMPONENT_LIBS ArmarXCoreInterfaces ArmarXCore ${OptoForceOMD_LIBRARIES}) + +set(COMPONENT_LIBS + ArmarXCoreInterfaces + ArmarXCore + OptoForceUnit +) + +set(EXE_SOURCE main.cpp) + +armarx_add_component_executable("${EXE_SOURCE}") diff --git a/source/RobotAPI/applications/OptoForceUnit/main.cpp b/source/RobotAPI/applications/OptoForceUnit/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4c41d5d633660d88e8087cbf7b67320b23c7c642 --- /dev/null +++ b/source/RobotAPI/applications/OptoForceUnit/main.cpp @@ -0,0 +1,32 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::application::OptoForceUnit + * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu ) + * @date 2017 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#include <RobotAPI/drivers/OptoForceUnit/OptoForceUnit.h> + +#include <ArmarXCore/core/application/Application.h> +#include <ArmarXCore/core/Component.h> +#include <ArmarXCore/core/logging/Logging.h> + +int main(int argc, char* argv[]) +{ + return armarx::runSimpleComponentApp < armarx::OptoForceUnit > (argc, argv, "OptoForceUnit"); +} diff --git a/source/RobotAPI/applications/OptoForceUnitObserver/CMakeLists.txt b/source/RobotAPI/applications/OptoForceUnitObserver/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0f6eb95c87fc537c7fe05f4679c8fb220d01d74 --- /dev/null +++ b/source/RobotAPI/applications/OptoForceUnitObserver/CMakeLists.txt @@ -0,0 +1,20 @@ +armarx_component_set_name("OptoForceUnitObserverApp") + +#find_package(MyLib QUIET) +#armarx_build_if(MyLib_FOUND "MyLib not available") +# +# all include_directories must be guarded by if(Xyz_FOUND) +# for multiple libraries write: if(X_FOUND AND Y_FOUND).... +#if(MyLib_FOUND) +# include_directories(${MyLib_INCLUDE_DIRS}) +#endif() + +set(COMPONENT_LIBS + ArmarXCoreInterfaces + ArmarXCore + RobotAPIUnits +) + +set(EXE_SOURCE main.cpp) + +armarx_add_component_executable("${EXE_SOURCE}") diff --git a/source/RobotAPI/applications/OptoForceUnitObserver/main.cpp b/source/RobotAPI/applications/OptoForceUnitObserver/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5701513b4255edbcbd3e1646b72f9bceaa7078ea --- /dev/null +++ b/source/RobotAPI/applications/OptoForceUnitObserver/main.cpp @@ -0,0 +1,32 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::application::OptoForceUnitObserver + * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu ) + * @date 2017 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#include <RobotAPI/components/units/OptoForceUnitObserver.h> + +#include <ArmarXCore/core/application/Application.h> +#include <ArmarXCore/core/Component.h> +#include <ArmarXCore/core/logging/Logging.h> + +int main(int argc, char* argv[]) +{ + return armarx::runSimpleComponentApp < armarx::OptoForceUnitObserver > (argc, argv, "OptoForceUnitObserver"); +} diff --git a/source/RobotAPI/applications/OrientedTactileSensorUnit/CMakeLists.txt b/source/RobotAPI/applications/OrientedTactileSensorUnit/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..f7bb09c22acd41ad580a15ec936f92603f397aff --- /dev/null +++ b/source/RobotAPI/applications/OrientedTactileSensorUnit/CMakeLists.txt @@ -0,0 +1,15 @@ +armarx_component_set_name("OrientedTactileSensorUnitApp") + +find_package(Eigen3 QUIET) +armarx_build_if(Eigen3_FOUND "Eigen3 not available") + +if (Eigen3_FOUND) + include_directories( + ${Eigen3_INCLUDE_DIR}) +endif() + +set(COMPONENT_LIBS RobotAPIUnits OrientedTactileSensor ) + +set(EXE_SOURCE main.cpp) + +armarx_add_component_executable("${EXE_SOURCE}") diff --git a/source/RobotAPI/applications/OrientedTactileSensorUnit/main.cpp b/source/RobotAPI/applications/OrientedTactileSensorUnit/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f4ab124f78163892921a4330c9680f618be3aef0 --- /dev/null +++ b/source/RobotAPI/applications/OrientedTactileSensorUnit/main.cpp @@ -0,0 +1,9 @@ +#include <ArmarXCore/core/application/Application.h> +#include <RobotAPI/drivers/OrientedTactileSensor/OrientedTactileSensorUnit.h> +#include <ArmarXCore/core/logging/Logging.h> +#include <ArmarXCore/core/Component.h> + +int main(int argc, char* argv[]) +{ + return armarx::runSimpleComponentApp < armarx::OrientedTactileSensorUnit > (argc, argv, "OrientedTactileSensorUnit"); +} diff --git a/source/RobotAPI/applications/OrientedTactileSensorUnitObserver/CMakeLists.txt b/source/RobotAPI/applications/OrientedTactileSensorUnitObserver/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..ec058b57f5d32a7ed5a08cd0efa385d31766432a --- /dev/null +++ b/source/RobotAPI/applications/OrientedTactileSensorUnitObserver/CMakeLists.txt @@ -0,0 +1,20 @@ +armarx_component_set_name("OrientedTactileSensorUnitObserverApp") + +#find_package(MyLib QUIET) +#armarx_build_if(MyLib_FOUND "MyLib not available") +# +# all include_directories must be guarded by if(Xyz_FOUND) +# for multiple libraries write: if(X_FOUND AND Y_FOUND).... +#if(MyLib_FOUND) +# include_directories(${MyLib_INCLUDE_DIRS}) +#endif() + +set(COMPONENT_LIBS + ArmarXCoreInterfaces + ArmarXCore + RobotAPIUnits +) + +set(EXE_SOURCE main.cpp) + +armarx_add_component_executable("${EXE_SOURCE}") diff --git a/source/RobotAPI/applications/OrientedTactileSensorUnitObserver/main.cpp b/source/RobotAPI/applications/OrientedTactileSensorUnitObserver/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e400516ab5faa9c676abd943be2a35afa25c3db3 --- /dev/null +++ b/source/RobotAPI/applications/OrientedTactileSensorUnitObserver/main.cpp @@ -0,0 +1,32 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::application::OrientedTactileSensorUnitObserver + * @author andreeatulbure ( andreea_tulbure at yahoo dot de ) + * @date 2017 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#include <RobotAPI/components/units/OrientedTactileSensorUnitObserver.h> + +#include <ArmarXCore/core/application/Application.h> +#include <ArmarXCore/core/Component.h> +#include <ArmarXCore/core/logging/Logging.h> + +int main(int argc, char* argv[]) +{ + return armarx::runSimpleComponentApp < armarx::OrientedTactileSensorUnitObserver > (argc, argv, "OrientedTactileSensorUnitObserver"); +} diff --git a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp index 1506e7acb0a4b6630f70b1f7bc20a60436646a7c..9dabab63daeba10e73ac9734297a9eacbf4dc16a 100644 --- a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp +++ b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp @@ -982,8 +982,9 @@ namespace armarx SoSeparator* sep = new SoSeparator(); SoNode* c = CoinVisualizationFactory::getCoinVisualization(triMesh); sep->addChild(c); - layer.addedPolygonVisualizations[d.name] = sep; + layer.addedTriMeshVisualizations[d.name] = sep; layer.mainNode->addChild(sep); + } void DebugDrawerComponent::drawArrow(const DebugDrawerComponent::ArrowData& d) @@ -1007,7 +1008,6 @@ namespace armarx SoSeparator* sepArrow = VirtualRobot::CoinVisualizationFactory::CreateArrow(d.direction, d.length, d.width, d.color); sep->addChild(sepArrow); - layer.addedArrowVisualizations[d.name] = sep; layer.mainNode->addChild(sep); } @@ -2054,13 +2054,11 @@ namespace armarx ScopedRecursiveLockPtr l = getScopedAccumulatedDataLock(); std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + arrowName + "__"), " ", "_"); ArrowData& d = accumulatedUpdateData.arrows[entryName]; - d.position = Vector3Ptr::dynamicCast(position)->toEigen(); d.direction = Vector3Ptr::dynamicCast(direction)->toEigen(); d.color = VirtualRobot::VisualizationFactory::Color(color.r, color.g, color.b, 1 - color.a);; d.length = length; d.width = width; - d.layerName = layerName; d.name = arrowName; d.active = true; @@ -2387,7 +2385,6 @@ namespace armarx { ScopedRecursiveLockPtr lockData = getScopedAccumulatedDataLock(); ScopedRecursiveLockPtr lockVisu = getScopedVisuLock(); - // check for clear&remove //(updates only contain elements to add for each layer after the last clear for this layer was executed) //this prevents a sequence add,clear,add to result in an empty layer @@ -2470,9 +2467,9 @@ namespace armarx } accumulatedUpdateData.arrows.clear(); - for (auto i = accumulatedUpdateData.triMeshes.begin(); i != accumulatedUpdateData.triMeshes.end(); i++) + for (auto & e : accumulatedUpdateData.triMeshes) { - drawTriMesh(i->second); + drawTriMesh(e.second); } accumulatedUpdateData.triMeshes.clear(); diff --git a/source/RobotAPI/components/units/CMakeLists.txt b/source/RobotAPI/components/units/CMakeLists.txt index fa3841d8f9a1e2772be93932d53e1f0804b05225..0608c7c1b30df78dc00e91b8bd13c7cf1542d8e2 100644 --- a/source/RobotAPI/components/units/CMakeLists.txt +++ b/source/RobotAPI/components/units/CMakeLists.txt @@ -33,6 +33,8 @@ set(LIB_HEADERS InertialMeasurementUnit.h InertialMeasurementUnitObserver.h LaserScannerUnitObserver.h + OptoForceUnitObserver.h + OrientedTactileSensorUnitObserver.h TCPControlUnit.h TCPControlUnitObserver.h @@ -59,6 +61,8 @@ set(LIB_FILES InertialMeasurementUnit.cpp InertialMeasurementUnitObserver.cpp LaserScannerUnitObserver.cpp + OptoForceUnitObserver.cpp + OrientedTactileSensorUnitObserver.cpp TCPControlUnit.cpp TCPControlUnitObserver.cpp diff --git a/source/RobotAPI/components/units/CMakeLists.txt.orig b/source/RobotAPI/components/units/CMakeLists.txt.orig new file mode 100644 index 0000000000000000000000000000000000000000..34f5c9f14a5eacb9ed7401971b5229ecc7efd18f --- /dev/null +++ b/source/RobotAPI/components/units/CMakeLists.txt.orig @@ -0,0 +1,88 @@ +armarx_set_target("RobotAPI Units Library: RobotAPIUnits") + + +find_package(Eigen3 QUIET) +find_package(Simox ${ArmarX_Simox_VERSION} QUIET) + +armarx_build_if(Eigen3_FOUND "Eigen3 not available") +armarx_build_if(Simox_FOUND "Simox-VirtualRobot not available") + +if (Eigen3_FOUND AND Simox_FOUND) + include_directories( + ${Eigen3_INCLUDE_DIR} + ${Simox_INCLUDE_DIRS}) +endif() + +set(LIB_NAME RobotAPIUnits) + + + +set(LIBS + RobotAPICore + ArmarXCoreObservers + ArmarXCoreEigen3Variants + ${Simox_LIBRARIES}) + +set(LIB_HEADERS + ForceTorqueObserver.h + ForceTorqueUnit.h + ForceTorqueUnitSimulation.h + HeadIKUnit.h + HapticUnit.h + HapticObserver.h + InertialMeasurementUnit.h + InertialMeasurementUnitObserver.h +<<<<<<< HEAD + OrientedTactileSensorUnitObserver.h +======= + OptoForceUnitObserver.h +>>>>>>> master + TCPControlUnit.h + TCPControlUnitObserver.h + + HandUnit.h + HandUnitSimulation.h + KinematicUnit.h + KinematicUnitSimulation.h + PlatformUnit.h + RobotPoseUnit.h + PlatformUnitSimulation.h + KinematicUnitObserver.h + PlatformUnitObserver.h + SensorActorUnit.h + ATINetFTUnit.h +) + +set(LIB_FILES + ForceTorqueObserver.cpp + ForceTorqueUnit.cpp + ForceTorqueUnitSimulation.cpp + HeadIKUnit.cpp + HapticUnit.cpp + HapticObserver.cpp + InertialMeasurementUnit.cpp + InertialMeasurementUnitObserver.cpp +<<<<<<< HEAD + OrientedTactileSensorUnitObserver.cpp +======= + OptoForceUnitObserver.cpp +>>>>>>> master + TCPControlUnit.cpp + TCPControlUnitObserver.cpp + + HandUnit.cpp + HandUnitSimulation.cpp + KinematicUnit.cpp + KinematicUnitSimulation.cpp + PlatformUnit.cpp + PlatformUnitSimulation.cpp + RobotPoseUnit.cpp + KinematicUnitObserver.cpp + PlatformUnitObserver.cpp + SensorActorUnit.cpp + ATINetFTUnit.cpp +) + +armarx_add_library("${LIB_NAME}" "${LIB_FILES}" "${LIB_HEADERS}" "${LIBS}") + +add_subdirectory(relays) diff --git a/source/RobotAPI/components/units/HandUnitSimulation.cpp b/source/RobotAPI/components/units/HandUnitSimulation.cpp index 5da241eeee79e443acb9ff7ccc34d1b39615340b..9246e6fddcee5f6340625dff5db5ff2998ab409b 100644 --- a/source/RobotAPI/components/units/HandUnitSimulation.cpp +++ b/source/RobotAPI/components/units/HandUnitSimulation.cpp @@ -1,7 +1,7 @@ /* * This file is part of ArmarX. * - * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved. + * Copyright (C) 2013-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved. * * ArmarX is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -16,8 +16,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @package ArmarXCore::units - * @author David Schiebener (schiebener at kit dot edu) - * @date 2014 + * @author Peter Kaiser (peter dot kaiser at kit dot edu) + * @date 2017 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt * GNU General Public License */ @@ -25,40 +25,99 @@ #include "HandUnitSimulation.h" +#include <Eigen/Geometry> -using namespace armarx; +#include <cmath> +#include <VirtualRobot/EndEffector/EndEffector.h> +#include <VirtualRobot/RobotConfig.h> +using namespace armarx; +using namespace std; void HandUnitSimulation::onInitHandUnit() { - + kinematicUnitName = getProperty<std::string>("KinematicUnitName").getValue(); + usingProxy(kinematicUnitName); } - - void HandUnitSimulation::onStartHandUnit() { - + kinematicUnitPrx = getProxy<KinematicUnitInterfacePrx>(kinematicUnitName); + if (!kinematicUnitPrx) + { + ARMARX_ERROR << "Failed to obtain kinematic unit proxy"; + } } - - void HandUnitSimulation::onExitHandUnit() { - } - - - -void HandUnitSimulation::setShape(const std::string& shapeName, const Ice::Current& c) +PropertyDefinitionsPtr HandUnitSimulation::createPropertyDefinitions() { + return PropertyDefinitionsPtr(new HandUnitSimulationPropertyDefinitions(getConfigIdentifier())); } - +void armarx::HandUnitSimulation::setShape(const std::string& shapeName, const Ice::Current&) +{ + std::string myShapeName = shapeName; + ARMARX_INFO << "Setting shape " << myShapeName; + + if (!eef) + { + ARMARX_WARNING << "No EEF"; + return; + } + + + if (!eef->hasPreshape(myShapeName)) + { + ARMARX_INFO << "Shape with name " << myShapeName << " not known in eef " << eef->getName() << ". Looking for partial match"; + + bool foundMatch = false; + + for (std::string name : eef->getPreshapes()) + { + if (name.find(myShapeName) != std::string::npos) + { + foundMatch = true; + myShapeName = name; + ARMARX_INFO << "Using matching shape: " << name; + break; + } + } + + if (!foundMatch) + { + ARMARX_WARNING << "No match found for " << myShapeName << " in eef " << eef->getName() << " available shapes: " << eef->getPreshapes(); + return; + } + } + + VirtualRobot::RobotConfigPtr config = eef->getPreshape(myShapeName); + std::map < std::string, float > jointAngles = config->getRobotNodeJointValueMap(); + + NameControlModeMap controlModes; + + for (std::pair<std::string, float> pair : jointAngles) + { + controlModes.insert(std::make_pair(pair.first, ePositionControl)); + } + + kinematicUnitPrx->switchControlMode(controlModes); + kinematicUnitPrx->setJointAngles(jointAngles); +} void armarx::HandUnitSimulation::setJointAngles(const NameValueMap& jointAngles, const Ice::Current&) { + NameControlModeMap controlModes; + + for (std::pair<std::string, float> pair : jointAngles) + { + controlModes.insert(std::make_pair(pair.first, ePositionControl)); + } + kinematicUnitPrx->switchControlMode(controlModes); + kinematicUnitPrx->setJointAngles(jointAngles); } diff --git a/source/RobotAPI/components/units/HandUnitSimulation.h b/source/RobotAPI/components/units/HandUnitSimulation.h index 1b2e06053dc077d83b508b5f81e6b8e9b24fcb70..2aacdbaeceedb8bf4122dc408cdfe306768d0180 100644 --- a/source/RobotAPI/components/units/HandUnitSimulation.h +++ b/source/RobotAPI/components/units/HandUnitSimulation.h @@ -16,8 +16,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @package ArmarXCore::units - * @author David Schiebener (schiebener at kit dot edu) - * @date 2014 + * @author Peter Kaiser (peter dot kaiser at kit dot edu) + * @date 2017 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt * GNU General Public License */ @@ -35,14 +35,13 @@ namespace armarx * \brief Defines all necessary properties for armarx::HandUnitSimulation */ class HandUnitSimulationPropertyDefinitions: - public ComponentPropertyDefinitions + public HandUnitPropertyDefinitions { public: HandUnitSimulationPropertyDefinitions(std::string prefix): - ComponentPropertyDefinitions(prefix) + HandUnitPropertyDefinitions(prefix) { - defineRequiredProperty<std::string>("RobotFileName", "VirtualRobot XML file in which the endeffector is is stored."); - defineRequiredProperty<std::string>("EndeffectorName", "Name of the endeffector as stored in the XML file (will publish values on EndeffectorName + 'State')"); + defineRequiredProperty<std::string>("KinematicUnitName", "Name of the kinematic unit that should be used"); } }; @@ -54,8 +53,6 @@ namespace armarx * * An instance of a HandUnitSimulation provides means to open, close, and shape hands. * It uses the HandUnitListener Ice interface to report updates of its current state - * - * \warning This component is not yet fully functional */ class HandUnitSimulation : virtual public HandUnit @@ -82,6 +79,14 @@ namespace armarx * \warning Not implemented yet! */ virtual void setJointAngles(const NameValueMap& jointAngles, const Ice::Current& c = ::Ice::Current()); + + /** + * \see armarx::PropertyUser::createPropertyDefinitions() + */ + virtual PropertyDefinitionsPtr createPropertyDefinitions(); + + protected: + KinematicUnitInterfacePrx kinematicUnitPrx; }; } diff --git a/source/RobotAPI/components/units/OptoForceUnitObserver.cpp b/source/RobotAPI/components/units/OptoForceUnitObserver.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0b43e68d91e0b0d50e52fbdcc77f6fb5e5fe6a4d --- /dev/null +++ b/source/RobotAPI/components/units/OptoForceUnitObserver.cpp @@ -0,0 +1,147 @@ +/* + * This file is part of ArmarX. + * + * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package + * @author + * @date + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ +#include "OptoForceUnitObserver.h" + + +#include <ArmarXCore/observers/checks/ConditionCheckEquals.h> +#include <ArmarXCore/observers/checks/ConditionCheckLarger.h> +#include <ArmarXCore/observers/checks/ConditionCheckSmaller.h> +#include <ArmarXCore/observers/checks/ConditionCheckUpdated.h> + +#include <RobotAPI/libraries/core/Pose.h> + +#include <ArmarXCore/observers/variant/TimestampVariant.h> + + + +using namespace armarx; + + +void OptoForceUnitObserver::onInitObserver() +{ + usingTopic(getProperty<std::string>("OptoForceTopicName").getValue()); + + //offerConditionCheck("updated", new ConditionCheckUpdated()); + //offerConditionCheck("larger", new ConditionCheckLarger()); + //offerConditionCheck("equals", new ConditionCheckEquals()); + //offerConditionCheck("smaller", new ConditionCheckSmaller()); + + offeringTopic(getProperty<std::string>("DebugDrawerTopic").getValue()); +} + + + +void OptoForceUnitObserver::onConnectObserver() +{ + debugDrawerPrx = getTopic<DebugDrawerInterfacePrx>(getProperty<std::string>("DebugDrawerTopic").getValue()); +} + + +void OptoForceUnitObserver::onExitObserver() +{ + //debugDrawerPrx->removePoseVisu("IMU", "orientation"); + //debugDrawerPrx->removeLineVisu("IMU", "acceleration"); +} + +void OptoForceUnitObserver::reportSensorValues(const std::string& device, const std::string& name, float fx, float fy, float fz, const TimestampBasePtr& timestamp, const Ice::Current& c) +{ + ScopedLock lock(dataMutex); + TimestampVariantPtr timestampPtr = TimestampVariantPtr::dynamicCast(timestamp); + + if (!existsChannel(name)) + { + offerChannel(name, "Force data"); + } + + offerOrUpdateDataField(name, "name", Variant(name), "Name of the sensor"); + offerOrUpdateDataField(name, "device", Variant(device), "Device name"); + offerOrUpdateDataField(name, "fx", Variant(fx), "Force x"); + offerOrUpdateDataField(name, "fy", Variant(fy), "Force y"); + offerOrUpdateDataField(name, "fz", Variant(fz), "Force z"); + offerOrUpdateDataField(name, "timestamp", timestampPtr, "Timestamp"); + offerOrUpdateDataField(name, "force", Vector3(fx, fy, fz), "Force"); + + updateChannel(name); +} + +/*void OptoForceUnitObserver::reportSensorValues(const std::string& device, const std::string& name, const IMUData& values, const TimestampBasePtr& timestamp, const Ice::Current& c) +{ + ScopedLock lock(dataMutex); + + TimestampVariantPtr timestampPtr = TimestampVariantPtr::dynamicCast(timestamp); + + Vector3Ptr acceleration = new Vector3(values.acceleration.at(0), values.acceleration.at(1), values.acceleration.at(2)); + Vector3Ptr gyroscopeRotation = new Vector3(values.gyroscopeRotation.at(0), values.gyroscopeRotation.at(1), values.gyroscopeRotation.at(2)); + Vector3Ptr magneticRotation = new Vector3(values.magneticRotation.at(0), values.magneticRotation.at(1), values.magneticRotation.at(2)); + QuaternionPtr orientationQuaternion = new Quaternion(values.orientationQuaternion.at(0), values.orientationQuaternion.at(1), values.orientationQuaternion.at(2), values.orientationQuaternion.at(3)); + + if (!existsChannel(device)) + { + offerChannel(device, "IMU data"); + } + + offerOrUpdateDataField(device, "name", Variant(name), "Name of the IMU sensor"); + offerValue(device, "acceleration", acceleration); + offerValue(device, "gyroscopeRotation", gyroscopeRotation); + offerValue(device, "magneticRotation", magneticRotation); + offerValue(device, "acceleration", acceleration); + offerOrUpdateDataField(device, "orientationQuaternion", orientationQuaternion, "orientation quaternion values"); + offerOrUpdateDataField(device, "timestamp", timestampPtr, "Timestamp"); + + updateChannel(device); + + Eigen::Vector3f zero; + zero.setZero(); + + DrawColor color; + color.r = 1; + color.g = 1; + color.b = 0; + color.a = 0.5; + + Eigen::Vector3f ac = acceleration->toEigen(); + ac *= 10; + + debugDrawerPrx->setLineVisu("IMU", "acceleration", new Vector3(), new Vector3(ac), 2.0f, color); + + PosePtr posePtr = new Pose(orientationQuaternion->toEigen(), zero); + debugDrawerPrx->setPoseVisu("IMU", "orientation", posePtr); + debugDrawerPrx->setBoxDebugLayerVisu("floor", new Pose(), new Vector3(5000, 5000, 1), DrawColor {0.7f, 0.7f, 0.7f, 1.0f}); +}*/ + +void OptoForceUnitObserver::offerValue(std::string device, std::string fieldName, Vector3Ptr vec) +{ + offerOrUpdateDataField(device, fieldName, vec, fieldName + " values"); + offerOrUpdateDataField(device, fieldName + "_x", vec->x, fieldName + "_x value"); + offerOrUpdateDataField(device, fieldName + "_y", vec->y, fieldName + "_y value"); + offerOrUpdateDataField(device, fieldName + "_z", vec->z, fieldName + "_z value"); + +} + + +PropertyDefinitionsPtr OptoForceUnitObserver::createPropertyDefinitions() +{ + return PropertyDefinitionsPtr(new OptoForceUnitObserverPropertyDefinitions(getConfigIdentifier())); +} + diff --git a/source/RobotAPI/components/units/OptoForceUnitObserver.h b/source/RobotAPI/components/units/OptoForceUnitObserver.h new file mode 100644 index 0000000000000000000000000000000000000000..a91a482fd9b087499131a0c41dd4a9605e290e13 --- /dev/null +++ b/source/RobotAPI/components/units/OptoForceUnitObserver.h @@ -0,0 +1,93 @@ +/* + * This file is part of ArmarX. + * + * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::units + * @author David Schiebener <schiebener at kit dot edu> + * @date 2014 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#ifndef _ARMARX_ROBOTAPI_OptoForce_OBSERVER_H +#define _ARMARX_ROBOTAPI_OptoForce_OBSERVER_H + +#include <RobotAPI/interface/units/OptoForceUnit.h> +#include <ArmarXCore/observers/Observer.h> +#include <RobotAPI/interface/visualization/DebugDrawerInterface.h> +#include <RobotAPI/libraries/core/Pose.h> + + +namespace armarx +{ + /** + * \class OptoForceUnitObserverPropertyDefinitions + * \brief + */ + class OptoForceUnitObserverPropertyDefinitions: + public ObserverPropertyDefinitions + { + public: + OptoForceUnitObserverPropertyDefinitions(std::string prefix): + ObserverPropertyDefinitions(prefix) + { + defineOptionalProperty<std::string>("OptoForceTopicName", "OptoForceValues", "Name of the OptoForce Topic"); + defineOptionalProperty<std::string>("DebugDrawerTopic", "DebugDrawerUpdates", "Name of the DebugDrawerTopic"); + } + }; + + + /** + * \class OptoForceUnitObserver + * \ingroup RobotAPI-SensorActorUnits-observers + * \brief Observer monitoring @IMU sensor values + * + * The OptoForceUnitObserver monitors @IMU sensor values published by OptoForceUnit-implementations and offers condition checks on these values. + * Available condition checks are: *updated*, *larger*, *equals* and *smaller*. + */ + class OptoForceUnitObserver : + virtual public Observer, + virtual public OptoForceUnitObserverInterface + { + public: + OptoForceUnitObserver() {} + + virtual std::string getDefaultName() const + { + return "OptoForceUnitObserver"; + } + virtual void onInitObserver(); + virtual void onConnectObserver(); + virtual void onExitObserver(); + + void reportSensorValues(const std::string& device, const std::string& name, float fx, float fy, float fz, const TimestampBasePtr& timestamp, const Ice::Current& c = ::Ice::Current()); + + /** + * @see PropertyUser::createPropertyDefinitions() + */ + virtual PropertyDefinitionsPtr createPropertyDefinitions(); + + + private: + Mutex dataMutex; + DebugDrawerInterfacePrx debugDrawerPrx; + + + void offerValue(std::string device, std::string fieldName, Vector3Ptr vec); + }; +} + +#endif diff --git a/source/RobotAPI/components/units/OrientedTactileSensorUnitObserver.cpp b/source/RobotAPI/components/units/OrientedTactileSensorUnitObserver.cpp new file mode 100644 index 0000000000000000000000000000000000000000..906e90f79bb7593b36e23e985357c78076fc2512 --- /dev/null +++ b/source/RobotAPI/components/units/OrientedTactileSensorUnitObserver.cpp @@ -0,0 +1,109 @@ +/* + * This file is part of ArmarX. + * + * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package + * @author + * @date + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ +#include "OrientedTactileSensorUnitObserver.h" + + +#include <ArmarXCore/observers/checks/ConditionCheckEquals.h> +#include <ArmarXCore/observers/checks/ConditionCheckLarger.h> +#include <ArmarXCore/observers/checks/ConditionCheckSmaller.h> +#include <ArmarXCore/observers/checks/ConditionCheckUpdated.h> + +#include <RobotAPI/libraries/core/Pose.h> + +#include <ArmarXCore/observers/variant/TimestampVariant.h> + + + +using namespace armarx; + + +void OrientedTactileSensorUnitObserver::onInitObserver() +{ + usingTopic(getProperty<std::string>("SensorTopicName").getValue()); + offeringTopic(getProperty<std::string>("DebugDrawerTopic").getValue()); +} + + + +void OrientedTactileSensorUnitObserver::onConnectObserver() +{ + debugDrawerPrx = getTopic<DebugDrawerInterfacePrx>(getProperty<std::string>("DebugDrawerTopic").getValue()); +} + + +void OrientedTactileSensorUnitObserver::onExitObserver() +{ + //debugDrawerPrx->removePoseVisu("IMU", "orientation"); + //debugDrawerPrx->removeLineVisu("IMU", "acceleration"); +} + +void OrientedTactileSensorUnitObserver::reportSensorValues(int id, float pressure, float qw, float qx, float qy, float qz, float pressureRate, float rotationRate, float accelerationRate, float accelx, float accely, float accelz, const TimestampBasePtr& timestamp, const Ice::Current&) +{ + ScopedLock lock(dataMutex); + TimestampVariantPtr timestampPtr = TimestampVariantPtr::dynamicCast(timestamp); + + std::stringstream ss; + ss << "sensor" << id; + std::string channelName = ss.str(); + + if (!existsChannel(channelName)) + { + offerChannel(channelName, "Sensor Data"); + } + + offerOrUpdateDataField(channelName, "pressure", Variant(pressure), "current pressure"); + QuaternionPtr orientationQuaternion = new Quaternion(qw, qx, qy, qz); + offerOrUpdateDataField(channelName, "orientation", orientationQuaternion, "current oriantation"); + offerOrUpdateDataField(channelName, "rotationRate", Variant(rotationRate), "current rotationRate"); + offerOrUpdateDataField(channelName, "pressureRate", Variant(pressureRate), "current pressureRate"); + offerOrUpdateDataField(channelName, "accelerationRate", Variant(accelerationRate), "current accelerationRate"); + offerOrUpdateDataField(channelName, "linear acceleration", Variant(new Vector3(accelx, accely, accelz)), "current linear acceleration"); +} +/* TODO: for integration with debug drawer + updateChannel(device); + + Eigen::Vector3f zero; + zero.setZero(); + + DrawColor color; + color.r = 1; + color.g = 1; + color.b = 0; + color.a = 0.5; + + Eigen::Vector3f ac = acceleration->toEigen(); + ac *= 10; + + debugDrawerPrx->setLineVisu("IMU", "acceleration", new Vector3(), new Vector3(ac), 2.0f, color); + + PosePtr posePtr = new Pose(orientationQuaternion->toEigen(), zero); + debugDrawerPrx->setPoseVisu("IMU", "orientation", posePtr); + debugDrawerPrx->setBoxDebugLayerVisu("floor", new Pose(), new Vector3(5000, 5000, 1), DrawColor {0.7f, 0.7f, 0.7f, 1.0f}); +*/ + + +PropertyDefinitionsPtr OrientedTactileSensorUnitObserver::createPropertyDefinitions() +{ + return PropertyDefinitionsPtr(new OrientedTactileSensorUnitObserverPropertyDefinitions(getConfigIdentifier())); +} diff --git a/source/RobotAPI/components/units/OrientedTactileSensorUnitObserver.h b/source/RobotAPI/components/units/OrientedTactileSensorUnitObserver.h new file mode 100644 index 0000000000000000000000000000000000000000..7945c13847534201bc9d41f9b169e41ab4ca3b38 --- /dev/null +++ b/source/RobotAPI/components/units/OrientedTactileSensorUnitObserver.h @@ -0,0 +1,89 @@ +/* + * This file is part of ArmarX. + * + * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::units + * @author David Schiebener <schiebener at kit dot edu> + * @date 2014 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#ifndef _ARMARX_ROBOTAPI_IMU_OBSERVER_H +#define _ARMARX_ROBOTAPI_IMU_OBSERVER_H + +#include <RobotAPI/interface/units/OrientedTactileSensorUnit.h> +#include <ArmarXCore/observers/Observer.h> +#include <RobotAPI/interface/visualization/DebugDrawerInterface.h> +#include <RobotAPI/libraries/core/Pose.h> + + +namespace armarx +{ + /** + * \class OrientedTactileSensorUnitObserverPropertyDefinitions + * \brief + */ + class OrientedTactileSensorUnitObserverPropertyDefinitions: + public ObserverPropertyDefinitions + { + public: + OrientedTactileSensorUnitObserverPropertyDefinitions(std::string prefix): + ObserverPropertyDefinitions(prefix) + { + defineOptionalProperty<std::string>("SensorTopicName", "OrientedTactileSensorValues", "Name of the Sensor Topic."); + defineOptionalProperty<std::string>("DebugDrawerTopic", "DebugDrawerUpdates", "Name of the DebugDrawerTopic"); + } + }; + + + /** + * \class OrientedTactileSensorUnitObserver + * \ingroup RobotAPI-SensorActorUnits-observers + * \brief Observer monitoring @IMU sensor values + * + * The OrientedTactileSensorUnitObserver monitors @IMU sensor values published by OrientedTactileSensorUnit-implementations and offers condition checks on these values. + */ + class OrientedTactileSensorUnitObserver : + virtual public Observer, + virtual public OrientedTactileSensorUnitObserverInterface + { + public: + OrientedTactileSensorUnitObserver() {} + + virtual std::string getDefaultName() const + { + return "OrientedTactileSensorUnitObserver"; + } + virtual void onInitObserver(); + virtual void onConnectObserver(); + virtual void onExitObserver(); + + void reportSensorValues(int id, float pressure, float qw, float qx, float qy, float qz, float pressureRate, float rotationRate, float accelerationRate, float accelx, float accely, float accelz, const TimestampBasePtr& timestamp, const Ice::Current&); + + /** + * @see PropertyUser::createPropertyDefinitions() + */ + virtual PropertyDefinitionsPtr createPropertyDefinitions(); + + + private: + Mutex dataMutex; + DebugDrawerInterfacePrx debugDrawerPrx; + }; +} + +#endif diff --git a/source/RobotAPI/drivers/CMakeLists.txt b/source/RobotAPI/drivers/CMakeLists.txt index 3e90d0a580ae5f8a52d35a5910b0e6616de33a75..54b6eb0980c9a369739a0470715e74d2c7a8f71f 100644 --- a/source/RobotAPI/drivers/CMakeLists.txt +++ b/source/RobotAPI/drivers/CMakeLists.txt @@ -1,3 +1,6 @@ add_subdirectory(WeissHapticSensor) add_subdirectory(XsensIMU) add_subdirectory(HokuyoLaserUnit) +add_subdirectory(OptoForceUnit) +add_subdirectory(OrientedTactileSensor) + diff --git a/source/RobotAPI/drivers/CMakeLists.txt.orig b/source/RobotAPI/drivers/CMakeLists.txt.orig new file mode 100644 index 0000000000000000000000000000000000000000..41cef5bc459cacf6e4c6a88f50eec1befada44cb --- /dev/null +++ b/source/RobotAPI/drivers/CMakeLists.txt.orig @@ -0,0 +1,8 @@ +add_subdirectory(WeissHapticSensor) +add_subdirectory(XsensIMU) +<<<<<<< HEAD +add_subdirectory(OrientedTactileSensor) +======= +add_subdirectory(OptoForceUnit) + +>>>>>>> master diff --git a/source/RobotAPI/drivers/OptoForce/CMakeLists.txt b/source/RobotAPI/drivers/OptoForce/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..69ebc2ee58ac092c170ded635229f10655dfe01b --- /dev/null +++ b/source/RobotAPI/drivers/OptoForce/CMakeLists.txt @@ -0,0 +1,24 @@ +armarx_component_set_name("OptoForce") + +find_package(OptoForceOMD QUIET) +armarx_build_if(OptoForceOMD_FOUND "OptoForceOMD not available 11elf!") + +if(OptoForceOMD_FOUND) + include_directories(${OptoForceOMD_INCLUDE_DIR}) +endif() + +set(COMPONENT_LIBS ArmarXCoreInterfaces ArmarXCore OMD) + +set(SOURCES +OptoForce.cpp +#@TEMPLATE_LINE@@COMPONENT_PATH@/@COMPONENT_NAME@.cpp +) +set(HEADERS +OptoForce.h +#@TEMPLATE_LINE@@COMPONENT_PATH@/@COMPONENT_NAME@.h +) + +armarx_add_component("${SOURCES}" "${HEADERS}") + +# add unit tests +add_subdirectory(test) diff --git a/source/RobotAPI/drivers/OptoForce/OptoForce.cpp b/source/RobotAPI/drivers/OptoForce/OptoForce.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f4583843a0b503724fcf040cb225f37e2259d14e --- /dev/null +++ b/source/RobotAPI/drivers/OptoForce/OptoForce.cpp @@ -0,0 +1,57 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::ArmarXObjects::OptoForce + * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu ) + * @date 2017 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#include "OptoForce.h" + + +using namespace armarx; + + +void OptoForce::onInitComponent() +{ + +} + + +void OptoForce::onConnectComponent() +{ + +} + + +void OptoForce::onDisconnectComponent() +{ + +} + + +void OptoForce::onExitComponent() +{ + +} + +armarx::PropertyDefinitionsPtr OptoForce::createPropertyDefinitions() +{ + return armarx::PropertyDefinitionsPtr(new OptoForcePropertyDefinitions( + getConfigIdentifier())); +} + diff --git a/source/RobotAPI/drivers/OptoForce/OptoForce.h b/source/RobotAPI/drivers/OptoForce/OptoForce.h new file mode 100644 index 0000000000000000000000000000000000000000..d8cffde689d631b3385b7a647384c531f2274025 --- /dev/null +++ b/source/RobotAPI/drivers/OptoForce/OptoForce.h @@ -0,0 +1,99 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::ArmarXObjects::OptoForce + * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu ) + * @date 2017 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#ifndef _ARMARX_COMPONENT_RobotAPI_OptoForce_H +#define _ARMARX_COMPONENT_RobotAPI_OptoForce_H + + +#include <ArmarXCore/core/Component.h> +#include <opto.h> + +namespace armarx +{ + /** + * @class OptoForcePropertyDefinitions + * @brief + */ + class OptoForcePropertyDefinitions: + public armarx::ComponentPropertyDefinitions + { + public: + OptoForcePropertyDefinitions(std::string prefix): + armarx::ComponentPropertyDefinitions(prefix) + { + //defineRequiredProperty<std::string>("PropertyName", "Description"); + //defineOptionalProperty<std::string>("PropertyName", "DefaultValue", "Description"); + } + }; + + /** + * @defgroup Component-OptoForce OptoForce + * @ingroup RobotAPI-Components + * A description of the component OptoForce. + * + * @class OptoForce + * @ingroup Component-OptoForce + * @brief Brief description of class OptoForce. + * + * Detailed description of class OptoForce. + */ + class OptoForce : + virtual public armarx::Component + { + public: + /** + * @see armarx::ManagedIceObject::getDefaultName() + */ + virtual std::string getDefaultName() const + { + return "OptoForce"; + } + + protected: + /** + * @see armarx::ManagedIceObject::onInitComponent() + */ + virtual void onInitComponent(); + + /** + * @see armarx::ManagedIceObject::onConnectComponent() + */ + virtual void onConnectComponent(); + + /** + * @see armarx::ManagedIceObject::onDisconnectComponent() + */ + virtual void onDisconnectComponent(); + + /** + * @see armarx::ManagedIceObject::onExitComponent() + */ + virtual void onExitComponent(); + + /** + * @see PropertyUser::createPropertyDefinitions() + */ + virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions(); + }; +} + +#endif diff --git a/source/RobotAPI/drivers/OptoForce/test/CMakeLists.txt b/source/RobotAPI/drivers/OptoForce/test/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..752baf57ed0a71efa1839d086abc830efd2fc363 --- /dev/null +++ b/source/RobotAPI/drivers/OptoForce/test/CMakeLists.txt @@ -0,0 +1,5 @@ + +# Libs required for the tests +SET(LIBS ${LIBS} ArmarXCore OptoForce) + +armarx_add_test(OptoForceTest OptoForceTest.cpp "${LIBS}") \ No newline at end of file diff --git a/source/RobotAPI/drivers/OptoForce/test/OptoForceTest.cpp b/source/RobotAPI/drivers/OptoForce/test/OptoForceTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..721c33f3de840451e4ef7ce2b6092d8ede4c0a80 --- /dev/null +++ b/source/RobotAPI/drivers/OptoForce/test/OptoForceTest.cpp @@ -0,0 +1,37 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::ArmarXObjects::OptoForceOMD + * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu ) + * @date 2017 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#define BOOST_TEST_MODULE RobotAPI::ArmarXObjects::OptoForceOMD + +#define ARMARX_BOOST_TEST + +#include <RobotAPI/Test.h> +#include <RobotAPI/components/OptoForceOMD/OptoForceOMD.h> + +#include <iostream> + +BOOST_AUTO_TEST_CASE(testExample) +{ + armarx::OptoForceOMD instance; + + BOOST_CHECK_EQUAL(true, true); +} diff --git a/source/RobotAPI/drivers/OptoForceUnit/CMakeLists.txt b/source/RobotAPI/drivers/OptoForceUnit/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..b1a56eba222d6b24adbcf6099a195c108059aad9 --- /dev/null +++ b/source/RobotAPI/drivers/OptoForceUnit/CMakeLists.txt @@ -0,0 +1,27 @@ +armarx_component_set_name("OptoForceUnit") + +find_package(OptoForceOMD QUIET) +armarx_build_if(OptoForceOMD_FOUND "OptoForceOMD not available") + +if(OptoForceOMD_FOUND) + include_directories(${OptoForceOMD_INCLUDE_DIR}) +endif() + +#message("OptoForceOMD_INCLUDE_DIR: " ${OptoForceOMD_INCLUDE_DIR}) +#message("OptoForceOMD_LIBRARIES: " ${OptoForceOMD_LIBRARIES}) + +set(COMPONENT_LIBS ArmarXCoreInterfaces ArmarXCore ArmarXCoreEigen3Variants RobotAPIInterfaces ${OptoForceOMD_LIBRARIES}) + +set(SOURCES +./OptoForceUnit.cpp +#@TEMPLATE_LINE@@COMPONENT_PATH@/@COMPONENT_NAME@.cpp +) +set(HEADERS +./OptoForceUnit.h +#@TEMPLATE_LINE@@COMPONENT_PATH@/@COMPONENT_NAME@.h +) + +armarx_add_component("${SOURCES}" "${HEADERS}") + +# add unit tests +add_subdirectory(test) diff --git a/source/RobotAPI/drivers/OptoForceUnit/OptoForceUnit.cpp b/source/RobotAPI/drivers/OptoForceUnit/OptoForceUnit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9fdfeaf16f6b73dea6b9d87a6a5b7959d70ca704 --- /dev/null +++ b/source/RobotAPI/drivers/OptoForceUnit/OptoForceUnit.cpp @@ -0,0 +1,220 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::ArmarXObjects::OptoForceUnit + * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu ) + * @date 2017 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#include "OptoForceUnit.h" + +#include <ArmarXCore/observers/variant/TimestampVariant.h> + + + +using namespace armarx; + + +void OptoForceUnit::onInitComponent() +{ + std::string calibrationFilePath = getProperty<std::string>("CalibrationFilePath").getValue(); + if(!ArmarXDataPath::getAbsolutePath(calibrationFilePath, calibrationFilePath)) + { + throw LocalException("Could not find calibration file '") << calibrationFilePath << "'"; + } + ARMARX_INFO << "reading config " << calibrationFilePath; + RapidXmlReaderPtr reader = RapidXmlReader::FromFile(calibrationFilePath); + RapidXmlReaderNode rootNode = reader->getRoot("Calibration"); + + auto findDaqNode = [&](std::string serialNumber) + { + for(RapidXmlReaderNode daqNode : rootNode.nodes("Daq")) + { + if(daqNode.attribute_value("serialNumber") == serialNumber) + { + return daqNode; + } + } + return RapidXmlReaderNode::NullNode(); + }; + + offeringTopic(getProperty<std::string>("OptoForceTopicName").getValue()); + + OPort* portlist = ports.listPorts(true); + ARMARX_INFO << "Found " << ports.getLastSize() << " Optoforce device(s)."; + + + portlist = ports.listPorts(true); + ARMARX_INFO << "Found " << ports.getLastSize() << " Optoforce device(s):"; + + for (int i = 0; i < ports.getLastSize(); i++) + { + std::string deviceName(portlist[i].name); + std::string serialNumber(portlist[i].serialNumber); + ARMARX_INFO << "Found DAQ: deviceName='" << deviceName << "', serialNumber='" << serialNumber << "'"; + RapidXmlReaderNode daqNode = findDaqNode(serialNumber); + if(!daqNode.is_valid()) + { + throw LocalException("Could not find config node for device deviceName='") << deviceName << "', serialNumber='" << serialNumber << "'"; + } + DaqWrapperPtr daqPtr(new DaqWrapper(deviceName, serialNumber, daqNode)); + daqList.push_back(daqPtr); + } + + ARMARX_INFO << "number of ports: " << ports.getLastSize(); + + for (int i = 0; i < ports.getLastSize(); ++i) + { + const DaqWrapperPtr& daq = daqList.at(i); + ARMARX_IMPORTANT << "Opening port #" << i << " " << portlist[i].name; + daq->daq.open(portlist[i]); + daq->printInfo(); + daq->checkSensorCount(); + } + + readTask = new RunningTask<OptoForceUnit>(this, &OptoForceUnit::run, "OptoForceUnit"); + +} + + +void OptoForceUnit::onConnectComponent() +{ + topicPrx = getTopic<OptoForceUnitListenerPrx>(getProperty<std::string>("OptoForceTopicName").getValue()); + readTask->start(); +} + +void OptoForceUnit::run() +{ + ARMARX_IMPORTANT << "run"; + + + OptoForceUnitListenerPrx batchPrx = topicPrx->ice_batchOneway(); + ARMARX_IMPORTANT << "got batch Proxy"; + + while(readTask->isRunning()) + { + bool flushNeeded = false; + + for(const DaqWrapperPtr& daqPtr : daqList) + { + OptoPackage* pa = 0; + int size = daqPtr->daq.readAll(pa, false); + if (size == 0) + { + // size == 0: no new data for daq + continue; + } + if(size < 0) + { + // size == -1: buffer full + ARMARX_WARNING << "buffer full of daq " << daqPtr->deviceName; + } + if (daqPtr->daq.getSize() > 0) + { + IceUtil::Time now = IceUtil::Time::now(); + TimestampVariantPtr nowTimestamp = new TimestampVariant(now); + + for (int i = 0; i < daqPtr->daq.getSensorSize(); i++) + { + for (int n = 0; n < size; n++) + { + float countsPerN = daqPtr->countsPerN.at(i); + float x = pa[i * size + n].x / countsPerN; + float y = pa[i * size + n].y / countsPerN; + float z = pa[i * size + n].z / countsPerN; + + batchPrx->reportSensorValues(daqPtr->deviceName + ":" + std::to_string(i), daqPtr->sensorNames.at(i), x, y, z, nowTimestamp); + flushNeeded = true; + } + } + + delete[] pa; + } + } + if(flushNeeded) + { + batchPrx->ice_flushBatchRequests(); + } + else + { + usleep(1000); // 1ms + } + } +} + + +void OptoForceUnit::onDisconnectComponent() +{ + +} + + +void OptoForceUnit::onExitComponent() +{ + readTask->stop(); +} + +armarx::PropertyDefinitionsPtr OptoForceUnit::createPropertyDefinitions() +{ + return armarx::PropertyDefinitionsPtr(new OptoForceUnitPropertyDefinitions( + getConfigIdentifier())); +} + + + +OptoForceUnit::DaqWrapper::DaqWrapper(const std::string& deviceName, const std::string& serialNumber, const RapidXmlReaderNode& daqNode) + : deviceName(deviceName), serialNumber(serialNumber) +{ + int i = 0; + for(RapidXmlReaderNode sensorNode : daqNode.nodes("Sensor")) + { + float counts_at_nc = sensorNode.attribute_as_float("counts_at_nc"); + float nominalCapacity = sensorNode.attribute_as_float("nominalCapacity"); + std::string sensorName = sensorNode.attribute_value_or_default("name", serialNumber + "-" + std::to_string(i)); + countsPerN.push_back(counts_at_nc / nominalCapacity); + sensorNames.push_back(sensorName); + i++; + } +} + +void OptoForceUnit::DaqWrapper::printInfo() +{ + SensorConfig config = daq.getConfig(); + int state = config.getState(); + int speed = config.getSpeed(); + int filter = config.getFilter(); + int mode = config.getMode(); + + ARMARX_IMPORTANT_S << "device: " << deviceName << " serialNumber:" << serialNumber; + ARMARX_IMPORTANT_S << "state: " << state; + ARMARX_IMPORTANT_S << "speed: " << speed; + ARMARX_IMPORTANT_S << "filter: " << filter; + ARMARX_IMPORTANT_S << "mode: " << mode; + ARMARX_IMPORTANT_S << "getBytesPerRead: " << daq.getBytesPerRead(); + ARMARX_IMPORTANT_S << "getSensorSize: " << daq.getSensorSize(); + ARMARX_IMPORTANT_S << "getSize: " << daq.getSize(); + ARMARX_IMPORTANT_S << "getVersion: " << daq.getVersion(); +} + +void OptoForceUnit::DaqWrapper::checkSensorCount() +{ + if((int)countsPerN.size() != daq.getSensorSize()) + { + throw LocalException("Sensor count mismatch. Configured: ") << ((int)countsPerN.size()) << " found: " << daq.getSensorSize(); + } + ARMARX_INFO_S << "Configured: " << ((int)countsPerN.size()) << " found: " << daq.getSensorSize() << " sensors"; +} diff --git a/source/RobotAPI/drivers/OptoForceUnit/OptoForceUnit.h b/source/RobotAPI/drivers/OptoForceUnit/OptoForceUnit.h new file mode 100644 index 0000000000000000000000000000000000000000..0418549306cecf52ad07e6e7eb8cf3fa8d981621 --- /dev/null +++ b/source/RobotAPI/drivers/OptoForceUnit/OptoForceUnit.h @@ -0,0 +1,131 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::ArmarXObjects::OptoForceUnit + * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu ) + * @date 2017 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#ifndef _ARMARX_COMPONENT_RobotAPI_OptoForceUnit_H +#define _ARMARX_COMPONENT_RobotAPI_OptoForceUnit_H + + +#include <ArmarXCore/core/Component.h> +#include <ArmarXCore/core/services/tasks/RunningTask.h> +#include <RobotAPI/interface/units/OptoForceUnit.h> +#include <opto.h> +#include <ArmarXCore/core/rapidxml/wrapper/RapidXmlReader.h> + +namespace armarx +{ + /** + * @class OptoForceUnitPropertyDefinitions + * @brief + */ + class OptoForceUnitPropertyDefinitions: + public armarx::ComponentPropertyDefinitions + { + public: + OptoForceUnitPropertyDefinitions(std::string prefix): + armarx::ComponentPropertyDefinitions(prefix) + { + //defineRequiredProperty<std::string>("PropertyName", "Description"); + defineOptionalProperty<std::string>("OptoForceTopicName", "OptoForceValues", "Name of the OptoForce Topic"); + defineOptionalProperty<std::string>("CalibrationFilePath", "RobotAPI/sensors/OptoForceCalibration.xml", "Path of the Calibration File"); + } + }; + + /** + * @defgroup Component-OptoForceUnit OptoForceUnit + * @ingroup RobotAPI-Components + * A description of the component OptoForceUnit. + * + * @class OptoForceUnit + * @ingroup Component-OptoForceUnit + * @brief Brief description of class OptoForceUnit. + * + * Detailed description of class OptoForceUnit. + */ + class OptoForceUnit : + virtual public armarx::Component + { + private: + class DaqWrapper + { + public: + DaqWrapper(const std::string& deviceName, const std::string& serialNumber, const RapidXmlReaderNode& daqNode); + + OptoDAQ daq; + std::string deviceName; + std::string serialNumber; + std::vector<float> countsPerN; + std::vector<std::string> sensorNames; + + void printInfo(); + void checkSensorCount(); + }; + typedef boost::shared_ptr<DaqWrapper> DaqWrapperPtr; + + public: + /** + * @see armarx::ManagedIceObject::getDefaultName() + */ + virtual std::string getDefaultName() const + { + return "OptoForceUnit"; + } + + protected: + /** + * @see armarx::ManagedIceObject::onInitComponent() + */ + virtual void onInitComponent(); + + /** + * @see armarx::ManagedIceObject::onConnectComponent() + */ + virtual void onConnectComponent(); + + /** + * @see armarx::ManagedIceObject::onDisconnectComponent() + */ + virtual void onDisconnectComponent(); + + /** + * @see armarx::ManagedIceObject::onExitComponent() + */ + virtual void onExitComponent(); + + /** + * @see PropertyUser::createPropertyDefinitions() + */ + virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions(); + + private: + void run(); + + OptoForceUnitListenerPrx topicPrx; + + OptoPorts ports; + //OptoDAQ daq; + std::vector<DaqWrapperPtr> daqList; + RunningTask<OptoForceUnit>::pointer_type readTask; + + }; +} + +#endif diff --git a/source/RobotAPI/drivers/OptoForceUnit/test/CMakeLists.txt b/source/RobotAPI/drivers/OptoForceUnit/test/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..d98753d86660f78faaee7e476511d3af7e9daa29 --- /dev/null +++ b/source/RobotAPI/drivers/OptoForceUnit/test/CMakeLists.txt @@ -0,0 +1,5 @@ + +# Libs required for the tests +SET(LIBS ${LIBS} ArmarXCore OptoForceUnit) + +armarx_add_test(OptoForceUnitTest OptoForceUnitTest.cpp "${LIBS}") \ No newline at end of file diff --git a/source/RobotAPI/drivers/OptoForceUnit/test/OptoForceUnitTest.cpp b/source/RobotAPI/drivers/OptoForceUnit/test/OptoForceUnitTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3f12161380ccbae533b0d649ac5dd957ad57b086 --- /dev/null +++ b/source/RobotAPI/drivers/OptoForceUnit/test/OptoForceUnitTest.cpp @@ -0,0 +1,37 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::ArmarXObjects::OptoForceUnit + * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu ) + * @date 2017 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#define BOOST_TEST_MODULE RobotAPI::ArmarXObjects::OptoForceUnit + +#define ARMARX_BOOST_TEST + +#include <RobotAPI/Test.h> +#include <RobotAPI/drivers/OptoForceUnit/OptoForceUnit.h> + +#include <iostream> + +BOOST_AUTO_TEST_CASE(testExample) +{ + armarx::OptoForceUnit instance; + + BOOST_CHECK_EQUAL(true, true); +} diff --git a/source/RobotAPI/drivers/OrientedTactileSensor/CMakeLists.txt b/source/RobotAPI/drivers/OrientedTactileSensor/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..eefa4ca3137b61c4c20707c2592e5096437a755e --- /dev/null +++ b/source/RobotAPI/drivers/OrientedTactileSensor/CMakeLists.txt @@ -0,0 +1,25 @@ +armarx_set_target("OrientedTactileSensor Library: OrientedTactileSensor") + +find_package(Eigen3 QUIET) + +armarx_build_if(Eigen3_FOUND "Eigen3 not available") + +if (Eigen3_FOUND) + include_directories( + ${Eigen3_INCLUDE_DIR}) +endif() + +set(LIB_NAME OrientedTactileSensor) + + + +set(LIBS RobotAPIUnits ArmarXCoreObservers ArmarXCoreEigen3Variants) + +set(LIB_FILES + OrientedTactileSensorUnit.cpp +) +set(LIB_HEADERS + OrientedTactileSensorUnit.h +) + +armarx_add_library("${LIB_NAME}" "${LIB_FILES}" "${LIB_HEADERS}" "${LIBS}") diff --git a/source/RobotAPI/drivers/OrientedTactileSensor/OrientedTactileSensorUnit.cpp b/source/RobotAPI/drivers/OrientedTactileSensor/OrientedTactileSensorUnit.cpp new file mode 100644 index 0000000000000000000000000000000000000000..eaafd8ecaef369e3126bd3b548a8d21378f3ff1b --- /dev/null +++ b/source/RobotAPI/drivers/OrientedTactileSensor/OrientedTactileSensorUnit.cpp @@ -0,0 +1,287 @@ +#include "OrientedTactileSensorUnit.h" +#include <termios.h> +#include <sys/ioctl.h> +#include <fcntl.h> +#include <math.h> +#include <ArmarXCore/core/application/Application.h> +#include <ArmarXCore/observers/variant/TimestampVariant.h> + +using namespace armarx; + +OrientedTactileSensorUnit::OrientedTactileSensorUnit() +{ + + sampleIndexRotation = 0; + sampleIndexPressure = 0; + sampleIndexAcceleration = 0; +} + +void OrientedTactileSensorUnit::onInitComponent() +{ + maxSamplesRotation = stoi(getProperty<std::string>("SamplesRotation").getValue()); + maxSamplesPressure = stoi(getProperty<std::string>("SamplesPressure").getValue()); + maxSamplesAcceleration = stoi(getProperty<std::string>("SamplesAcceleration").getValue()); + + std::string topicName = getProperty<std::string>("TopicName").getValue(); + offeringTopic(topicName); + + //open serial port + std::string portname = getProperty<std::string>("SerialInterfaceDevice").getValue(); + arduino.open(getProperty<std::string>("SerialInterfaceDevice").getValue(), std::ios::in); + + fd = open(portname.c_str(), O_RDONLY | O_NOCTTY); + struct termios toptions; + + /* Get currently set options for the tty */ + tcgetattr(fd, &toptions); + + /* Set custom options */ + cfsetispeed(&toptions, B115200); + cfsetospeed(&toptions, B115200); + + /* 8 bits, no parity, no stop bits */ + toptions.c_lflag = 0; + toptions.c_iflag = 0; + toptions.c_oflag = 0; + + /* commit the options */ + tcsetattr(fd, TCSANOW, &toptions); + + /* Wait for the Arduino to reset */ + usleep(1000 * 1000); + + /* Flush anything already in the serial buffer */ + tcflush(fd, TCIFLUSH); + + ARMARX_INFO << "opening device " << getProperty<std::string>("SerialInterfaceDevice").getValue(); + + if (!arduino.is_open()) + { + + throw LocalException("Cannot open Arduino on ") << getProperty<std::string>("SerialInterfaceDevice").getValue(); + } + + ARMARX_INFO << "Arduino restarts, please wait ..."; + + //wait for the Arduino to reboot + usleep(4000000); + std::string arduinoLine; + //wait for the IMU to be calibrated or load calibration + ARMARX_INFO << "waiting for IMU calibration - this can take some time"; + if (getProperty<bool>("calibrateSensor").getValue()) + { + //calibrate + + while (arduinoLine.find("mode") == std::string::npos) + { + getline(arduino, arduinoLine, '\n'); + } + arduino.close(); + + arduino.open(getProperty<std::string>("SerialInterfaceDevice").getValue(), std::ios::out); + arduino << "calibrate"; + arduino.flush(); + arduino.close(); + + arduino.open(getProperty<std::string>("SerialInterfaceDevice").getValue(), std::ios::in); + while (arduinoLine.find("Calibration Sucessfull") == std::string::npos) + { + getline(arduino, arduinoLine, '\n'); + ARMARX_INFO << arduinoLine; + } + getline(arduino, arduinoLine, '\n'); + if (getCalibrationValues(arduinoLine)) + { + ARMARX_IMPORTANT << "calibrated sensor"; + } + } + else + { + //load calibration + ARMARX_INFO << "load calibration data " << getProperty<std::string>("CalibrationData").getValue(); + if (loadCalibration()) + { + ARMARX_IMPORTANT << "loaded calibration"; + } + } + readTask = new RunningTask<OrientedTactileSensorUnit>(this, &OrientedTactileSensorUnit::run); + readTask->start(); + +} + +void OrientedTactileSensorUnit::onConnectComponent() +{ + std::string topicName = getProperty<std::string>("TopicName").getValue(); + topicPrx = getTopic<OrientedTactileSensorUnitListenerPrx>(topicName); +} + +PropertyDefinitionsPtr OrientedTactileSensorUnit::createPropertyDefinitions() +{ + return PropertyDefinitionsPtr(new OrientedTactileSensorUnitPropertyDefinitions( + getConfigIdentifier())); +} + +void OrientedTactileSensorUnit::run() +{ + while (readTask->isRunning()) + { + std::string line; + getline(arduino, line, '\n'); + SensorData data = getValues(line.c_str()); + IceUtil::Time now = IceUtil::Time::now(); + TimestampVariantPtr nowTimestamp = new TimestampVariant(now); + + //compute rotationRate + float rotationRate = 0; + + //condition for inverse quaternion + if ((pow(data.qw, 2) + pow(data.qx, 2) + pow(data.qy, 2) + pow(data.qz, 2)) != 0) + { + RotationRate sampleRotation; + sampleRotation.timestamp = now; + sampleRotation.orientation = Eigen::Quaternionf(data.qw, data.qx, data.qy, data.qz); + if (samplesRotation.size() < maxSamplesRotation) + { + samplesRotation.push_back(sampleRotation); + } + else + { + samplesRotation[sampleIndexRotation].timestamp = sampleRotation.timestamp; + samplesRotation[sampleIndexRotation].orientation = sampleRotation.orientation; + sampleIndexRotation = (sampleIndexRotation + 1) % maxSamplesRotation; + RotationRate oldsampleRotation; + oldsampleRotation.timestamp = samplesRotation.at(sampleIndexRotation).timestamp; + oldsampleRotation.orientation = samplesRotation.at(sampleIndexRotation).orientation; + Eigen::AngleAxisf aa(sampleRotation.orientation * oldsampleRotation.orientation.inverse()); + rotationRate = aa.angle() / (sampleRotation.timestamp - oldsampleRotation.timestamp).toSecondsDouble(); + } + } + + //compute pressureRate + float pressureRate = 0; + PressureRate samplePressure; + samplePressure.timestamp = now; + samplePressure.pressure = data.pressure; + if (samplesPressure.size() < maxSamplesPressure) + { + samplesPressure.push_back(samplePressure); + } + else + { + samplesPressure[sampleIndexPressure] = samplePressure; + sampleIndexPressure = (sampleIndexPressure + 1) % maxSamplesPressure; + PressureRate oldsamplePressure; + oldsamplePressure.timestamp = samplesPressure.at(sampleIndexPressure).timestamp; + oldsamplePressure.pressure = samplesPressure.at(sampleIndexPressure).pressure; + pressureRate = (samplePressure.pressure - oldsamplePressure.pressure) / (samplePressure.timestamp - oldsamplePressure.timestamp).toSecondsDouble(); + } + + //compute angular accceleration Rate + float accelerationRate = 0; + AccelerationRate sampleAcceleration; + sampleAcceleration.timestamp = now; + sampleAcceleration.rotationRate = rotationRate; + if (samplesAcceleration.size() < maxSamplesAcceleration) + { + samplesAcceleration.push_back(sampleAcceleration); + } + else + { + samplesAcceleration[sampleIndexAcceleration] = sampleAcceleration; + sampleIndexAcceleration = (sampleIndexAcceleration + 1) % maxSamplesAcceleration; + AccelerationRate oldsampleAcceleration; + oldsampleAcceleration.timestamp = samplesAcceleration.at(sampleIndexAcceleration).timestamp; + oldsampleAcceleration.rotationRate = samplesAcceleration.at(sampleIndexAcceleration).rotationRate; + accelerationRate = (sampleAcceleration.rotationRate - oldsampleAcceleration.rotationRate) / (sampleAcceleration.timestamp - oldsampleAcceleration.timestamp).toSecondsDouble(); + } + if ((abs(pressureRate) > 50)) + { + ARMARX_IMPORTANT << "contact"; + } + + if (topicPrx) + { + topicPrx->reportSensorValues(data.id, data.pressure, data.qw, data.qx, data.qy, data.qz, pressureRate, rotationRate, accelerationRate, data.accelx, data.accely, data.accelz, nowTimestamp); + } + } +} + +// get imu values from incoming string +OrientedTactileSensorUnit::SensorData OrientedTactileSensorUnit::getValues(std::string line) +{ + SensorData data; + std::vector<std::string> splitValues; + boost::split(splitValues, line, boost::is_any_of(" ")); + data.id = stoi(splitValues.at(0)); + data.pressure = std::stof(splitValues.at(1)); + data.qw = std::stof(splitValues.at(2)); + data.qx = std::stof(splitValues.at(3)); + data.qy = std::stof(splitValues.at(4)); + data.qz = std::stof(splitValues.at(5)); + data.accelx = std::stof(splitValues.at(6)); + data.accely = std::stof(splitValues.at(7)); + data.accelz = std::stof(splitValues.at(8)); + return data; +} + +std::string space = " "; +bool OrientedTactileSensorUnit::loadCalibration() +{ + std::string calibrationStream = getProperty<std::string>("CalibrationData").getValue(); + std::string arduinoLine; + while (arduinoLine.find("mode") == std::string::npos) + { + getline(arduino, arduinoLine, '\n'); + } + arduino.close(); + + arduino.open(getProperty<std::string>("SerialInterfaceDevice").getValue(), std::ios::out); + arduino << "load"; + arduino.flush(); + arduino.close(); + + arduino.open(getProperty<std::string>("SerialInterfaceDevice").getValue(), std::ios::in); + while (arduinoLine.find("calibration data") == std::string::npos) + { + getline(arduino, arduinoLine, '\n'); + } + arduino.close(); + + arduino.open(getProperty<std::string>("SerialInterfaceDevice").getValue(), std::ios::out); + arduino << calibrationStream; + arduino.flush(); + arduino.close(); + + arduino.open(getProperty<std::string>("SerialInterfaceDevice").getValue(), std::ios::in); + + while (arduinoLine.find("Calibration Sucessfull") == std::string::npos) + { + getline(arduino, arduinoLine, '\n'); + } + return true; +} + +bool OrientedTactileSensorUnit::getCalibrationValues(std::string line) +{ + std::vector<std::string> splitValues; + boost::split(splitValues, line, boost::is_any_of(" ")); + calibration.accel_offset_x = stoi(splitValues.at(0)); + calibration.accel_offset_y = stoi(splitValues.at(1)); + calibration.accel_offset_z = stoi(splitValues.at(2)); + calibration.gyro_offset_x = stoi(splitValues.at(3)); + calibration.gyro_offset_y = stoi(splitValues.at(4)); + calibration.gyro_offset_z = stoi(splitValues.at(5)); + calibration.mag_offset_x = stoi(splitValues.at(6)); + calibration.mag_offset_y = stoi(splitValues.at(7)); + calibration.mag_offset_z = stoi(splitValues.at(8)); + calibration.accel_radius = stoi(splitValues.at(9)); + calibration.mag_radius = stoi(splitValues.at(10)); + std::string space = " "; + std::string calibrationStream = ""; + calibrationStream = calibrationStream + std::to_string(calibration.accel_offset_x) + space + std::to_string(calibration.accel_offset_y) + space + std::to_string(calibration.accel_offset_z) + space + std::to_string(calibration.gyro_offset_x) + space + std::to_string(calibration.gyro_offset_y) + space + + std::to_string(calibration.gyro_offset_z) + space + std::to_string(calibration.mag_offset_x) + space + std::to_string(calibration.mag_offset_y) + space + std::to_string(calibration.mag_offset_z) + space + std::to_string(calibration.accel_radius) + space + std::to_string(calibration.mag_radius) + space; + ARMARX_IMPORTANT << "calibration data: " << calibrationStream ; + return true; +} + + diff --git a/source/RobotAPI/drivers/OrientedTactileSensor/OrientedTactileSensorUnit.h b/source/RobotAPI/drivers/OrientedTactileSensor/OrientedTactileSensorUnit.h new file mode 100644 index 0000000000000000000000000000000000000000..38aade6a48c0be4e9742ad789dcaf05413410f53 --- /dev/null +++ b/source/RobotAPI/drivers/OrientedTactileSensor/OrientedTactileSensorUnit.h @@ -0,0 +1,145 @@ +#ifndef SENSORPACKAGEUNIT_H +#define SENSORPACKAGEUNIT_H + +#include <ArmarXCore/core/Component.h> +#include <RobotAPI/interface/units/UnitInterface.h> +#include <RobotAPI/interface/units/OrientedTactileSensorUnit.h> +#include <ArmarXCore/core/services/tasks/PeriodicTask.h> +#include <ArmarXCore/core/services/tasks/RunningTask.h> +#include <netinet/in.h> +#include <fstream> +#include <stdio.h> +#include <boost/date_time/posix_time/posix_time.hpp> +#include <Eigen/Dense> + +namespace armarx +{ + class OrientedTactileSensorUnitPropertyDefinitions: + public ComponentPropertyDefinitions + { + public: + OrientedTactileSensorUnitPropertyDefinitions(std::string prefix): + ComponentPropertyDefinitions(prefix) + { + defineOptionalProperty<std::string>( + "SerialInterfaceDevice", + "/dev/ttyACM0", + "The serial device the arduino is connected to."); + + defineOptionalProperty<std::string>( + "TopicName", + "OrientedTactileSensorValues", + "Name of the topic on which the sensor values are provided"); + + defineOptionalProperty<std::string>( + "CalibrationData", + "65524 3 12 65534 65534 1 1208 119 58726 1000 943 ", + "Sensor Register Data to calibrate the sensor"); + + defineOptionalProperty<std::string>( + "SamplesRotation", + "20", + "number of orientation values to differentiate"); + + defineOptionalProperty<std::string>( + "SamplesPressure", + "10", + "number of pressure values to differentiate"); + + defineOptionalProperty<std::string>( + "SamplesAcceleration", + "20", + "number of pressure values to differentiate"); + + defineOptionalProperty<bool>( + "calibrateSensor", + "false" + "Set true to calibrate the sensor and get calibration data and false to use existent calibration data"); + } + + }; + + /** + * @class OrientedTactileSensorUnit + * @brief ArmarX wrapper for an arduino due with one BNO055 IMU and one BMP280 pressure sensor + * + */ + class OrientedTactileSensorUnit: + virtual public armarx::Component + //TODO: needs interface to send calibration data + { + public: + OrientedTactileSensorUnit(); + + virtual std::string getDefaultName() const + { + return "OrientedTactileSensorUnit"; + } + + struct SensorData + { + int id; + float pressure; + float qw, qx, qy, qz; + float accelx, accely, accelz; + }; + + struct CalibrationData + { + int accel_offset_x, accel_offset_y, accel_offset_z, gyro_offset_x, gyro_offset_y, gyro_offset_z, mag_offset_x, mag_offset_y, mag_offset_z, accel_radius, mag_radius; + }; + + struct PressureRate + { + IceUtil::Time timestamp; + float pressure; + }; + + struct RotationRate + { + IceUtil::Time timestamp; + Eigen::Quaternionf orientation; + }; + + struct AccelerationRate + { + IceUtil::Time timestamp; + float rotationRate; + }; + struct LinAccRate + { + IceUtil::Time timestamp; + float accx, accy, accz; + }; + + protected: + virtual void onInitComponent(); + virtual void onConnectComponent(); + + virtual PropertyDefinitionsPtr createPropertyDefinitions(); + + private: + std::fstream arduino; + RunningTask<OrientedTactileSensorUnit>::pointer_type readTask; + OrientedTactileSensorUnitListenerPrx topicPrx; + OrientedTactileSensorUnitInterfacePrx interfacePrx; + + void run(); + SensorData getValues(std::string line); + bool getCalibrationValues(std::string line); + bool loadCalibration(); + int fd; + CalibrationData calibration; + + std::vector<RotationRate> samplesRotation; + std::vector<PressureRate> samplesPressure; + std::vector<AccelerationRate> samplesAcceleration; + int maxSamplesRotation; + int sampleIndexRotation; + int maxSamplesPressure; + int sampleIndexPressure; + int maxSamplesAcceleration; + int sampleIndexAcceleration; + }; +} +#endif // SENSORPACKAGEUNIT_H diff --git a/source/RobotAPI/interface/CMakeLists.txt b/source/RobotAPI/interface/CMakeLists.txt index 05f94f9bd5f6e0c55eb68b2e920acb88d7f9be0b..7e91b76b3c4051ad2b00abd973bba71eecbd315b 100644 --- a/source/RobotAPI/interface/CMakeLists.txt +++ b/source/RobotAPI/interface/CMakeLists.txt @@ -24,6 +24,7 @@ set(SLICE_FILES units/ForceTorqueUnit.ice units/InertialMeasurementUnit.ice units/LaserScannerUnit.ice + units/OptoForceUnit.ice units/HandUnitInterface.ice units/HapticUnit.ice units/WeissHapticUnit.ice @@ -35,6 +36,7 @@ set(SLICE_FILES units/TCPMoverUnitInterface.ice units/UnitInterface.ice units/ATINetFTUnit.ice + units/OrientedTactileSensorUnit.ice components/ViewSelectionInterface.ice diff --git a/source/RobotAPI/interface/CMakeLists.txt.orig b/source/RobotAPI/interface/CMakeLists.txt.orig new file mode 100644 index 0000000000000000000000000000000000000000..e28b236db5f3a6535a9007c2f835c1e56a0c651d --- /dev/null +++ b/source/RobotAPI/interface/CMakeLists.txt.orig @@ -0,0 +1,54 @@ +### +### CMakeLists.txt file for ArmarX Interfaces +### + +set(ROBOTAPI_INTERFACE_DEPEND ArmarXCore) + +set(SLICE_FILES + observers/KinematicUnitObserverInterface.ice + observers/PlatformUnitObserverInterface.ice + observers/ObserverFilters.ice + + core/PoseBase.ice + core/OrientedPoint.ice + core/LinkedPoseBase.ice + core/FramedPoseBase.ice + core/RobotState.ice + core/RobotStateObserverInterface.ice + core/Trajectory.ice + + selflocalisation/SelfLocalisationProcess.ice + + speech/SpeechInterface.ice + + units/ForceTorqueUnit.ice + units/InertialMeasurementUnit.ice + units/OptoForceUnit.ice + units/HandUnitInterface.ice + units/HapticUnit.ice + units/WeissHapticUnit.ice + units/HeadIKUnit.ice + units/KinematicUnitInterface.ice + units/PlatformUnitInterface.ice + units/RobotPoseUnitInterface.ice + units/TCPControlUnit.ice + units/TCPMoverUnitInterface.ice + units/UnitInterface.ice + units/ATINetFTUnit.ice +<<<<<<< HEAD + units/OrientedTactileSensorUnit.ice +======= +>>>>>>> master + + components/ViewSelectionInterface.ice + + visualization/DebugDrawerInterface.ice + + libraries/RTControllers/LVL1Controller.ice + libraries/RTControllers/PassThroughController.ice + libraries/RTControllers/RobotUnitInterface.ice +) + #core/RobotIK.ice + +# generate the interface library +armarx_interfaces_generate_library(RobotAPI "${ROBOTAPI_INTERFACE_DEPEND}") diff --git a/source/RobotAPI/interface/units/OptoForceUnit.ice b/source/RobotAPI/interface/units/OptoForceUnit.ice new file mode 100644 index 0000000000000000000000000000000000000000..c0085c06fa1a9838ad6e790440ffb3ff0a457a7c --- /dev/null +++ b/source/RobotAPI/interface/units/OptoForceUnit.ice @@ -0,0 +1,71 @@ +/* + * This file is part of ArmarX. + * + * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI + * @author Markus Grotz <markus dot grotz at kit dot edu> + * @date 2015 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#ifndef _ARMARX_ROBOTAPI_UNITS_OPTOFORCETUNIT_SLICE_ +#define _ARMARX_ROBOTAPI_UNITS_OPTOFORCETUNIT_SLICE_ + + +#include <RobotAPI/interface/units/UnitInterface.ice> +#include <RobotAPI/interface/core/RobotState.ice> + +#include <ArmarXCore/interface/core/UserException.ice> +#include <ArmarXCore/interface/core/BasicTypes.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> +#include <ArmarXCore/interface/observers/Matrix.ice> +#include <ArmarXCore/interface/observers/Timestamp.ice> +#include <ArmarXCore/interface/observers/ObserverInterface.ice> + + + +module armarx +{ + /** + * Implements an interface to an OptoForceUnit. + **/ + interface OptoForceUnitInterface extends armarx::SensorActorUnitInterface + { + }; + /** + * Implements an interface to an OptoForceUnitListener. + **/ + interface OptoForceUnitListener + { + /** + * reportSensorValues reports the IMU sensor values from a given sensor device. + * @param device Name of IMU sensor device. + * @param values IMU sensor data. + * @param timestamp Timestamp of the measurement. + **/ + void reportSensorValues(string device, string name, float fx, float fy, float fz, TimestampBase timestamp); + }; + /** + * Implements an interface to an OptoForceUnitObserver. + **/ + interface OptoForceUnitObserverInterface extends ObserverInterface, OptoForceUnitListener + { + }; + +}; + +#endif diff --git a/source/RobotAPI/interface/units/OrientedTactileSensorUnit.ice b/source/RobotAPI/interface/units/OrientedTactileSensorUnit.ice new file mode 100644 index 0000000000000000000000000000000000000000..48a0fdd7de288b78b50b4bb67343adfe30275fe1 --- /dev/null +++ b/source/RobotAPI/interface/units/OrientedTactileSensorUnit.ice @@ -0,0 +1,59 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI + * @author Martin Do ( martin dot do at kit dot edu ) + * @date 2015 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#ifndef _ARMARX_ROBOTAPI_UNITS_SENSORPACKAGE_SLICE_ +#define _ARMARX_ROBOTAPI_UNITS_SENSORPACKAGE_SLICE_ + +#include <RobotAPI/interface/core/PoseBase.ice> +#include <RobotAPI/interface/units/UnitInterface.ice> +#include <ArmarXCore/interface/observers/Timestamp.ice> +#include <ArmarXCore/interface/core/UserException.ice> + +module armarx +{ + /** + * Will be thrown, if a Arduino error occurs. + */ + exception ArduinoException extends UserException + { + int errorCode; + }; + + + interface OrientedTactileSensorUnitInterface extends armarx::SensorActorUnitInterface + { + //bool loadCalibration(int accel_offset_x, int accel_offset_y, int accel_offset_z, int gyro_offset_x, int gyro_offset_y, int gyro_offset_z, int mag_offset_x, int mag_offset_y, int mag_offset_z, int accel_radius, int mag_radius ); + }; + + interface OrientedTactileSensorUnitListener + { + void reportSensorValues(int id, float pressure, float qw, float qx, float qy, float qz, float pressureRate, float rotationRate, float accelerationRate, float accelx, float accely, float accelz, TimestampBase timestamp); + }; + + + interface OrientedTactileSensorUnitObserverInterface extends ObserverInterface, OrientedTactileSensorUnitListener + { + + }; +}; + +#endif diff --git a/source/RobotAPI/libraries/core/Trajectory.cpp b/source/RobotAPI/libraries/core/Trajectory.cpp index ee7495af91d4e6a32558b3238536659dcd603c02..082e6fa7a3c2acbea62c3863dac7c3951226e5a1 100644 --- a/source/RobotAPI/libraries/core/Trajectory.cpp +++ b/source/RobotAPI/libraries/core/Trajectory.cpp @@ -31,7 +31,6 @@ namespace armarx Trajectory::~Trajectory() { - } void Trajectory::ice_preMarshal() @@ -63,6 +62,7 @@ namespace armarx void Trajectory::ice_postUnmarshal() { int i = 0; + dataMap.clear(); for (DoubleSeqSeq& _2DVec : dataVec) { @@ -185,8 +185,7 @@ namespace armarx checkValue(dataVec[i]); dataEntry.data.push_back(DoubleSeqPtr(new Ice::DoubleSeq(1, dataVec[i]))); } - - dataMap.insert(dataEntry); + dataMap.insert(std::move(dataEntry)); } } @@ -489,6 +488,10 @@ namespace armarx double Trajectory::getLength(size_t derivation) const { + if (size() == 0) + { + return 0; + } return getLength(derivation, begin()->getTimestamp(), rbegin()->getTimestamp()); } @@ -496,8 +499,8 @@ namespace armarx { double length = 0.0; const ordered_view& ordv = dataMap.get<TagOrdered>(); - ordered_view::iterator itO = ordv.lower_bound(startTime); - ordered_view::iterator itOEnd = ordv.upper_bound(endTime); + ordered_view::const_iterator itO = ordv.lower_bound(startTime); + ordered_view::const_iterator itOEnd = ordv.upper_bound(endTime); if (itO == ordv.end()) { return 0.0; @@ -506,31 +509,52 @@ namespace armarx Ice::DoubleSeq prevValue(dimensions); for (size_t d = 0; d < dimensions; ++d) { - prevValue[d] = itO->getDeriv(d, derivation); + prevValue[d] = getState(startTime, d, derivation); } + itO++; + + double segmentLength = 0; for (; - itO != itOEnd; + itO != itOEnd && itO != ordv.end(); itO++ ) { - double segmentLength = 0; + if (itO->getTimestamp() >= endTime) + { + break; + } + segmentLength = 0; double value; for (size_t d = 0; d < dimensions; ++d) { value = itO->getDeriv(d, derivation); - segmentLength += pow(prevValue[d] - value, 2); + double diff = value - prevValue[d]; + segmentLength += diff * diff; prevValue[d] = value; } - length = sqrt(segmentLength); + length += sqrt(segmentLength); } - + segmentLength = 0; + // interpolate end values + for (size_t d = 0; d < dimensions; ++d) + { + double value = getState(endTime, d, derivation); + double diff = value - prevValue[d]; + segmentLength += diff * diff; + prevValue[d] = value; + } + length += sqrt(segmentLength); return length; } double Trajectory::getLength(size_t dimension, size_t derivation) const { + if (size() == 0) + { + return 0; + } return getLength(dimension, derivation, begin()->getTimestamp(), rbegin()->getTimestamp()); } @@ -544,17 +568,21 @@ namespace armarx { return 0.0; } - double prevValue = itO->getDeriv(dimension, derivation); + double prevValue = getState(startTime, dimension, derivation); for (; - itO != itOEnd; + itO != itOEnd && itO != ordv.end(); itO++ ) { + if (itO->getTimestamp() >= endTime) + { + break; + } length += fabs(prevValue - itO->getDeriv(dimension, derivation)); prevValue = itO->getDeriv(dimension, derivation); } - + length += fabs(prevValue - getState(endTime, dimension, derivation)); return length; } @@ -968,7 +996,7 @@ namespace armarx newData.timestamp = t; newData.data = std::vector<DoubleSeqPtr>(std::max((size_t)1, dim())); newData.data[dimIndex] = DoubleSeqPtr(new Ice::DoubleSeq(y)); - dataMap.insert(newData); + dataMap.insert(std::move(newData)); } else { diff --git a/source/RobotAPI/libraries/core/Trajectory.h b/source/RobotAPI/libraries/core/Trajectory.h index e6805755c6ca256ce2f544f8f4d96e4a7b4cc901..33422bc0098b83a4fb23ffee3bfc099d77f46d58 100644 --- a/source/RobotAPI/libraries/core/Trajectory.h +++ b/source/RobotAPI/libraries/core/Trajectory.h @@ -102,7 +102,7 @@ namespace armarx int i = 0; for (auto& elem : s.data) { - data[i++] = elem; + data[i++].reset(new Ice::DoubleSeq(*elem)); } trajectory = nullptr; return *this; @@ -176,7 +176,7 @@ namespace armarx mutable std::vector< DoubleSeqPtr > data; // mutable so that it can be changed protected: Trajectory* trajectory = nullptr; - friend class Trajectory; + // friend class Trajectory; }; diff --git a/source/RobotAPI/libraries/core/test/TrajectoryTest.cpp b/source/RobotAPI/libraries/core/test/TrajectoryTest.cpp index db6263acd9606a9789b0f45f501f0da8c96a30a0..b657d0f3a8d9a93c1a6856db492172bab695a521 100644 --- a/source/RobotAPI/libraries/core/test/TrajectoryTest.cpp +++ b/source/RobotAPI/libraries/core/test/TrajectoryTest.cpp @@ -65,7 +65,7 @@ BOOST_AUTO_TEST_CASE(TrajectoryIteratorUsage) } // or with c++11 for loop: - for (const Trajectory::TrajData & element : *trajectory) + for (const Trajectory::TrajData& element : *trajectory) { ARMARX_INFO_S << "Position at " << element.getTimestamp() << " :" << element.getPosition(0); } @@ -133,7 +133,7 @@ BOOST_AUTO_TEST_CASE(TrajectoryPerformanceTest) int count = 1000; for (int i = 0; i < count; ++i) { - timestamps.push_back(rand()); + timestamps.push_back(i); } TrajectoryPtr traj(new Trajectory()); for (int var = 0; var < 8; ++var) @@ -158,9 +158,62 @@ BOOST_AUTO_TEST_CASE(TrajectoryPerformanceTest) ARMARX_INFO_S << "Unmarshalled"; traj->getLength(); ARMARX_INFO_S << "Length calculated"; + IceUtil::Time start = IceUtil::Time::now(); + float dummyVar = 0; + int dims = traj->dim(); + for (const Trajectory::TrajData& data : *traj) + { + for (int d = 0; d < dims; ++d) + { + dummyVar += data.getPosition(d); + } + } + IceUtil::Time end = IceUtil::Time::now(); + ARMARX_INFO << "time per iteration in microseconds: " << (end - start).toMicroSecondsDouble() / traj->size(); + int iterationCount = 0; + start = IceUtil::Time::now(); + for (float t = 0; t < 1000; t += 0.32) + { + for (int d = 0; d < dims; ++d) + { + dummyVar += traj->getState(t, d); + } + iterationCount++; + } + end = IceUtil::Time::now(); + ARMARX_INFO << "time per iteration with interpolation in microseconds: " << (end - start).toMicroSecondsDouble() / iterationCount; + ARMARX_INFO << VAROUT(dummyVar); BOOST_CHECK_EQUAL(traj->getState(0), traj2->getState(0)); } +BOOST_AUTO_TEST_CASE(TrajectoryUnmarshalTest) +{ + Ice::DoubleSeq timestamps; + int count = 1000; + for (int i = 0; i < count; ++i) + { + timestamps.push_back(i); + } + TrajectoryPtr traj(new Trajectory()); + for (int var = 0; var < 8; ++var) + { + Ice::DoubleSeq p; + p.reserve(count); + for (int i = 0; i < count; ++i) + { + p.push_back(rand()); + } + traj->addDimension(p, timestamps); + } + ARMARX_INFO_S << "Starting"; + traj->ice_preMarshal(); + + traj->clear(); + traj->ice_postUnmarshal(); + ARMARX_INFO << "length: " << traj->getLength(); + traj->getLength(0, 50, 350); +} + BOOST_AUTO_TEST_CASE(TrajectorySerializationTest) { @@ -180,10 +233,10 @@ BOOST_AUTO_TEST_CASE(TrajectorySerializationTest) BOOST_AUTO_TEST_CASE(TrajectoryLengthTest) { - FloatSeqSeq positions {{ 0, 0, 1 }, { 0, 1, 1 }}; - TrajectoryPtr traj = new Trajectory(positions, {}, {"joint1", "joint2"}); + FloatSeqSeq jointtrajectories {{ 0, 0, 1 }, { 0, 1, 1 }}; + TrajectoryPtr traj = new Trajectory(jointtrajectories, {}, {"joint1", "joint2"}); - BOOST_CHECK_EQUAL(traj->getLength(), (Eigen::Vector3f(positions[0].data()) - Eigen::Vector3f(positions[1].data())).norm()); + BOOST_CHECK_EQUAL(traj->getLength(), 2); } BOOST_AUTO_TEST_CASE(TrajectoryCopyIfTest) diff --git a/source/RobotAPI/statecharts/CMakeLists.txt b/source/RobotAPI/statecharts/CMakeLists.txt index 9674d17827b4ccdbbbb27200138ee005c56bd60e..4a443a85124ef05f0647e460d8c0abdd6657eed4 100644 --- a/source/RobotAPI/statecharts/CMakeLists.txt +++ b/source/RobotAPI/statecharts/CMakeLists.txt @@ -2,4 +2,5 @@ add_subdirectory(operations) add_subdirectory(WeissHapticGroup) -add_subdirectory(StatechartProfilesTestGroup) \ No newline at end of file +add_subdirectory(StatechartProfilesTestGroup) +add_subdirectory(OrientedTactileSensorGroup) \ No newline at end of file diff --git a/source/RobotAPI/statecharts/OrientedTactileSensorGroup/CMakeLists.txt b/source/RobotAPI/statecharts/OrientedTactileSensorGroup/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..6b74ac6725815d3f89da08fff09c180b909211a1 --- /dev/null +++ b/source/RobotAPI/statecharts/OrientedTactileSensorGroup/CMakeLists.txt @@ -0,0 +1,48 @@ +armarx_component_set_name("OrientedTactileSensorGroup") + +#find_package(MyLib QUIET) +#armarx_build_if(MyLib_FOUND "MyLib not available") +# +# all include_directories must be guarded by if(Xyz_FOUND) +# for multiple libraries write: if(X_FOUND AND Y_FOUND).... +#if(MyLib_FOUND) +# include_directories(${MyLib_INCLUDE_DIRS}) +#endif() + +#find_package(Eigen3 QUIET) +#find_package(Simox QUIET) + +# +#armarx_build_if(Eigen3_FOUND "Eigen3 not available") +#armarx_build_if(Simox_FOUND "Simox-VirtualRobot not available") + +# +#if (Eigen3_FOUND AND Simox_FOUND) +# include_directories( +# ${Eigen3_INCLUDE_DIR} +# ${Simox_INCLUDE_DIRS} +# ) +#endif() + +set(COMPONENT_LIBS +# RobotAPIInterfaces RobotAPICore + ArmarXCoreInterfaces ArmarXCore ArmarXCoreStatechart ArmarXCoreObservers) + +# Sources + +set(SOURCES +OrientedTactileSensorGroupRemoteStateOfferer.cpp +./OrientedTactileSensorTest.cpp +#@TEMPLATE_LINE@@COMPONENT_PATH@/@COMPONENT_NAME@.cpp +) + +set(HEADERS +OrientedTactileSensorGroupRemoteStateOfferer.h +OrientedTactileSensorGroup.scgxml +./OrientedTactileSensorTest.h +#@TEMPLATE_LINE@@COMPONENT_PATH@/@COMPONENT_NAME@.h +./OrientedTactileSensorTest.xml +#@TEMPLATE_LINE@@COMPONENT_PATH@/@COMPONENT_NAME@.xml +) + +armarx_add_component("${SOURCES}" "${HEADERS}") diff --git a/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorGroup.scgxml b/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorGroup.scgxml new file mode 100644 index 0000000000000000000000000000000000000000..58dc416b8a4de1b86d3b582acc5d44b048279c9d --- /dev/null +++ b/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorGroup.scgxml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<StatechartGroup name="OrientedTactileSensorGroup" package="RobotAPI" generateContext="true"> + <Proxies/> + <Configurations/> + <State filename="OrientedTactileSensorTest.xml" visibility="public"/> +</StatechartGroup> + diff --git a/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorGroupRemoteStateOfferer.cpp b/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorGroupRemoteStateOfferer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a016ee99ca74581045089b05f3152589586d442c --- /dev/null +++ b/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorGroupRemoteStateOfferer.cpp @@ -0,0 +1,66 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::OrientedTactileSensorGroup::OrientedTactileSensorGroupRemoteStateOfferer + * @author andreeatulbure ( andreea_tulbure at yahoo dot de ) + * @date 2017 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#include "OrientedTactileSensorGroupRemoteStateOfferer.h" + +using namespace armarx; +using namespace OrientedTactileSensorGroup; + +// DO NOT EDIT NEXT LINE +OrientedTactileSensorGroupRemoteStateOfferer::SubClassRegistry OrientedTactileSensorGroupRemoteStateOfferer::Registry(OrientedTactileSensorGroupRemoteStateOfferer::GetName(), &OrientedTactileSensorGroupRemoteStateOfferer::CreateInstance); + + + +OrientedTactileSensorGroupRemoteStateOfferer::OrientedTactileSensorGroupRemoteStateOfferer(StatechartGroupXmlReaderPtr reader) : + XMLRemoteStateOfferer < OrientedTactileSensorGroupStatechartContext > (reader) +{ +} + +void OrientedTactileSensorGroupRemoteStateOfferer::onInitXMLRemoteStateOfferer() +{ + +} + +void OrientedTactileSensorGroupRemoteStateOfferer::onConnectXMLRemoteStateOfferer() +{ + +} + +void OrientedTactileSensorGroupRemoteStateOfferer::onExitXMLRemoteStateOfferer() +{ + +} + +// DO NOT EDIT NEXT FUNCTION +std::string OrientedTactileSensorGroupRemoteStateOfferer::GetName() +{ + return "OrientedTactileSensorGroupRemoteStateOfferer"; +} + +// DO NOT EDIT NEXT FUNCTION +XMLStateOffererFactoryBasePtr OrientedTactileSensorGroupRemoteStateOfferer::CreateInstance(StatechartGroupXmlReaderPtr reader) +{ + return XMLStateOffererFactoryBasePtr(new OrientedTactileSensorGroupRemoteStateOfferer(reader)); +} + + + diff --git a/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorGroupRemoteStateOfferer.h b/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorGroupRemoteStateOfferer.h new file mode 100644 index 0000000000000000000000000000000000000000..c387c8e489f740fcfd795db81d8414d9a6bf9125 --- /dev/null +++ b/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorGroupRemoteStateOfferer.h @@ -0,0 +1,54 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::OrientedTactileSensorGroup + * @author andreeatulbure ( andreea_tulbure at yahoo dot de ) + * @date 2017 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#ifndef _ARMARX_XMLUSERCODE_RobotAPI_OrientedTactileSensorGroup_REMOTESTATEOFFERER_H +#define _ARMARX_XMLUSERCODE_RobotAPI_OrientedTactileSensorGroup_REMOTESTATEOFFERER_H + +#include <ArmarXCore/statechart/xmlstates/XMLRemoteStateOfferer.h> +#include "OrientedTactileSensorGroupStatechartContext.generated.h" + +namespace armarx +{ + namespace OrientedTactileSensorGroup + { + class OrientedTactileSensorGroupRemoteStateOfferer : + virtual public XMLRemoteStateOfferer < OrientedTactileSensorGroupStatechartContext > // Change this statechart context if you need another context (dont forget to change in the constructor as well) + { + public: + OrientedTactileSensorGroupRemoteStateOfferer(StatechartGroupXmlReaderPtr reader); + + // inherited from RemoteStateOfferer + void onInitXMLRemoteStateOfferer(); + void onConnectXMLRemoteStateOfferer(); + void onExitXMLRemoteStateOfferer(); + + // static functions for AbstractFactory Method + static std::string GetName(); + static XMLStateOffererFactoryBasePtr CreateInstance(StatechartGroupXmlReaderPtr reader); + static SubClassRegistry Registry; + + + }; + } +} + +#endif diff --git a/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorTest.cpp b/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorTest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ff18ceb1d2d9fed9466b7a6cdf32057cc24d99d1 --- /dev/null +++ b/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorTest.cpp @@ -0,0 +1,74 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::OrientedTactileSensorGroup + * @author andreeatulbure ( andreea_tulbure at yahoo dot de ) + * @date 2017 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#include "OrientedTactileSensorTest.h" + +using namespace armarx; +using namespace OrientedTactileSensorGroup; + +// DO NOT EDIT NEXT LINE +OrientedTactileSensorTest::SubClassRegistry OrientedTactileSensorTest::Registry(OrientedTactileSensorTest::GetName(), &OrientedTactileSensorTest::CreateInstance); + + + +void OrientedTactileSensorTest::onEnter() +{ + //OrientedTactileSensorGroupStatechartContext* context = getContext<OrientedTactileSensorGroupStatechartContext>(); + //HapticUnitObserverInterfacePrx hapticObserver = context->getHapticObserver(); + //ChannelRegistry channels = hapticObserver->getAvailableChannels(false); + //std::map<std::string, DatafieldRefPtr> tactileDatafields_MaximumValueMap; + + //local.setTactileDatafields_MaximumValue(tactileDatafields_MaximumValueMap); +} + +//void OrientedTactileSensorTest::run() +//{ +// // put your user code for the execution-phase here +// // runs in seperate thread, thus can do complex operations +// // should check constantly whether isRunningTaskStopped() returns true +// +//// uncomment this if you need a continous run function. Make sure to use sleep or use blocking wait to reduce cpu load. +// while (!isRunningTaskStopped()) // stop run function if returning true +// { +// // do your calculations +// } +//} + +//void OrientedTactileSensorTest::onBreak() +//{ +// // put your user code for the breaking point here +// // execution time should be short (<100ms) +//} + +void OrientedTactileSensorTest::onExit() +{ + // put your user code for the exit point here + // execution time should be short (<100ms) +} + + +// DO NOT EDIT NEXT FUNCTION +XMLStateFactoryBasePtr OrientedTactileSensorTest::CreateInstance(XMLStateConstructorParams stateData) +{ + return XMLStateFactoryBasePtr(new OrientedTactileSensorTest(stateData)); +} + diff --git a/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorTest.h b/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorTest.h new file mode 100644 index 0000000000000000000000000000000000000000..1fb2ae423a4fe17baa3332bad009f5ba996ea2a2 --- /dev/null +++ b/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorTest.h @@ -0,0 +1,58 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::OrientedTactileSensorGroup + * @author andreeatulbure ( andreea_tulbure at yahoo dot de ) + * @date 2017 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#ifndef _ARMARX_XMLUSERCODE_RobotAPI_OrientedTactileSensorGroup_OrientedTactileSensorTest_H +#define _ARMARX_XMLUSERCODE_RobotAPI_OrientedTactileSensorGroup_OrientedTactileSensorTest_H + +#include <RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorTest.generated.h> + +namespace armarx +{ + namespace OrientedTactileSensorGroup + { + class OrientedTactileSensorTest : + public OrientedTactileSensorTestGeneratedBase <OrientedTactileSensorTest> + { + public: + OrientedTactileSensorTest(const XMLStateConstructorParams& stateData): + XMLStateTemplate <OrientedTactileSensorTest> (stateData), OrientedTactileSensorTestGeneratedBase <OrientedTactileSensorTest> (stateData) + { + } + + // inherited from StateBase + void onEnter(); + // void run(); + // void onBreak(); + void onExit(); + + // static functions for AbstractFactory Method + static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData); + static SubClassRegistry Registry; + + // DO NOT INSERT ANY CLASS MEMBERS, + // use stateparameters instead, + // if classmember are neccessary nonetheless, reset them in onEnter + }; + } +} + +#endif diff --git a/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorTest.xml b/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..dd45021130cdeb24d567e59466e9600161d7b403 --- /dev/null +++ b/source/RobotAPI/statecharts/OrientedTactileSensorGroup/OrientedTactileSensorTest.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<State version="1.2" name="OrientedTactileSensorTest" uuid="83D59864-EC09-4DA1-8773-7FF6D0E74A6A" width="800" height="600" type="Normal State"> + <InputParameters/> + <OutputParameters/> + <LocalParameters/> + <Substates/> + <Events> + <Event name="Failure"> + <Description>Event for statechart-internal failures or optionally user-code failures</Description> + </Event> + </Events> + <Transitions/> +</State> +