Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 51 additions & 43 deletions USERGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You can install the built package using pip:
$pip install dist/example_shm-<version>-py3-none-any.whl
```

Replace `<version>` with the actual version number (e.g., `0.5.0`).
Replace `<version>` with the actual version number (e.g., `0.6.0`).

## Create Configuration

Expand All @@ -19,50 +19,43 @@ The format of configuration file is,

```json
{
"MQTT": {
"sysid": {
"host": "",
"port": ,
"port": 0,
"userId": "",
"password": "",
"ClientID": "NOT_NEEDED",
"QoS": 1,
"MetadataToSubscribe":["sensors/1/acc/raw/metadata"],
"TopicsToSubscribe": [
"sensors/1/acc/raw/data",
"sensors/1/acc/raw/metadata",
"sensors/2/acc/raw/data",
"sensors/3/acc/raw/data",
"sensors/4/acc/raw/data"
]
],
"TopicsToPublish": ["sensors/1/acc/sysid/data"]
},

"sysID": {
"host": "",
"port": ,
"userId": "",
"password": "",
"ClientID": "NOT_NEEDED",
"QoS": 2,
"TopicsToSubscribe": ["sensors/1/acc/sysid/data"]
},

"mode_cluster": {
"host": "",
"port": ,
"port": 0,
"userId": "",
"password": "",
"ClientID": "NOT_NEEDED",
"QoS": 2,
"TopicsToSubscribe": ["sensors/1/acc/mode_cluster/data"]
"TopicsToSubscribe": ["sensors/1/acc/sysid/data"],
"TopicsToPublish": ["sensors/1/acc/mode_cluster/data"]
},

"model_update": {
"host": "",
"port": ,
"port": 0,
"userId": "",
"password": "",
"ClientID": "NOT_NEEDED",
"QoS": 2,
"TopicsToSubscribe": ["sensors/1/acc/model_update/data"]
"TopicsToSubscribe": ["sensors/1/acc/mode_cluster/data"],
"TopicsToPublish": ["sensors/1/acc/model_update/data"]
}
}
```
Expand Down Expand Up @@ -94,29 +87,42 @@ the package.
The following experiments can be run using
the package.

* **acceleration_readings** demonstrates the extraction of
* **acceleration_readings** demonstrates the use of `Accelerometer` class to extract
accelerometer measurements from MQTT data stream.
* **aligning_readings** collects and aligns the accelerometer measurements from multiple MQTT data streams.
* **aligning_readings** demonstrates the use of `Aligner` class to collect and
align accelerometer measurements from multiple MQTT data streams.

* **sysid** demonstrates the use of `sys_id` with four cases:
* **sysid** demonstrates the use of `sysid` with four cases:
1. **sysid-and-plot**: plots natural frequencies.
1. **sysid-and-print**: prints SysID results to console.
1. **sysid-and-publish**: publishes one set of SysID results via MQTT to the config given under [sysid] config.
1. **live-sysid-and-publish**: Continuously publishes SysID results via MQTT to the config given under [sysid] config.

* **mode-tracking** demonstrates the use of `mode_track` with three cases:
1. **mode-tracking-with-local-sysid**: gets the pyOMA results by runing sysid
locally, then runs the mode track.
1. **mode-tracking-with-remote-sysid**: gets pyOMA results by subscribing,
then runs the mode track. This is a one time operation.
1. **live-mode-tracking-with-remote-sysid**: gets pyOMA results by subscribing,
then runs the mode track. This operation runs in loop.
1. **sysid-and-print**: prints sysid output to console.
1. **sysid-and-publish**: publishes one set of sysid output via MQTT to the config given under [sysid] config.
1. **live-sysid-and-publish**: Continuously publishes sysid output via MQTT to the config given under [sysid] config.

* **Clustering** demonstrates the use of `clustering` with three cases:
1. **clustering-with-local-sysid**: gets the sysid output by runing sysid
locally, then runs the mode clustering.
1. **clustering-with-remote-sysid**: gets sysid output by subscribing,
then runs the mode clustering. This is a one time operation.
1. **live-clustering-with-remote-sysid**: gets sysid output by subscribing,
then runs the mode clustering. This operation runs in loop.
1. **live-clustering-with-remote-sysid-and-publish**: gets sysid output by subscribing,
then runs the mode clustering. The cluster results are published. This operation runs in loop.

* **mode-tracking** demonstrates the use of `mode_tracking` with three cases:
1. **mode-tracking-with-local-sysid**: gets the sysid output by runing sysid
locally, then runs mode clustering and mode tracking.
1. **mode-tracking-with-remote-sysid**: gets sysid output by subscribing,
then runs mode clustering and mode tracking. This is a one time operation.
1. **live-mode-tracking-with-remote-sysid**: gets sysid output by subscribing,
then runs mode clustering and mode tracking. This operation runs in loop.

* **model-update** demonstrates the use of `model_update` with two cases:
1. **model-update-local-sysid**: gets the mode track output, then uses it to
1. **model-update-local-sysid**: gets the sysid output, then uses it to
run update model and get updated system parameters.
1. **live-model-update-remote-sysid**: gets the mode track output by subscribing to
MQTT topic, then uses the mode track output to run update model and get updated system parameters.
1. **live-model-update-with-remote-sysid**: gets the sysid output by subscribing to
MQTT topic, then runs mode clustering to run update model and get updated system parameters.
1. **live-model-update-with-remote-clustering**: gets the mode clustering output by subscribing to
MQTT topic, then uses the mode clustering output to run update model and get updated system parameters.

You can find the available experiments by running the program

Expand All @@ -131,18 +137,20 @@ Options:
Commands:
accelerometers
align-readings
sysid-and-print
sysid-and-plot
sysid-and-publish
live-sysid-publish
clustering-with-local-sysid
clustering-with-remote-sysid
live-clustering-with-remote-sysid
live-mode-tracking-with-remote-sysid
live-model-update-remote-sysid
live-sysid-publish
live-clustering-with-remote-sysid-and-publish
mode-tracking-with-local-sysid
mode-tracking-with-remote-sysid
model-update-local-sysid
sysid-and-plot
sysid-and-print
sysid-and-publish
live-mode-tracking-with-remote-sysid
model-update-with-local-sysid
live-model-update-with-remote-sysid
live-model-update-with-remote-clustering
```

To run the examples with the default config (`config/production.json`), use:
Expand Down
31 changes: 13 additions & 18 deletions config/production.json.template
Original file line number Diff line number Diff line change
@@ -1,48 +1,43 @@
{
"MQTT": {
"sysid": {
"host": "",
"port": ,
"port": 0,
"userId": "",
"password": "",
"ClientID": "NOT_NEEDED",
"QoS": 1,
"MetadataToSubscribe": [
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/raw/metadata"
],
"TopicsToSubscribe": [
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/raw/data",
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/raw/metadata",
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/2/acc/raw/data",
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/3/acc/raw/data",
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/4/acc/raw/data"
]
],
"TopicsToPublish": ["cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/sysid/data"]
},

"sysID": {
"host": "",
"port": ,
"userId": "",
"password": "",
"ClientID": "NOT_NEEDED",
"QoS": 2,
"TopicsToSubscribe": ["cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/sysid/data"]
},

"mode_cluster": {
"host": "",
"port": ,
"port": 0,
"userId": "",
"password": "",
"ClientID": "NOT_NEEDED",
"QoS": 2,
"TopicsToSubscribe": ["cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/mode_cluster/data"]
"TopicsToSubscribe": ["cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/sysid/data"],
"TopicsToPublish": ["cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/mode_cluster/data"]
},

"model_update": {
"host": "",
"port": ,
"port": 0,
"userId": "",
"password": "",
"ClientID": "NOT_NEEDED",
"QoS": 2,
"TopicsToSubscribe": ["cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/model_update/data"]
"TopicsToSubscribe": ["cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/mode_cluster/data"],
"TopicsToPublish": ["cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/model_update/data"]
}
}

Expand Down
34 changes: 16 additions & 18 deletions config/replay.json.template
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
{
"MQTT": {
"host": "test.mosquitto.org",
"port": 1883,
"host": "",
"port": 0,
"userId": "",
"password": "",
"ClientID": "ReplaySubscriber",
"QoS": 1,
"MetadataToSubscribe": ["cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/raw/metadata"],
"TopicsToSubscribe": [
"cpsens/recorded/1/data",
"cpsens/recorded/1/metadata",
"cpsens/recorded/2/data"
]
},

"sysID": {
"host": "test.mosquitto.org",
"port": 1883,
"userId": "",
"password": "",
"ClientID": "sub.232.sds.213s",
"QoS": 1,
"TopicsToSubscribe": ["cpsens/d8-3a-dd-f5-92-48/cpsns_Simulator/1_2/oma_results"]
}
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/raw/data",
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/2/acc/raw/data",
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/3/acc/raw/data",
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/4/acc/raw/data"
],
"TopicsToPublish": {
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/raw/data": "cpsens/recorded/1/data",
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/1/acc/raw/metadata": "cpsens/recorded/1/metadata",
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/2/acc/raw/data": "cpsens/recorded/2/data",
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/3/acc/raw/data": "cpsens/recorded/3/data",
"cpsens/d8-3a-dd-37-d2-7e/3050-A-060_sn_106209/4/acc/raw/data": "cpsens/recorded/4/data"
}
}
}



42 changes: 42 additions & 0 deletions config/replay_production.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"sysid": {
"host": "",
"port": 0,
"userId": "",
"password": "",
"ClientID": "NOT_NEEDED",
"QoS": 1,
"MetadataToSubscribe": ["cpsens/recorded/1/metadata"],
"TopicsToSubscribe": [
"cpsens/recorded/1/data",
"cpsens/recorded/2/data",
"cpsens/recorded/3/data",
"cpsens/recorded/4/data"
],
"TopicsToPublish": ["cpsens/recorded/sysid/data"]
},

"mode_cluster": {
"host": "",
"port": 0,
"userId": "",
"password": "",
"ClientID": "NOT_NEEDED",
"QoS": 2,
"TopicsToSubscribe": ["cpsens/recorded/sysid/data"],
"TopicsToPublish": ["cpsens/recorded/mode_cluster/data"]
},

"model_update": {
"host": "",
"port": 0,
"userId": "",
"password": "",
"ClientID": "NOT_NEEDED",
"QoS": 2,
"TopicsToSubscribe": ["cpsens/recorded/mode_cluster/data"],
"TopicsToPublish": ["cpsens/recorded/model_update/data"]
}
}


File renamed without changes.
File renamed without changes.
Loading
Loading