Skip to content

Commit

Permalink
Digital Twin Graph
Browse files Browse the repository at this point in the history
  • Loading branch information
ashbeitz committed May 5, 2024
1 parent 21735bf commit 84369e9
Show file tree
Hide file tree
Showing 6 changed files with 191 additions and 161 deletions.
173 changes: 12 additions & 161 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -143,15 +138,16 @@ Currently, we have no integration tests or end-to-end tests.
## <a name="running-the-samples">Running the Samples</a>
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
Expand All @@ -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).

### <a name="property-sample">Property Sample</a>

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.<br>
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.<br><br>
`cd {repo-root-dir}/target/debug`<br>
1. Create the three config files with the following contents, if they are not already there:<br><br>
---- consumer_settings.yaml ----<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
---- invehicle_digital_twin_settings.yaml ----<br>
`invehicle_digital_twin_authority: "0.0.0.0:5010"`<br><br>
---- provider_settings.yaml ----<br>
`provider_authority: "0.0.0.0:1883"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
1. In the top window, run:<br><br>
`./invehicle-digital-twin`<br>
1. In the middle window, run:<br><br>
`./property-provider`<br>
1. In the bottom window, run:<br><br>
`./property-consumer`<br>
1. Use control-c in each of the windows when you wish to stop the demo.

### <a name="command-sample">Command Sample</a>

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.<br>
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.<br><br>
`cd {repo-root-dir}/target/debug`<br>
1. Create the three config files with the following contents, if they are not already there:<br><br>
---- consumer_settings.yaml ----<br>
`consumer_authority: "0.0.0.0:6010"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
---- invehicle_digital_twin_settings.yaml ----<br>
`invehicle_digital_twin_authority: "0.0.0.0:5010"`<br><br>
---- provider_settings.yaml ----<br>
`provider_authority: "0.0.0.0:4010"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
1. In the top window, run:<br><br>
`./invehicle-digital-twin`<br>
1. In the middle window, run:<br><br>
`./command-provider`<br>
1. In the bottom window, run:<br><br>
`./command-consumer`<br>
1. Use control-c in each of the windows when you wish to stop the demo.

### <a name="mixed-sample">Mixed Sample</a>

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.<br>
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.<br><br>
`cd {repo-root-dir}/target/debug`<br>
1. Create the three config files with the following contents, if they are not already there:<br><br>
---- consumer_settings.yaml ----<br>
`consumer_authority: "0.0.0.0:6010"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
---- invehicle_digital_twin_settings.yaml ----<br>
`invehicle_digital_twin_authority: "0.0.0.0:5010"`<br><br>
---- provider_settings.yaml ----<br>
`provider_authority: "0.0.0.0:4010"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
1. In the top window, run:<br><br>
`./invehicle-digital-twin`<br>
1. In the middle window, run:<br><br>
`./mixed-provider`<br>
1. In the bottom window, run:<br><br>
`./mixed-consumer`<br>
1. Use control-c in each of the windows when you wish to stop the demo.

### <a name="seat-massager-sample">Seat Massager Sample</a>

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.<br>
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.<br><br>
`cd {repo-root-dir}/target/debug`<br>
1. Create the three config files with the following contents, if they are not already there:<br><br>
---- consumer_settings.yaml ----<br>
`consumer_authority: "0.0.0.0:6010"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
---- invehicle_digital_twin_settings.yaml ----<br>
`invehicle_digital_twin_authority: "0.0.0.0:5010"`<br><br>
---- provider_settings.yaml ----<br>
`provider_authority: "0.0.0.0:4010"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
1. In the top window, run:<br><br>
`./invehicle-digital-twin`<br>
1. In the middle window, run:<br><br>
`./seat-massager-provider`<br>
1. In the bottom window, run:<br><br>
`./seat-massager-consumer`<br>
1. Use control-c in each of the windows when you wish to stop the demo.

### <a name="streaming-sample">Streaming Sample</a>

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.<br>
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.<br><br>
`cd {repo-root-dir}/target/debug`<br>
1. Create the three config files with the following contents, if they are not already there:<br><br>
---- streaming_consumer_settings.yaml ----<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
`number_of_images: 20`<br><br>
---- invehicle_digital_twin_settings.yaml ----<br>
`invehicle_digital_twin_authority: "0.0.0.0:5010"`<br><br>
---- streaming_provider_settings.yaml ----<br>
`provider_authority: "0.0.0.0:4010"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
`image_directory: "<<chariott-repo-root>>/examples/applications/simulated-camera/images"`
1. In the top window, run:<br><br>
`./invehicle-digital-twin`<br>
1. In the middle window, run:<br><br>
`./streaming-provider`<br>
1. In the bottom window, run:<br><br>
`./streaming-consumer`<br>
1. Use control-c in each of the windows when you wish to stop the demo.

### <a name="using-chariott">Using Chariott</a>
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).
## <a name="using-chariott">Using Chariott</a>
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:
Expand Down
37 changes: 37 additions & 0 deletions docs/samples/command/README.md
Original file line number Diff line number Diff line change
@@ -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.<br>
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.<br><br>
`cd {repo-root-dir}/target/debug`<br>
1. Create the three config files with the following contents, if they are not already there:<br><br>
---- consumer_settings.yaml ----<br>
`consumer_authority: "0.0.0.0:6010"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
---- invehicle_digital_twin_settings.yaml ----<br>
`invehicle_digital_twin_authority: "0.0.0.0:5010"`<br><br>
---- provider_settings.yaml ----<br>
`provider_authority: "0.0.0.0:4010"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
1. In the top window, run:<br><br>
`./invehicle-digital-twin`<br>
1. In the middle window, run:<br><br>
`./command-provider`<br>
1. In the bottom window, run:<br><br>
`./command-consumer`<br>
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
35 changes: 35 additions & 0 deletions docs/samples/mixed/README.md
Original file line number Diff line number Diff line change
@@ -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.<br>
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.<br><br>
`cd {repo-root-dir}/target/debug`<br>
1. Create the three config files with the following contents, if they are not already there:<br><br>
---- consumer_settings.yaml ----<br>
`consumer_authority: "0.0.0.0:6010"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
---- invehicle_digital_twin_settings.yaml ----<br>
`invehicle_digital_twin_authority: "0.0.0.0:5010"`<br><br>
---- provider_settings.yaml ----<br>
`provider_authority: "0.0.0.0:4010"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
1. In the top window, run:<br><br>
`./invehicle-digital-twin`<br>
1. In the middle window, run:<br><br>
`./mixed-provider`<br>
1. In the bottom window, run:<br><br>
`./mixed-consumer`<br>
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
36 changes: 36 additions & 0 deletions docs/samples/property/README.md
Original file line number Diff line number Diff line change
@@ -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.<br>
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.<br><br>
`cd {repo-root-dir}/target/debug`<br>
1. Create the three config files with the following contents, if they are not already there:<br><br>
---- consumer_settings.yaml ----<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
---- invehicle_digital_twin_settings.yaml ----<br>
`invehicle_digital_twin_authority: "0.0.0.0:5010"`<br><br>
---- provider_settings.yaml ----<br>
`provider_authority: "0.0.0.0:1883"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
1. In the top window, run:<br><br>
`./invehicle-digital-twin`<br>
1. In the middle window, run:<br><br>
`./property-provider`<br>
1. In the bottom window, run:<br><br>
`./property-consumer`<br>
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
35 changes: 35 additions & 0 deletions docs/samples/seat_massager/README.md
Original file line number Diff line number Diff line change
@@ -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.<br>
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.<br><br>
`cd {repo-root-dir}/target/debug`<br>
1. Create the three config files with the following contents, if they are not already there:<br><br>
---- consumer_settings.yaml ----<br>
`consumer_authority: "0.0.0.0:6010"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
---- invehicle_digital_twin_settings.yaml ----<br>
`invehicle_digital_twin_authority: "0.0.0.0:5010"`<br><br>
---- provider_settings.yaml ----<br>
`provider_authority: "0.0.0.0:4010"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
1. In the top window, run:<br><br>
`./invehicle-digital-twin`<br>
1. In the middle window, run:<br><br>
`./seat-massager-provider`<br>
1. In the bottom window, run:<br><br>
`./seat-massager-consumer`<br>
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
36 changes: 36 additions & 0 deletions docs/samples/streaming/README.md
Original file line number Diff line number Diff line change
@@ -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.<br>
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.<br><br>
`cd {repo-root-dir}/target/debug`<br>
1. Create the three config files with the following contents, if they are not already there:<br><br>
---- streaming_consumer_settings.yaml ----<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
`number_of_images: 20`<br><br>
---- invehicle_digital_twin_settings.yaml ----<br>
`invehicle_digital_twin_authority: "0.0.0.0:5010"`<br><br>
---- streaming_provider_settings.yaml ----<br>
`provider_authority: "0.0.0.0:4010"`<br>
`invehicle_digital_twin_uri: "http://0.0.0.0:5010"`<br><br>
`image_directory: "<<chariott-repo-root>>/examples/applications/simulated-camera/images"`
1. In the top window, run:<br><br>
`./invehicle-digital-twin`<br>
1. In the middle window, run:<br><br>
`./streaming-provider`<br>
1. In the bottom window, run:<br><br>
`./streaming-consumer`<br>
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

0 comments on commit 84369e9

Please sign in to comment.