diff --git a/README.md b/README.md index e69546f4..6e741ffe 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,7 @@ - [Tokio Console Support](#tokio-console-support) - [Running the Tests](#running-the-tests) - [Running the Samples](#running-the-samples) - - [Property Sample](#property-sample) - - [Command Sample](#command-sample) - - [Mixed Sample](#mixed-sample) - - [Seat Massager Sample](#seat-massager-sample) - - [Streaming Sample](#streaming-sample) - - [Using Chariott](#using-chariott) +- [Using Chariott](#using-chariott) - [Running in a Container](#running-in-a-container) - [Trademarks](#trademarks) @@ -143,15 +138,16 @@ Currently, we have no integration tests or end-to-end tests. ## Running the Samples -There are currently four samples: one that demonstrates the use of a property, one that demonstrates the use of a command, one that -demonstrates the mixed use of properties and commands and one that demonstrates the use of get/set for a seat massager. +There are currently six samples: -The demos use config files and we have provided a templated version of each config file. These templates can be found in: + - [Property Sample](docs/samples/property/README.md) - demonstrates the use of a property + - [Command Sample](docs/samples/command/README.md) - demonstrates the use of a command + - [Mixed Sample](docs/samples/mixed/README.md) - demonstrates the mixed use of properties and commands + - [Seat Massager Sample](docs/samples/seat_massager/README.md) - demonstrates the use of get/set for a seat massager + - [Streaming Sample](docs/samples/streaming/README.md) - demonstrates the use of streaming + - [Digital Twin Graph Sample](docs/samples/digital_twin_graph/README.md) - demonstrates the use of the Digital Twin Graph Service -- {repo-root-dir}/core/invehicle-digital-twin/template -- {repo-root-dir}/samples/common/template - -Configuration files will be loaded from the current working directory by default +The samples' onfiguration files will be loaded from the current working directory by default, but an `IBEJI_HOME` environment variable can be used to change the base configuration directory to a different one: ```shell @@ -161,154 +157,9 @@ IBEJI_HOME=/etc/ibeji ./invehicle-digital-twin The above example tells `invehicle-digital-twin` to load configuration files from `/etc/ibeji` instead of using the current working directory. -Chariott may be used to discover the in-vehicle digital twin service. We will discuss how to enable this feature in the section on [Using Chariott](#using-chariott). - -### Property Sample - -The following instructions are for the demo for the use of a property. This sample uses a MQTT Broker; please make sure that it is running. - -Steps: - -1. The best way to run the demo is by using three windows: one running the In-Vehicle Digital Twin, one running the Digital Twin Provider and one running the Digital Twin Consumer. -Orientate the three windows so that they are lined up in a column. The top window can be used for the In-Vehicle Digital Twin. -The middle window can be used for the Digital Twin Provider. The bottom window can be used for the Digital Twin Consumer.
-1. In each window, change directory to the directory containing the build artifacts. -Make sure that you replace "{repo-root-dir}" with the repository root directory on the machine where you are running the demo.

-`cd {repo-root-dir}/target/debug`
-1. Create the three config files with the following contents, if they are not already there:

----- consumer_settings.yaml ----
-`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

----- invehicle_digital_twin_settings.yaml ----
-`invehicle_digital_twin_authority: "0.0.0.0:5010"`

----- provider_settings.yaml ----
-`provider_authority: "0.0.0.0:1883"`
-`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

-1. In the top window, run:

-`./invehicle-digital-twin`
-1. In the middle window, run:

-`./property-provider`
-1. In the bottom window, run:

-`./property-consumer`
-1. Use control-c in each of the windows when you wish to stop the demo. - -### Command Sample - -The following instructions are for the demo for the use of a command. - -Steps: - -1. The best way to run the demo is by using three windows: one running the In-Vehicle Digital Twin, one running the Digital Twin Provider and one running the Digital Twin Consumer. -Orientate the three windows so that they are lined up in a column. The top window can be used for the In-Vehicle Digital Twin. -The middle window can be used for the Digital Twin Provider. The bottom window can be used for the Digital Twin Consumer.
-1. In each window, change directory to the directory containing the build artifacts. -Make sure that you replace "{repo-root-dir}" with the repository root directory on the machine where you are running the demo.

-`cd {repo-root-dir}/target/debug`
-1. Create the three config files with the following contents, if they are not already there:

----- consumer_settings.yaml ----
-`consumer_authority: "0.0.0.0:6010"`
-`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

----- invehicle_digital_twin_settings.yaml ----
-`invehicle_digital_twin_authority: "0.0.0.0:5010"`

----- provider_settings.yaml ----
-`provider_authority: "0.0.0.0:4010"`
-`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

-1. In the top window, run:

-`./invehicle-digital-twin`
-1. In the middle window, run:

-`./command-provider`
-1. In the bottom window, run:

-`./command-consumer`
-1. Use control-c in each of the windows when you wish to stop the demo. - -### Mixed Sample - -The following instructions are for the demo for the mixed use of commands and properties. - -Steps: - -1. The best way to run the demo is by using three windows: one running the In-Vehicle Digital Twin, one running the Digital Twin Provider and one running the Digital Twin Consumer. -Orientate the three windows so that they are lined up in a column. The top window can be used for the In-Vehicle Digital Twin. -The middle window can be used for the Digital Twin Provider. The bottom window can be used for the Digital Twin Consumer.
-1. In each window, change directory to the directory containing the build artifacts. -Make sure that you replace "{repo-root-dir}" with the repository root directory on the machine where you are running the demo.

-`cd {repo-root-dir}/target/debug`
-1. Create the three config files with the following contents, if they are not already there:

----- consumer_settings.yaml ----
-`consumer_authority: "0.0.0.0:6010"`
-`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

----- invehicle_digital_twin_settings.yaml ----
-`invehicle_digital_twin_authority: "0.0.0.0:5010"`

----- provider_settings.yaml ----
-`provider_authority: "0.0.0.0:4010"`
-`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

-1. In the top window, run:

-`./invehicle-digital-twin`
-1. In the middle window, run:

-`./mixed-provider`
-1. In the bottom window, run:

-`./mixed-consumer`
-1. Use control-c in each of the windows when you wish to stop the demo. - -### Seat Massager Sample - -The following instructions are for the demo for a seat massager. - -Steps: - -1. The best way to run the demo is by using three windows: one running the In-Vehicle Digital Twin, one running the Digital Twin Provider and one running the Digital Twin Consumer. -Orientate the three windows so that they are lined up in a column. The top window can be used for the In-Vehicle Digital Twin. -The middle window can be used for the Digital Twin Provider. The bottom window can be used for the Digital Twin Consumer.
-1. In each window, change directory to the directory containing the build artifacts. -Make sure that you replace "{repo-root-dir}" with the repository root directory on the machine where you are running the demo.

-`cd {repo-root-dir}/target/debug`
-1. Create the three config files with the following contents, if they are not already there:

----- consumer_settings.yaml ----
-`consumer_authority: "0.0.0.0:6010"`
-`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

----- invehicle_digital_twin_settings.yaml ----
-`invehicle_digital_twin_authority: "0.0.0.0:5010"`

----- provider_settings.yaml ----
-`provider_authority: "0.0.0.0:4010"`
-`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

-1. In the top window, run:

-`./invehicle-digital-twin`
-1. In the middle window, run:

-`./seat-massager-provider`
-1. In the bottom window, run:

-`./seat-massager-consumer`
-1. Use control-c in each of the windows when you wish to stop the demo. - -### Streaming Sample - -The following instructions are for the demo for streaming. - -Steps: - -1. The best way to run the demo is by using three windows: one running the In-Vehicle Digital Twin, one running the Digital Twin Provider and one running the Digital Twin Consumer. -Orientate the three windows so that they are lined up in a column. The top window can be used for the In-Vehicle Digital Twin. -The middle window can be used for the Digital Twin Provider. The bottom window can be used for the Digital Twin Consumer.
-1. In each window, change directory to the directory containing the build artifacts. -Make sure that you replace "{repo-root-dir}" with the repository root directory on the machine where you are running the demo.

-`cd {repo-root-dir}/target/debug`
-1. Create the three config files with the following contents, if they are not already there:

----- streaming_consumer_settings.yaml ----
-`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

-`number_of_images: 20`

----- invehicle_digital_twin_settings.yaml ----
-`invehicle_digital_twin_authority: "0.0.0.0:5010"`

----- streaming_provider_settings.yaml ----
-`provider_authority: "0.0.0.0:4010"`
-`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

-`image_directory: "<>/examples/applications/simulated-camera/images"` -1. In the top window, run:

-`./invehicle-digital-twin`
-1. In the middle window, run:

-`./streaming-provider`
-1. In the bottom window, run:

-`./streaming-consumer`
-1. Use control-c in each of the windows when you wish to stop the demo. - -### Using Chariott +With the samples, Chariott may be used to discover the in-vehicle digital twin service. We will discuss how to enable this feature in the section on [Using Chariott](#using-chariott). + +## Using Chariott If you want the digital twin consumers and digital twin providers for each demo to use Chariott to discover the URI for the In-Vehicle Digital Twin Service, rather than having it statically provided in their respective config file, then do the following before starting each demo: diff --git a/docs/samples/command/README.md b/docs/samples/command/README.md new file mode 100644 index 00000000..2c7ad2fe --- /dev/null +++ b/docs/samples/command/README.md @@ -0,0 +1,37 @@ +# Sample: Command + +The command sample demonstrates the use of a command. + +Follow these instructions to run the demo. + +Steps: + +1. The best way to run the demo is by using three windows: one running the In-Vehicle Digital Twin, one running the Digital Twin Provider and one running the Digital Twin Consumer. +Orientate the three windows so that they are lined up in a column. The top window can be used for the In-Vehicle Digital Twin. +The middle window can be used for the Digital Twin Provider. The bottom window can be used for the Digital Twin Consumer.
+1. In each window, change directory to the directory containing the build artifacts. +Make sure that you replace "{repo-root-dir}" with the repository root directory on the machine where you are running the demo.

+`cd {repo-root-dir}/target/debug`
+1. Create the three config files with the following contents, if they are not already there:

+---- consumer_settings.yaml ----
+`consumer_authority: "0.0.0.0:6010"`
+`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

+---- invehicle_digital_twin_settings.yaml ----
+`invehicle_digital_twin_authority: "0.0.0.0:5010"`

+---- provider_settings.yaml ----
+`provider_authority: "0.0.0.0:4010"`
+`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

+1. In the top window, run:

+`./invehicle-digital-twin`
+1. In the middle window, run:

+`./command-provider`
+1. In the bottom window, run:

+`./command-consumer`
+1. Use control-c in each of the windows when you wish to stop the demo. + + + +A templated version of each config file can be found in: + +- {repo-root-dir}/core/invehicle-digital-twin/template +- {repo-root-dir}/samples/common/template diff --git a/docs/samples/mixed/README.md b/docs/samples/mixed/README.md new file mode 100644 index 00000000..f0582452 --- /dev/null +++ b/docs/samples/mixed/README.md @@ -0,0 +1,35 @@ +# Sample: Mixed + +The mixed sample demonstrates the use of both properties and commands. + +Follow these instructions to run the demo. + +Steps: + +1. The best way to run the demo is by using three windows: one running the In-Vehicle Digital Twin, one running the Digital Twin Provider and one running the Digital Twin Consumer. +Orientate the three windows so that they are lined up in a column. The top window can be used for the In-Vehicle Digital Twin. +The middle window can be used for the Digital Twin Provider. The bottom window can be used for the Digital Twin Consumer.
+1. In each window, change directory to the directory containing the build artifacts. +Make sure that you replace "{repo-root-dir}" with the repository root directory on the machine where you are running the demo.

+`cd {repo-root-dir}/target/debug`
+1. Create the three config files with the following contents, if they are not already there:

+---- consumer_settings.yaml ----
+`consumer_authority: "0.0.0.0:6010"`
+`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

+---- invehicle_digital_twin_settings.yaml ----
+`invehicle_digital_twin_authority: "0.0.0.0:5010"`

+---- provider_settings.yaml ----
+`provider_authority: "0.0.0.0:4010"`
+`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

+1. In the top window, run:

+`./invehicle-digital-twin`
+1. In the middle window, run:

+`./mixed-provider`
+1. In the bottom window, run:

+`./mixed-consumer`
+1. Use control-c in each of the windows when you wish to stop the demo. + +A templated version of each config file can be found in: + +- {repo-root-dir}/core/invehicle-digital-twin/template +- {repo-root-dir}/samples/common/template diff --git a/docs/samples/property/README.md b/docs/samples/property/README.md new file mode 100644 index 00000000..66ebeac8 --- /dev/null +++ b/docs/samples/property/README.md @@ -0,0 +1,36 @@ +# Sample: Property + +The property sample demonstrates the use of a property. + +This sample uses a MQTT Broker; please make sure that it is running. + +Follow these instructions to run the demo. + +Steps: + +1. The best way to run the demo is by using three windows: one running the In-Vehicle Digital Twin, one running the Digital Twin Provider and one running the Digital Twin Consumer. +Orientate the three windows so that they are lined up in a column. The top window can be used for the In-Vehicle Digital Twin. +The middle window can be used for the Digital Twin Provider. The bottom window can be used for the Digital Twin Consumer.
+1. In each window, change directory to the directory containing the build artifacts. +Make sure that you replace "{repo-root-dir}" with the repository root directory on the machine where you are running the demo.

+`cd {repo-root-dir}/target/debug`
+1. Create the three config files with the following contents, if they are not already there:

+---- consumer_settings.yaml ----
+`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

+---- invehicle_digital_twin_settings.yaml ----
+`invehicle_digital_twin_authority: "0.0.0.0:5010"`

+---- provider_settings.yaml ----
+`provider_authority: "0.0.0.0:1883"`
+`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

+1. In the top window, run:

+`./invehicle-digital-twin`
+1. In the middle window, run:

+`./property-provider`
+1. In the bottom window, run:

+`./property-consumer`
+1. Use control-c in each of the windows when you wish to stop the demo. + +A templated version of each config file can be found in: + +- {repo-root-dir}/core/invehicle-digital-twin/template +- {repo-root-dir}/samples/common/template diff --git a/docs/samples/seat_massager/README.md b/docs/samples/seat_massager/README.md new file mode 100644 index 00000000..5330217d --- /dev/null +++ b/docs/samples/seat_massager/README.md @@ -0,0 +1,35 @@ +# Sample: Seat Massager + +The seat massager sample demonstrates how a seat massager may be implemented. + +Follow these instructions to run the demo. + +Steps: + +1. The best way to run the demo is by using three windows: one running the In-Vehicle Digital Twin, one running the Digital Twin Provider and one running the Digital Twin Consumer. +Orientate the three windows so that they are lined up in a column. The top window can be used for the In-Vehicle Digital Twin. +The middle window can be used for the Digital Twin Provider. The bottom window can be used for the Digital Twin Consumer.
+1. In each window, change directory to the directory containing the build artifacts. +Make sure that you replace "{repo-root-dir}" with the repository root directory on the machine where you are running the demo.

+`cd {repo-root-dir}/target/debug`
+1. Create the three config files with the following contents, if they are not already there:

+---- consumer_settings.yaml ----
+`consumer_authority: "0.0.0.0:6010"`
+`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

+---- invehicle_digital_twin_settings.yaml ----
+`invehicle_digital_twin_authority: "0.0.0.0:5010"`

+---- provider_settings.yaml ----
+`provider_authority: "0.0.0.0:4010"`
+`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

+1. In the top window, run:

+`./invehicle-digital-twin`
+1. In the middle window, run:

+`./seat-massager-provider`
+1. In the bottom window, run:

+`./seat-massager-consumer`
+1. Use control-c in each of the windows when you wish to stop the demo. + +A templated version of each config file can be found in: + +- {repo-root-dir}/core/invehicle-digital-twin/template +- {repo-root-dir}/samples/common/template diff --git a/docs/samples/streaming/README.md b/docs/samples/streaming/README.md new file mode 100644 index 00000000..d469579f --- /dev/null +++ b/docs/samples/streaming/README.md @@ -0,0 +1,36 @@ +# Sample: Streaming + +The streaming sample demonstrates the streaming of a video stream. + +Follow these instructions to run the demo. + +Steps: + +1. The best way to run the demo is by using three windows: one running the In-Vehicle Digital Twin, one running the Digital Twin Provider and one running the Digital Twin Consumer. +Orientate the three windows so that they are lined up in a column. The top window can be used for the In-Vehicle Digital Twin. +The middle window can be used for the Digital Twin Provider. The bottom window can be used for the Digital Twin Consumer.
+1. In each window, change directory to the directory containing the build artifacts. +Make sure that you replace "{repo-root-dir}" with the repository root directory on the machine where you are running the demo.

+`cd {repo-root-dir}/target/debug`
+1. Create the three config files with the following contents, if they are not already there:

+---- streaming_consumer_settings.yaml ----
+`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

+`number_of_images: 20`

+---- invehicle_digital_twin_settings.yaml ----
+`invehicle_digital_twin_authority: "0.0.0.0:5010"`

+---- streaming_provider_settings.yaml ----
+`provider_authority: "0.0.0.0:4010"`
+`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`

+`image_directory: "<>/examples/applications/simulated-camera/images"` +1. In the top window, run:

+`./invehicle-digital-twin`
+1. In the middle window, run:

+`./streaming-provider`
+1. In the bottom window, run:

+`./streaming-consumer`
+1. Use control-c in each of the windows when you wish to stop the demo. + +A templated version of each config file can be found in: + +- {repo-root-dir}/core/invehicle-digital-twin/template +- {repo-root-dir}/samples/common/template