diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e313b4b308e4baa1c605acc1dcd1490d95afe707..9f817e634b94f4d1c26bc6de522737f8ea626b1a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,11 +27,11 @@ Build Monitoring: rules: - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH changes: - - src/environment_monitoring/**/* + - src/monitoring/**/* - requirements.txt - .gitlab-ci.yml script: - - docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/monitoring -f ./src/environment_monitoring/Dockerfile --no-cache . + - docker build -t $CI_REGISTRY/$CI_PROJECT_PATH/monitoring -f ./src/monitoring/Dockerfile --no-cache . - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker push $CI_REGISTRY/$CI_PROJECT_PATH/monitoring:latest @@ -77,12 +77,12 @@ Deploy Monitoring: rules: - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH changes: - - src/environment_monitoring/**/* + - src/monitoring/**/* - requirements.txt - .gitlab-ci.yml needs: ["Build Monitoring"] script: - - cp ./src/environment_monitoring/docker-compose.yml $app_path/docker-compose-monitoring.yml + - cp ./src/monitoring/docker-compose.yml $app_path/docker-compose-monitoring.yml - cd $app_path - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker-compose -f docker-compose-monitoring.yml pull diff --git a/assets/interfaces/base_stations.soil b/assets/interfaces/base_stations.soil index fe3aa45f49bf785804c6df9fd29eed13c59db211..02822b3694725072808a5e1ca1915234ba8989f9 100644 --- a/assets/interfaces/base_stations.soil +++ b/assets/interfaces/base_stations.soil @@ -1,39 +1,41 @@ +@prefix quantitykind: <http://qudt.org/vocab/quantitykind/> ; +@prefix unit: <http://qudt.org/vocab/unit/> ; + import utils; -measurement Azimuth { +variable Azimuth defines <quantitykind:Angle> { name: "Azimuth" description: "Current position of azimuth rotation encoder in Radian." datatype: float dimension: [] - unit: Radian + unit: <unit:RAD> range: (0, 3.14) } -measurement Elevation { +variable Elevation defines <quantitykind:Angle> { name: "Elevation" description: "Current position of elevation rotation encoder in Radian." datatype: float dimension: [] - unit: Radian + unit: <unit:RAD> range: (0, 3.14) } -measurement Distance { +variable Distance defines <quantitykind:Distance> { name: "Distance" description: "Measured distance to the currently activate target." datatype: float dimension: [] - unit: metre + unit: <unit:M> range: (0, 100) } -parameter Interval { +variable Interval defines <quantitykind:Time> { name: "Interval" description: "Interval in seconds." datatype: float dimension: [] - default: 10 - unit: seconds + unit: <unit:SEC> range: (0, 360) } @@ -59,14 +61,14 @@ component Base { Jog jog PointTo point_to parameters: - utils.State state - Interval interval + utils.State state = OK + Interval interval = 10 measurements: - utils.Position position - utils.Quaternion quaternion - Azimuth azimuth - Elevation elevation - Distance distance + internal utils.Position position + internal utils.Quaternion quaternion + internal Azimuth azimuth + internal Elevation elevation + internal Distance distance streams: position: update diff --git a/assets/interfaces/environment_monitoring.soil b/assets/interfaces/environment_monitoring.soil deleted file mode 100644 index 9b0112e5c8f42260fdb54ce2339c2d2a7e0dc1ea..0000000000000000000000000000000000000000 --- a/assets/interfaces/environment_monitoring.soil +++ /dev/null @@ -1,83 +0,0 @@ -parameter Location { - name: "Location" - description: "Human interpretable description of the current location of sensor." - datatype: string - dimension: [] -} - -measurement BatteryLevel { - name: "Battery level" - description: "Battery level" - datatype: float - range: (0, 100) - dimension: [] - unit: Percent -} - -measurement SignalStrength { - name: "Signal strength" - description: "Strength of the signal of the wireless environmental sensor." - datatype: float - range: (0, 100) - dimension: [] - unit: Percent -} - -measurement Temperature { - name: "Ambient temperature" - description: "The current ambient temperature." - datatype: float - range: (-20, 50) - dimension: [] - unit: Celsius -} - -measurement Pressure { - name: "Relative air pressure" - description: "The current air pressure." - datatype: float - range: (900, 1200) - dimension: [] - unit: hPA -} - -measurement Humidity { - name: "Relative humidity" - description: "Relative humidity." - datatype: float - range: (0, 100) - dimension: [] - unit: Percent -} - -component EnvironmentalSensor { - name: "Environmental Sensor" - description: "A single wireless environmental sensor, measuring temperature, pressure and humidity." - measurements: - Temperature temperature - Pressure pressure - Humidity humidity - SignalStrength signalStrength - BatteryLevel batteryLevel - parameters: - Location location - - streams: - temperature: fixed(5) - pressure: fixed(5) - humidity: fixed(5) - signalStrength: fixed(10) - batteryLevel: fixed(10) - - if batteryLevel < 5: warning("Battery level is low, please replace battery. Otherwise the sensor will not send data anymore.") - -} - -component EnvironmentalSensorManager { - name: "Manager of environmental sensors" - description: "Manages a set of environmental sensors" - components: - dynamic EnvironmentalSensor sensor(location="Pillar A") -} - -interface EnvironmentalSensorManager monitoring {} \ No newline at end of file diff --git a/assets/interfaces/lasertracker.soil b/assets/interfaces/lasertracker.soil index b6b9c5903e22d9489791a79f4d853e61a656f06d..bde0816e135ac972626ff3ba696b58ae494d5e1c 100644 --- a/assets/interfaces/lasertracker.soil +++ b/assets/interfaces/lasertracker.soil @@ -1,29 +1,31 @@ +@prefix schema: <http://schema.org/> ; +@prefix unit: <http://qudt.org/vocab/unit/> ; + +import mobile_entities; import utils; import base_stations; -import mobile_entities; -parameter Time { + +variable Time defines <schema:DateTime> { name: "Time" description: "Current system time." datatype: time dimension: [] } -parameter Version { +variable Version defines <schema:version> { name: "Version" description: "Incremental API-Version." datatype: int - default: 2 range: (0, 100) dimension: [] - unit: UNITLESS + unit: <unit:UNITLESS> } -parameter Manufacturer { +variable Manufacturer defines <schema:manufacturer> { name: "Manufacturer" description: "Name of manufacturing company." datatype: string - default: "Laboratory for Machine Tools and Production Engineering WZL of RWTH Aachen" dimension: [] } @@ -48,7 +50,7 @@ component Lasertracker { Shutdown shutdown parameters: utils.State state = OK - constant Manufacturer manufacturer = "Laboratory for Machine Tools and Production Engineering WZL of RWTH Aachen" + constant Manufacturer manufacturer = "API" constant Version version = 1 Time time diff --git a/assets/interfaces/mobile_entities.soil b/assets/interfaces/mobile_entities.soil index 82215adc511e68333d62cdc03bd307a30e386aa4..3eaa17636b451b09e4bd5d57127f00f42c370011 100644 --- a/assets/interfaces/mobile_entities.soil +++ b/assets/interfaces/mobile_entities.soil @@ -1,4 +1,5 @@ import utils; +@prefix unit: <http://qudt.org/vocab/unit/> ; enum Mode { CONTINUOUS @@ -7,26 +8,24 @@ enum Mode { IDLE } -parameter Mode { +variable Mode { name: "Mode" description: "Current state of the entity. In CONTINUOUS mode, values are dispatched as fast as possible. In TRIGGERED mode, values are only dispatches after a software trigger. In EXTERNAL mode, values are dispatched in accordance to an external trigger, e.g. probe or TTL. IDLE means the entity is currently not used." - default: CONTINUOUS datatype: enum range: Mode dimension: [] } -parameter Type { +variable Type { name: "Type" description: "System specific identifier of the target Type, e.g. SMR or Active SMR." datatype: string dimension: [] - default: "SMR" } -measurement Locked { +variable Locked { name: "Locked" - description: "Boolean flag scpecifing whether the target is locked in." + description: "Boolean flag specifying whether the target is locked in." datatype: boolean dimension: [] } @@ -36,9 +35,31 @@ function Reset { description: "Starts the search routine around the current direction." } -function Trigger { +variable Counter { + name: "Counter" + description: "Natural numeric value." + datatype: int + dimension: [] + range: (1,1000) + unit: <unit:UNITLESS> +} + +variable Label { + name: "Label" + description: "A string serving as comment." + datatype: string + dimension: [] +} + +function Trigger streaming { name: "Trigger" - description: "Trigger count measurements and set the resulting label. This function is only allowed in triggered acquisition mode." + description: "Trigger count variables and set the resulting label. This function is only allowed in triggered acquisition mode." + arguments: + Counter counter = 100 + Label label = "test" + returns: + utils.Position position + Label outputLabel } component Target { @@ -50,11 +71,11 @@ component Target { measurements: utils.Position position utils.Quaternion quaternion - Locked locked + internal Locked locked parameters: - utils.State state - Mode mode - Type type + utils.State state = OK + Mode mode = CONTINUOUS + Type type = "SMR" streams: position: update @@ -68,4 +89,6 @@ component MobileEntities { description: "Object acting as a list of mobile entities in the metrology system." components: dynamic Target target -} \ No newline at end of file +} + +interface Target myTarget{} \ No newline at end of file diff --git a/assets/semantic_interfaces/environment_monitoring.soil b/assets/interfaces/monitoring.soil similarity index 87% rename from assets/semantic_interfaces/environment_monitoring.soil rename to assets/interfaces/monitoring.soil index a92a995bf465ee6f5bff927a481bfbcff910a655..b8c5720dfdd2ebf717d781303de2609d5b136e91 100644 --- a/assets/semantic_interfaces/environment_monitoring.soil +++ b/assets/interfaces/monitoring.soil @@ -1,14 +1,14 @@ @prefix quantitykind: <http://qudt.org/vocab/quantitykind/> ; @prefix unit: <http://qudt.org/vocab/unit/> ; -parameter Location { +variable Location { name: "Location" description: "Human interpretable description of the current location of sensor." datatype: string dimension: [] } -measurement BatteryLevel { +variable BatteryLevel { name: "Battery level" description: "Battery level" datatype: int @@ -17,7 +17,7 @@ measurement BatteryLevel { unit: <unit:PERCENT> } -measurement SignalStrength defines <quantitykind:SignalStrength> { +variable SignalStrength defines <quantitykind:SignalStrength> { name: "Signal strength" description: "Strength of the signal of the wireless environmental sensor." datatype: int @@ -26,7 +26,7 @@ measurement SignalStrength defines <quantitykind:SignalStrength> { unit: <unit:PERCENT> } -measurement Temperature defines <quantitykind:Temperature> { +variable Temperature defines <quantitykind:Temperature> { name: "Ambient temperature" description: "The current ambient temperature." datatype: float @@ -35,7 +35,7 @@ measurement Temperature defines <quantitykind:Temperature> { unit: <unit:DEG_C> } -measurement Pressure defines <quantitykind:AtmosphericPressure> { +variable Pressure defines <quantitykind:AtmosphericPressure> { name: "Atmospheric pressure" description: "The current atmospheric pressure." datatype: float @@ -44,7 +44,7 @@ measurement Pressure defines <quantitykind:AtmosphericPressure> { unit: <unit:HectoPA> } -measurement Humidity defines <quantitykind:RelativeHumidity> { +variable Humidity defines <quantitykind:RelativeHumidity> { name: "Relative humidity" description: "Relative humidity." datatype: float diff --git a/assets/interfaces/robot.soil b/assets/interfaces/robot.soil index b7432e99b77301c7473a6ce59c8076cb1e7f620a..5f9f26f766b6570a8af667d1bddf3e2a7993eee6 100644 --- a/assets/interfaces/robot.soil +++ b/assets/interfaces/robot.soil @@ -1,51 +1,54 @@ -measurement Position { +@prefix quantitykind: <http://qudt.org/vocab/quantitykind/> ; +@prefix unit: <http://qudt.org/vocab/unit/> ; +@prefix dbo: <http://dbpedia.org/ontology/> ; +@prefix schema: <http://schema.org/> ; + +variable Position defines <quantitykind:CartesianCoordinates> { name: "Position" description: "Position in Cartesian coordinates given in metre." datatype: float range: (-50, 50) dimension: [3] - unit: Metre + unit: <unit:M> } -measurement TCP { +variable TCP defines <quantitykind:CartesianCoordinates> { name: "Tool Center Point" - description: "Tool center point of a six-arm robot." + description: "Tool center point of a six-joint robot." datatype: float range: (-0.5,0.5) dimension: [3] - unit: Metre + unit: <unit:M> } -measurement BatteryLevel { +variable BatteryLevel { name: "Battery level" description: "Battery level" datatype: int range: (0, 100) dimension: [] - unit: Percent + unit: <unit:PERCENT> } -parameter Open { +variable Open { name: "Open" description: "Flag to specify if something is open." datatype: boolean dimension: [] - default: true } -parameter AutoMovement { +variable AutoMovement { name: "Autonomous Movement" description: "If true, the robot moves around freely autonomously." datatype: boolean dimension: [] - default: true } component Gripper { name: "Gripper" description: "Gripper of a robot" parameters: - Open open + Open open = true } function GoTo { @@ -62,11 +65,16 @@ function Step { Position position } -component Robot { +component Thing { + name: "A thing" + description: "Some thing." +} + +component Robot defines <dbo:Robot> extends Thing{ name: "Robot" description: "A robot arm with six axes." measurements: - TCP tcp + internal TCP tcp components: Gripper gripper functions: @@ -77,17 +85,17 @@ component Robot { tcp: fixed(10) } -component MobileRobot extends Robot { +component MobileRobot defines <schema:Vehicle> extends Robot { name: "Mobile Robot" - description: "A robot arm with six axis mounted on a movable platform." + description: "A robot arm with six axes mounted on a movable platform." measurements: - Position position - BatteryLevel batteryLevel + internal Position position + internal BatteryLevel batteryLevel functions: GoTo gotoRobot Step stepRobot parameters: - AutoMovement auto + AutoMovement auto = true streams: position: update diff --git a/assets/interfaces/utils.soil b/assets/interfaces/utils.soil index 23ffeee745ac3f522ef11263a67e9236c47519bd..9305f9dfffd4fe6e488ab824b50c5dc1fdf6b7e5 100644 --- a/assets/interfaces/utils.soil +++ b/assets/interfaces/utils.soil @@ -1,3 +1,7 @@ +@prefix dbo: <http://dbpedia.org/ontology/> ; +@prefix quantitykind: <http://qudt.org/vocab/quantitykind/> ; +@prefix unit: <http://qudt.org/vocab/unit/> ; + enum State { OK WARNING @@ -5,29 +9,28 @@ enum State { MAINTENANCE } -parameter State { +variable State defines <dbo:status> { name: "State" description: "The current state of the device." datatype: enum - default: OK range: State dimension: [] } -measurement Position { +variable Position defines <quantitykind:CartesianCoordinates> { name: "Position" description: "Most recently dispatched measured position." datatype: float dimension: [3] range: (-100, 100) - unit: METRE + unit: <unit:M> } -measurement Quaternion { +variable Quaternion defines <quantitykind:Angle> { name: "Quaternion" description: "Most recently dispatched measured orientation as quaternion, if available." datatype: float dimension: [4] range: (0, 1) - unit: UNITLESS + unit: <unit:UNITLESS> } \ No newline at end of file diff --git a/assets/semantic_interfaces/base_stations.soil b/assets/semantic_interfaces/base_stations.soil deleted file mode 100644 index e6bccf9b4d513927c4868da941b294b725c95063..0000000000000000000000000000000000000000 --- a/assets/semantic_interfaces/base_stations.soil +++ /dev/null @@ -1,90 +0,0 @@ -@prefix quantitykind: <http://qudt.org/vocab/quantitykind/> ; -@prefix unit: <http://qudt.org/vocab/unit/> ; - -import utils; - -measurement Azimuth defines <quantitykind:Angle> { - name: "Azimuth" - description: "Current position of azimuth rotation encoder in Radian." - datatype: float - dimension: [] - unit: <unit:RAD> - range: (0, 3.14) -} - -measurement Elevation defines <quantitykind:Angle> { - name: "Elevation" - description: "Current position of elevation rotation encoder in Radian." - datatype: float - dimension: [] - unit: <unit:RAD> - range: (0, 3.14) -} - -measurement Distance defines <quantitykind:Distance> { - name: "Distance" - description: "Measured distance to the currently activate target." - datatype: float - dimension: [] - unit: <unit:M> - range: (0, 100) -} - -parameter Interval defines <quantitykind:Time> { - name: "Interval" - description: "Interval in seconds." - datatype: float - dimension: [] - default: 10 - unit: <unit:SEC> - range: (0, 360) -} - -function Jog { - name: "Jog" - description: "Jogs the tracker head by the given angles for the azimuth and elevation." - arguments: - Azimuth azimuth - Elevation elevation -} - -function PointTo { - name: "Point to" - description: "Moves the tracker head so that the laser points to the specified position." - arguments: - utils.Position position -} - -component Base { - name: "Base" - description: "Represents a base station in a distributed system." - functions: - Jog jog - PointTo point_to - parameters: - utils.State state - Interval interval - measurements: - internal utils.Position position - internal utils.Quaternion quaternion - internal Azimuth azimuth - internal Elevation elevation - internal Distance distance - - streams: - position: update - quaternion: update - - if state == ERROR: error("An error of the trackers base occured.") - if distance > 50.0: warning("Distance is very high. Measurements have high uncertainty.") - - position.description = "Position of the base of the tracker within a global reference frame." - quaternion.description = "Orientation of the base in relation to the orientation of a global reference frame." -} - -component BaseStations { - name: "Base Stations" - description: "Object acting as a list of base stations of the metrology system." - components: - Base base -} \ No newline at end of file diff --git a/assets/semantic_interfaces/lasertracker.soil b/assets/semantic_interfaces/lasertracker.soil deleted file mode 100644 index 7daf8671e494aeec6f2ca0e5d03e8ee2ee340713..0000000000000000000000000000000000000000 --- a/assets/semantic_interfaces/lasertracker.soil +++ /dev/null @@ -1,62 +0,0 @@ -@prefix schema: <http://schema.org/> ; -@prefix unit: <http://qudt.org/vocab/unit/> ; - -import mobile_entities; -import utils; -import base_stations; - - -parameter Time defines <schema:DateTime> { - name: "Time" - description: "Current system time." - datatype: time - dimension: [] -} - -parameter Version defines <schema:version> { - name: "Version" - description: "Incremental API-Version." - datatype: int - default: 1 - range: (0, 100) - dimension: [] - unit: <unit:UNITLESS> -} - -parameter Manufacturer defines <schema:manufacturer> { - name: "Manufacturer" - description: "Name of manufacturing company." - datatype: string - default: "Laboratory for Machine Tools and Production Engineering WZL of RWTH Aachen" - dimension: [] -} - -function Reset { - name: "Reset" - description: "Resets the device into the state like directly after start-up." -} - -function Shutdown { - name: "Shutdown" - description: "Gracefully shutdown the device." -} - -component Lasertracker { - name: "Lasertracker" - description: "Active coordinate measurement device based on laser interferometry for Large-Scale metrology applications." - components: - base_stations.BaseStations baseStations - mobile_entities.MobileEntities mobileEntities - functions: - Reset reset - Shutdown shutdown - parameters: - utils.State state = OK - constant Manufacturer manufacturer = "Laboratory for Machine Tools and Production Engineering WZL of RWTH Aachen" - constant Version version = 1 - Time time - - if state == ERROR: error("An error occured!") -} - -interface Lasertracker APIRadian {} \ No newline at end of file diff --git a/assets/semantic_interfaces/mobile_entities.soil b/assets/semantic_interfaces/mobile_entities.soil deleted file mode 100644 index 69bd24811fbb89153e1b962e355dd340989f03e1..0000000000000000000000000000000000000000 --- a/assets/semantic_interfaces/mobile_entities.soil +++ /dev/null @@ -1,73 +0,0 @@ -import utils; - -enum Mode { - CONTINUOUS - TRIGGERED - EXTERNAL - IDLE -} - -parameter Mode { - name: "Mode" - description: "Current state of the entity. In CONTINUOUS mode, values are dispatched as fast as possible. In TRIGGERED mode, values are only dispatches after a software trigger. In EXTERNAL mode, values are dispatched in accordance to an external trigger, e.g. probe or TTL. IDLE means the entity is currently not used." - default: CONTINUOUS - datatype: enum - range: Mode - dimension: [] -} - -parameter Type { - name: "Type" - description: "System specific identifier of the target Type, e.g. SMR or Active SMR." - datatype: string - dimension: [] - default: "SMR" -} - -measurement Locked { - name: "Locked" - description: "Boolean flag specifying whether the target is locked in." - datatype: boolean - dimension: [] -} - -function Reset { - name: "Reset" - description: "Starts the search routine around the current direction." -} - -function Trigger { - name: "Trigger" - description: "Trigger count measurements and set the resulting label. This function is only allowed in triggered acquisition mode." -} - -component Target { - name: "Target" - description: "Represents an individual mobile entity." - functions: - Reset reset - Trigger trigger - measurements: - utils.Position position - utils.Quaternion quaternion - internal Locked locked - parameters: - utils.State state - Mode mode - Type type - - streams: - position: update - quaternion: update - - state.description = "Reflects the current state of the target. If logged in: OK. If not stable: WARNING. If lost: ERROR." -} - -component MobileEntities { - name: "Mobile Entities" - description: "Object acting as a list of mobile entities in the metrology system." - components: - dynamic Target target -} - -interface Target myTarget{} \ No newline at end of file diff --git a/assets/semantic_interfaces/robot.soil b/assets/semantic_interfaces/robot.soil deleted file mode 100644 index 47fe4fcb1bb20f0f855aa94bd42b18b7c9119dd0..0000000000000000000000000000000000000000 --- a/assets/semantic_interfaces/robot.soil +++ /dev/null @@ -1,109 +0,0 @@ -@prefix quantitykind: <http://qudt.org/vocab/quantitykind/> ; -@prefix unit: <http://qudt.org/vocab/unit/> ; -@prefix dbo: <http://dbpedia.org/ontology/> ; -@prefix schema: <http://schema.org/> ; - -measurement Position defines <quantitykind:CartesianCoordinates> { - name: "Position" - description: "Position in Cartesian coordinates given in metre." - datatype: float - range: (-50, 50) - dimension: [3] - unit: <unit:M> -} - -measurement TCP defines <quantitykind:CartesianCoordinates> { - name: "Tool Center Point" - description: "Tool center point of a six-joint robot." - datatype: float - range: (-0.5,0.5) - dimension: [3] - unit: <unit:M> -} - -measurement BatteryLevel { - name: "Battery level" - description: "Battery level" - datatype: int - range: (0, 100) - dimension: [] - unit: <unit:PERCENT> -} - -parameter Open { - name: "Open" - description: "Flag to specify if something is open." - datatype: boolean - dimension: [] - default: true -} - -parameter AutoMovement { - name: "Autonomous Movement" - description: "If true, the robot moves around freely autonomously." - datatype: boolean - dimension: [] - default: true -} - -component Gripper { - name: "Gripper" - description: "Gripper of a robot" - parameters: - Open open -} - -function GoTo { - name: "GoTo" - description: "Moves something to an absolute given position" - arguments: - Position position -} - -function Step { - name: "Step" - description: "Moves something to relatively from the current position to the given position" - arguments: - Position position -} - -component Robot defines <dbo:Robot> { - name: "Robot" - description: "A robot arm with six axes." - measurements: - internal TCP tcp - components: - Gripper gripper - functions: - GoTo goto - Step step - - streams: - tcp: fixed(10) -} - -component MobileRobot defines <schema:Vehicle> extends Robot { - name: "Mobile Robot" - description: "A robot arm with six axes mounted on a movable platform." - measurements: - internal Position position - internal BatteryLevel batteryLevel - functions: - GoTo gotoRobot - Step stepRobot - parameters: - AutoMovement auto - - streams: - position: update - batteryLevel: update - - gotoRobot.name = "AVG GoTo" - stepRobot.name = "AVG Step" - - if batteryLevel < 20: warning("Battery level is below 20%. Load shortly.") - if batteryLevel < 10: error("Battery level is below 10%. Please load the battery immediately.") - -} - -interface MobileRobot WallE {} \ No newline at end of file diff --git a/assets/semantic_interfaces/utils.soil b/assets/semantic_interfaces/utils.soil deleted file mode 100644 index 279728f3b3ca13785a9fc2354585c0e981c0c662..0000000000000000000000000000000000000000 --- a/assets/semantic_interfaces/utils.soil +++ /dev/null @@ -1,37 +0,0 @@ -@prefix dbo: <http://dbpedia.org/ontology/> ; -@prefix quantitykind: <http://qudt.org/vocab/quantitykind/> ; -@prefix unit: <http://qudt.org/vocab/unit/> ; - -enum State { - OK - WARNING - ERROR - MAINTENANCE -} - -parameter State defines <dbo:status> { - name: "State" - description: "The current state of the device." - datatype: enum - default: OK - range: State - dimension: [] -} - -measurement Position defines <quantitykind:CartesianCoordinates> { - name: "Position" - description: "Most recently dispatched measured position." - datatype: float - dimension: [3] - range: (-100, 100) - unit: <unit:M> -} - -measurement Quaternion defines <quantitykind:Angle> { - name: "Quaternion" - description: "Most recently dispatched measured orientation as quaternion, if available." - datatype: float - dimension: [4] - range: (0, 1) - unit: <unit:UNITLESS> -} \ No newline at end of file diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index c208b79eb8f0ce856c73791215f0f2c15ae89f10..e01473cf2c9d9a6ef580998a3c7682cbbe3f5ee9 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -26,7 +26,7 @@ services: dummy-monitoring: build: context: . - dockerfile: ./src/environment_monitoring/Dockerfile + dockerfile: src/monitoring/Dockerfile container_name: dummy-monitoring volumes: - ./assets/config/environment_monitoring.toml:/home/dummy/src/environment_monitoring/config.toml diff --git a/init.bat b/init.bat index e1aafdb323e34cd13c10b8889a6399e5b7ba070b..90138bb0df0ad5c34e763f9a5e2a1ebf7acce212 100644 --- a/init.bat +++ b/init.bat @@ -1,5 +1,5 @@ cd scripts -python generate.py robot.soil -g remote -s -hwc -python generate.py lasertracker.soil -g remote -s -hwc -python generate.py environment_monitoring.soil -g remote -s -hwc +python generate.py robot.soil -g shell -s -hwc +python generate.py lasertracker.soil -g shell -s -hwc +python generate.py monitoring.soil -g shell -s -hwc cd .. \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index a771946421d366ebd1c6a6344a742456764be8a4..734edea44eed2d57ea42fef99bd2b095036f56b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ numpy requests toml -wzl-udi==9.1.2 +wzl-udi==9.3.1 diff --git a/scripts/fair-checker-assessment.py b/scripts/fair-checker-assessment.py new file mode 100644 index 0000000000000000000000000000000000000000..c573c26aa9beecd6c6d9482f6117865c296a4863 --- /dev/null +++ b/scripts/fair-checker-assessment.py @@ -0,0 +1,42 @@ +import argparse +import json +import os +import subprocess +import sys +import zipfile + +import multidict +import requests +import toml + +SRC = os.path.join('..', 'src') +OUT = os.path.join('..', 'out') + +if __name__ == '__main__': + parser = argparse.ArgumentParser(prog='SOIL dummy FAIR-checker assessment') + parser.add_argument('dummy', type=str, choices=['lasertracker', 'monitoring', 'robot']) + + args = parser.parse_args() + + config = toml.load(os.path.join(SRC,args.dummy,'config.toml')) + + if not os.path.exists(os.path.join(OUT,args.dummy)): + os.mkdir(os.path.join(OUT,args.dummy)) + + # Test profiles + + profiles_path = f'{SRC}/{args.dummy}/{config["semantic"]["profiles"]}' + prefix_url = config["semantic"]["url"] + + for filename in os.listdir(profiles_path): + profilename = f'{filename[:-10]}Profile' + + request_url = f"https://fair-checker.france-bioinformatique.fr/api/check/metrics_all?url={prefix_url}{profilename}" + + print(request_url) + + response = requests.get(request_url) + if response.status_code == 200: + with open(os.path.join(OUT,args.dummy,f'{profilename}.json'), 'w') as reportfile: + json.dump(json.loads(response.content.decode('UTF-8')), reportfile) + break diff --git a/scripts/generate.py b/scripts/generate.py index 61f7e10c9f3c7f1ed37e4cabeda1c88c3c647d24..70aeb9fa48f794a8a378d4d7b2e2d7da3d35bc54 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -7,11 +7,9 @@ import zipfile import multidict import requests -# generator = 'shell' -# semantic = True -# HWC = True INTERFACES_PATH = os.path.join('..', 'assets', 'interfaces') +JAR_PATH = '../../soil-text/target/libs/soil.jar' if __name__ == '__main__': parser = argparse.ArgumentParser(prog='SOIL dummy generator') @@ -24,17 +22,6 @@ if __name__ == '__main__': soil_model = args.filename[:-5] - if args.semantic: - INTERFACES_PATH = os.path.join('..', 'assets', 'semantic_interfaces') - - # try: - # soil_model = sys.argv[1][:-5] - # if not os.path.exists(os.path.join(INTERFACES_PATH, f'{soil_model}.soil')): - # raise Exception() - # except Exception as e: - # print('You must provide a file from the folder "interfaces" to be used as root file of the generation, e.g., "python generate.py lasertracker.soil".') - # exit() - if args.generator in ['local', 'remote']: files = multidict.MultiDict() for filename in os.listdir(INTERFACES_PATH): @@ -57,12 +44,6 @@ if __name__ == '__main__': if args.semantic: url = f'{url}&semantic=True' - # # url = f'https://iot.wzl-mq.rwth-aachen.de/soil-backend/generate?model={soil_model}.soil&target=visual' - # url = f'https://iot.wzl-mq.rwth-aachen.de/soil-backend/translateToVisual' - # # url = f'http://localhost:8001/generate?model={soil_model}.soil&target=python' - # # if HWC: - # # url = f'{url}' - response = requests.post(url, files=files) if response.status_code == 200: if not os.path.exists(os.path.join('..', 'src', soil_model)): @@ -79,7 +60,7 @@ if __name__ == '__main__': print(response.status_code) elif args.generator == 'shell': - command = f'java -jar ../../soil-text/target/libs/soil.jar soil.MainSoilTool -i {INTERFACES_PATH}/{soil_model}.soil -t python' + command = f'java -jar {JAR_PATH} soil.MainSoilTool -i {INTERFACES_PATH}/{soil_model}.soil -t python' if args.handwritten: command += f' -hwc ../src/{soil_model}/hwc' if args.semantic: diff --git a/src/lasertracker/hwc/com_target.py b/src/lasertracker/hwc/com_target.py index 942c0b678930830144d5ecf0516f797f748574a0..0c0d817b6272910927221a8c88c6d7059fe71216 100644 --- a/src/lasertracker/hwc/com_target.py +++ b/src/lasertracker/hwc/com_target.py @@ -1,3 +1,6 @@ +import time +from typing import List + from hwc.device import Device from mobile_entities.com_target import COMTargetTOP from mobile_entities.enum_mode import Mode @@ -12,12 +15,10 @@ class COMTarget(COMTargetTOP): def fun_reset(self): self._device.reset_target() - def fun_trigger(self, par_count=1, par_nonce=""): - pass - # for i in range(par_count): - # publish('OBJ-Lasertracker/OBJ-MobileEntities/OBJ-Home-Target/VAR-Position', - # json.dumps({'value': self.get_mea_position(), 'nonce': par_nonce})) - # time.sleep(0.1) + def fun_trigger(self, arg_counter: int = 100, arg_label: str = "test") -> List[float]: + for i in range(arg_counter): + time.sleep(0.1) + yield self.get_mea_position(), arg_label def get_mea_position(self): return self._device.target.position diff --git a/src/environment_monitoring/Dockerfile b/src/monitoring/Dockerfile similarity index 100% rename from src/environment_monitoring/Dockerfile rename to src/monitoring/Dockerfile diff --git a/src/environment_monitoring/docker-compose.yml b/src/monitoring/docker-compose.yml similarity index 100% rename from src/environment_monitoring/docker-compose.yml rename to src/monitoring/docker-compose.yml diff --git a/src/environment_monitoring/hwc/__init__.py b/src/monitoring/hwc/__init__.py similarity index 100% rename from src/environment_monitoring/hwc/__init__.py rename to src/monitoring/hwc/__init__.py diff --git a/src/environment_monitoring/hwc/com_environmentalsensor.py b/src/monitoring/hwc/com_environmentalsensor.py similarity index 100% rename from src/environment_monitoring/hwc/com_environmentalsensor.py rename to src/monitoring/hwc/com_environmentalsensor.py diff --git a/src/environment_monitoring/hwc/com_environmentalsensormanager.py b/src/monitoring/hwc/com_environmentalsensormanager.py similarity index 100% rename from src/environment_monitoring/hwc/com_environmentalsensormanager.py rename to src/monitoring/hwc/com_environmentalsensormanager.py diff --git a/src/environment_monitoring/hwc/device.py b/src/monitoring/hwc/device.py similarity index 100% rename from src/environment_monitoring/hwc/device.py rename to src/monitoring/hwc/device.py diff --git a/src/environment_monitoring/main.py b/src/monitoring/main.py similarity index 100% rename from src/environment_monitoring/main.py rename to src/monitoring/main.py