Commit 98f76bf4 authored by Jiahang Chen's avatar Jiahang Chen
Browse files

features and roles for mini integration scenario

parent 17cd9428
Pipeline #553711 passed with stage
in 17 seconds
......@@ -176,6 +176,7 @@
from ml.fml40.roles.dts.persons.mini_tractor_operator import MiniTractorOperator
from ml.fml40.roles.dts.persons.skidder_operator import SkidderOperator
from ml.fml40.roles.dts.sensors.barkbeetle_sensor import BarkbeetleSensor
from ml.fml40.roles.dts.sensors.calipers import Calipers
from ml.fml40.roles.dts.sensors.vitality_sensor import VitalitySensor
from ml.fml40.roles.dts.sites.forest_enterprise import ForestEnterprise
from ml.fml40.roles.dts.sites.hauler import Hauler
......@@ -221,8 +222,11 @@
from ml.ml40.features.properties.values.force import Force
from ml.ml40.features.properties.values.generic_property import GenericProperty
from ml.ml40.features.properties.values.gyroscope_value import GyroscopeValue
from ml.ml40.features.properties.values.heart_rate import HeartRate
from ml.ml40.features.properties.values.high_speed_image_value import HighSpeedImageValue
from ml.ml40.features.properties.values.infrared import Infrared
from ml.ml40.features.properties.values.last_service_check import LastServiceCheck
from ml.ml40.features.properties.values.lidar_frame import LidarFrame
from ml.ml40.features.properties.values.lift import Lift
from ml.ml40.features.properties.values.liquid_filling_level import LiquidFillingLevel
from ml.ml40.features.properties.values.location import Location
......@@ -236,6 +240,8 @@
from ml.ml40.features.properties.values.route import Route
from ml.ml40.features.properties.values.sound_level import SoundLevel
from ml.ml40.features.properties.values.srid import SRID
from ml.ml40.features.properties.values.std_deviation_rpy import StdDeviationRPY
from ml.ml40.features.properties.values.stereo_camera_config import StereoCameraConfig
from ml.ml40.features.properties.values.surface import Surface
from ml.ml40.features.properties.values.surface_wkt import SurfaceWKT
from ml.ml40.features.properties.values.switching_stage import SwitchingStage
......@@ -255,11 +261,16 @@
from ml.ml40.roles.dts.sensors.accelerometer import Accelerometer
from ml.ml40.roles.dts.sensors.air_sensor import AirSensor
from ml.ml40.roles.dts.sensors.gyroscope import Gyroscope
from ml.ml40.roles.dts.sensors.high_speed_camera import HighSpeedCamera
from ml.ml40.roles.dts.sensors.imu import IMU
from ml.ml40.roles.dts.sensors.laser_range_finder import LaserRangeFinder
from ml.ml40.roles.dts.sensors.lidar import LiDAR
from ml.ml40.roles.dts.sensors.light_sensor import LightSensor
from ml.ml40.roles.dts.sensors.sensor import Sensor
from ml.ml40.roles.dts.sensors.sensor_network import SensorNetwork
from ml.ml40.roles.dts.sensors.soil_sensor import SoilSensor
from ml.ml40.roles.dts.sensors.sound_sensor import SoundSensor
from ml.ml40.roles.dts.sensors.stereo_camera import StereoCamera
from ml.ml40.roles.dts.sites.site import Site
from ml.ml40.roles.dts.ways.way import Way
from ml.ml40.roles.hmis.app import App
......
from ml.ml40.roles.dts.sensors.sensor import Sensor
class Calipers(Sensor):
def __init__(self, namespace="fml40", name="", identifier=""):
super().__init__(namespace=namespace, name=name, identifier=identifier)
from ml.ml40.features.properties.values.value import Value
class HeartRate(Value):
def __init__(self, namespace="ml40", name="", identifier=""):
super().__init__(
namespace=namespace,
name=name,
identifier=identifier
)
self.__current_heart_rate = None
self.__min_heart_rate = None
self.__max_heart_rate = None
self.__mean_heart_rate = None
@property
def currentHeartRate(self):
return self.__current_heart_rate
@currentHeartRate.setter
def currentHeartRate(self, value):
self.__current_heart_rate = value
@property
def minHeartRate(self):
return self.__min_heart_rate
@minHeartRate.setter
def minHeartRate(self, value):
self.__min_heart_rate = value
@property
def maxHeartRate(self):
return self.__max_heart_rate
@maxHeartRate.setter
def maxHeartRate(self, value):
self.__max_heart_rate = value
@property
def meanHeartRate(self):
return self.__mean_heart_rate
@meanHeartRate.setter
def meanHeartRate(self, value):
self.__mean_heart_rate = value
def to_json(self):
self.__json_out = super().to_json()
if self.__current_heart_rate is not None:
self.__json_out["currentHeartRate"] = self.__current_heart_rate
if self.__min_heart_rate is not None:
self.__json_out["minHeartRate"] = self.__min_heart_rate
if self.__max_heart_rate is not None:
self.__json_out["maxHeartRate"] = self.__max_heart_rate
if self.__mean_heart_rate is not None:
self.__json_out["meanHeartRate"] = self.__mean_heart_rate
return self.__json_out
from ml.ml40.features.properties.values.value import Value
class HighSpeedImageValue(Value):
def __init__(self, namespace="ml40", name="", identifier=""):
super().__init__(
namespace=namespace,
name=name,
identifier=identifier)
self.__number_of_pixel = None
self.__min_range = None
self.__max_range = None
self.__min_pixel_value = None
self.__max_pixel_value = None
self.__mean_pixel_value = None
@property
def numberOfPixel(self):
return self.__number_of_pixel
@numberOfPixel.setter
def numberOfPixel(self, value):
self.__number_of_pixel = value
@property
def minRange(self):
return self.__min_range
@minRange.setter
def minRange(self, value):
self.__min_range = value
@property
def maxPixelValue(self):
return self.__max_pixel_value
@maxPixelValue.setter
def maxPixelValue(self, value):
self.__max_pixel_value = value
@property
def minPixelValue(self):
return self.__min_pixel_value
@minPixelValue.setter
def minPixelValue(self, value):
self.__min_pixel_value = value
@property
def meanPixelValue(self):
return self.__mean_pixel_value
@meanPixelValue.setter
def meanPixelValue(self, value):
self.__mean_pixel_value = value
def to_json(self):
self.__json_out = super().to_json()
if self.__number_of_pixel is not None:
self.__json_out["numberOfPixel"] = self.__number_of_pixel
if self.__min_range is not None:
self.__json_out["minRange"] = self.__min_range
if self.__max_range is not None:
self.__json_out["maxRange"] = self.__max_range
if self.__min_pixel_value is not None:
self.__json_out["minPixelValue"] = self.__min_pixel_value
if self.__max_pixel_value is not None:
self.__json_out["maxPixelValue"] = self.__max_pixel_value
if self.__mean_pixel_value is not None:
self.__json_out["meanPixelValue"] = self.__mean_pixel_value
return self.__json_out
from ml.ml40.features.properties.values.value import Value
class LidarFrame(Value):
def __init__(self, namespace="ml40", name="", identifier=""):
super().__init__(
namespace=namespace,
name=name,
identifier=identifier)
self.__no_scan_lines = None
self.__no_points = None
@property
def noScanLines(self):
return self.__no_scan_lines
@noScanLines.setter
def noScanLines(self, value):
self.__no_scan_lines = value
@property
def noPoints(self):
return self.__no_points
@noPoints.setter
def noPoints(self, value):
self.__no_points = value
def to_json(self):
self.__json_out = super().to_json()
if self.__no_scan_lines is not None:
self.__json_out["noScanLines"] = self.__no_scan_lines
if self.noPoints is not None:
self.__json_out["noPoints"] = self.noPoints
return self.__json_out
from ml.ml40.features.properties.values.value import Value
class StdDeviationRPY(Value):
def __init__(self, namespace="ml40", name="", identifier=""):
super().__init__(
namespace=namespace,
name=name,
identifier=identifier
)
self.__std_deviation_roll = None
self.__std_deviation_pitch = None
self.__std_deviation_yaw = None
self.__json_out = {}
@property
def stdDeviationRoll(self):
return self.__std_deviation_roll
@stdDeviationRoll.setter
def stdDeviationRoll(self, value):
self.__std_deviation_roll = value
@property
def stdDeviationPitch(self):
return self.__std_deviation_pitch
@stdDeviationPitch.setter
def stdDeviationPitch(self, value):
self.__std_deviation_pitch = value
@property
def stdDeviationYaw(self):
return self.__std_deviation_yaw
@stdDeviationYaw.setter
def stdDeviationYaw(self, value):
self.__std_deviation_yaw = value
def to_json(self):
self.__json_out = super().to_json()
if self.__std_deviation_roll is not None:
self.__json_out["stdDeviationRoll"] = self.__std_deviation_roll
if self.__std_deviation_yaw is not None:
self.__json_out["stdDeviationPitch"] = self.__std_deviation_yaw
if self.__std_deviation_pitch is not None:
self.__json_out["stdDeviationYaw"] = self.__std_deviation_pitch
return self.__json_out
from ml.ml40.features.properties.values.value import Value
class StereoCameraConfig(Value):
def __init__(self, namespace="ml40", name="", identifier=""):
super().__init__(
namespace=namespace,
name=name,
identifier=identifier)
self.__frame_rate = None
self.__disparity_format = None
@property
def frameRate(self):
return self.__frame_rate
@frameRate.setter
def frameRate(self, value):
self.__frame_rate = value
@property
def disparityFormat(self):
return self.__disparity_format
@disparityFormat.setter
def disparityFormat(self, value):
self.__disparity_format = value
def to_json(self):
self.__json_out = super().to_json()
if self.__frame_rate is not None:
self.__json_out["frameRate"] = self.__frame_rate
if self.__disparity_format is not None:
self.__json_out["disparityFormat"] = self.__disparity_format
return self.__json_out
\ No newline at end of file
from ml.ml40.roles.dts.sensors.sensor import Sensor
class HighSpeedCamera(Sensor):
def __init__(self, namespace="ml40", name="", identifier=""):
super(HighSpeedCamera, self).__init__(
namespace=namespace, name=name, identifier=identifier
)
from ml.ml40.roles.dts.sensors.sensor import Sensor
class IMU(Sensor):
"""
Inertia measurement unit
"""
def __init__(self, namespace="ml40", name="", identifier=""):
super(IMU, self).__init__(
namespace=namespace, name=name, identifier=identifier
)
from ml.ml40.roles.dts.sensors.sensor import Sensor
class LaserRangeFinder(Sensor):
"""
Inertia measurement unit
"""
def __init__(self, namespace="ml40", name="", identifier=""):
super(LaserRangeFinder, self).__init__(
namespace=namespace, name=name, identifier=identifier
)
from ml.ml40.roles.dts.sensors.sensor import Sensor
class LiDAR(Sensor):
def __init__(self, namespace="ml40", name="", identifier=""):
super(LiDAR, self).__init__(
namespace=namespace, name=name, identifier=identifier
)
from ml.ml40.roles.dts.sensors.sensor import Sensor
class StereoCamera(Sensor):
def __init__(self, namespace="ml40", name="", identifier=""):
super(StereoCamera, self).__init__(
namespace=namespace, name=name, identifier=identifier
)
......@@ -7,6 +7,7 @@ def __init__(self, namespace="mml40", name="", identifier=""):
self.__displacement = None
self.__min_displacement = None
self.__max_displacement = None
self.__displacements = []
@property
def displacement(self):
......@@ -32,12 +33,22 @@ def minDisplacement(self):
def minDisplacement(self, value):
self.__min_displacement = value
@property
def displacements(self):
return self.__displacements
@displacements.setter
def displacements(self, value):
self.__displacements = value
def to_json(self):
self.__json_out = super().to_json()
if self.displacement is not None:
self.__json_out["displacement"] = self.displacement
self.__json_out["displacement"] = self.__displacement
if self.__min_displacement is not None:
self.__json_out["minDisplacement"] = self.__min_displacement
if self.__max_displacement is not None:
self.__json_out["maxDisplacement"] = self.__max_displacement
if self.__displacements:
self.__json_out["displacements"] = self.__displacements
return self.__json_out
......@@ -221,6 +221,14 @@ def __init__(self, db):
self.__table_conf = {}
self.__conn = None
@property
def conn(self):
return self.__conn
@property
def cursor(self):
return self.__conn.cursor()
def connect(self):
self.__conn = sqlite3.connect(self.__db, check_same_thread=False)
APP_LOGGER.info("Connect to the database {}".format(self.__db))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment