[
https://issues.apache.org/jira/browse/QUARKS-21?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15216261#comment-15216261
]
ASF GitHub Bot commented on QUARKS-21:
--------------------------------------
Github user mnwone commented on a diff in the pull request:
https://github.com/apache/incubator-quarks/pull/49#discussion_r57752546
--- Diff:
test/svt/src/main/java/quarks/test/svt/apps/FleetManagementEmbeddedApplication.java
---
@@ -0,0 +1,107 @@
+package quarks.test.svt.apps;
+
+import java.io.PrintWriter;
+import java.util.concurrent.TimeUnit;
+
+import quarks.console.server.HttpServer;
+import quarks.metrics.Metrics;
+import quarks.providers.development.DevelopmentProvider;
+import quarks.test.svt.utils.sensor.gps.GpsSensor;
+import quarks.test.svt.utils.sensor.gps.SimulatedGeofence;
+import quarks.test.svt.utils.sensor.gps.SimulatedGpsSensor;
+import quarks.test.svt.utils.sensor.gps.GpsData;
+import quarks.topology.TStream;
+import quarks.topology.TWindow;
+import quarks.topology.Topology;
+
+
+public class FleetManagementEmbeddedApplication {
+
+ public static void main(String[] args) throws Exception {
+
+ //TODO: make these configurable properties
+ boolean trackGpsLocation = true;
+ boolean trackSpeeding = true;
+ boolean trackGeofence = true;
+ double MILES_PER_HOUR_TO_METERS_PER_SEC_MULTIPLER = 0.44704;
+
+ //TODO - get driverId from input/file and VIN from OBD
+ String driverId = "driver1";
+ String VIN = "123456";
+ int maxSpeedMph = 70;
+
+ boolean console = false;
+ if (args.length == 1 && args[0].toLowerCase().equals("console"))
+ console = true;
+
+ double maxSpeedMetersPerSec = maxSpeedMph *
MILES_PER_HOUR_TO_METERS_PER_SEC_MULTIPLER;
+ System.out.println("maxSpeedMph: " + maxSpeedMph);
+ System.out.println("maxSpeedMetersPerSec: " +
maxSpeedMetersPerSec);
+
+ DevelopmentProvider tp = new DevelopmentProvider();
+ Topology t1 = tp.newTopology("GPS topology");
+
+ // Source 1: GPS data
+ SimulatedGpsSensor g = new SimulatedGpsSensor();
+ TStream<GpsSensor> gpsSensor = t1.poll(() -> g.nextGps(), 500,
TimeUnit.MILLISECONDS);
+
+ // 1.1 Log GPS location
+ if (trackGpsLocation) {
+ TStream<GpsSensor> logGps = gpsSensor.peek(t ->
System.out.println("log GPS: " + t.toString()));
+ logGps.tag("logGps");
+ //TODO: replace print with write to Kafka
--- End diff --
Agreed. This is an old class and should have been deleted. In the new
class, Kafka references should have been removed.
> Create test application using GPS/OBD sensors
> ---------------------------------------------
>
> Key: QUARKS-21
> URL: https://issues.apache.org/jira/browse/QUARKS-21
> Project: Quarks
> Issue Type: Improvement
> Components: Test
> Reporter: May Wone
> Assignee: May Wone
> Priority: Minor
> Labels: test
>
> I’m looking at creating a ‘Fleet Management’ application that uses simulated
> GPS and On-Board Diagnostics aka OBD data.
> Here are some initial thoughts:
> h4. GPS
> Create a simulated GPS sensor that reads in saved real GPS data collected
> from my Garmin (say from a drive from IBM SVL to IBM research). The GPS
> sensor will read from a .csv file that contains extracted relevant data from
> a .gmz file.
> h5. Potential applications:
> 1. Send GPS data to say, Kafka. Potentially, there can be a server
> application to track the fleet of vehicles in real time (ex. vehicles moving
> on a map).
> 2. Speeding monitor – filter for > 70mph
> 3. Geofence exception monitor if the vehicle is outside the Geofence
> boundaries (simple definition). This may indicate the vehicle is lost,
> stolen, or making an unauthorized trip.
> 4. …
> h4. OBD
> Create a simulated OBD sensor that reads in made-up data.
> h5. Potential applications:
> 1. Send alert if a sensor value is out of range. For example, engine oil
> temperature overheating.
> 1a.. Battery voltage low, ….
> 2. Send alert for Diagnostic Trouble Codes.
> 3. Show simple embedded analytics (more complex analytics requires domain
> knowledge). For example:
> 3a. Hard braking (>7mph) - send alert to driver and send alert to on
> server. A metric can count the number of such incidents.
> 3b. Hard acceleration (> ? mph)
> 3c. Ignition off & motion detected(GPS) -> possible towing
> 3d. …
> Comments?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)