Skip to content
README.md 3.5 KiB
Newer Older
*This repository is part of the outcomes of the Specialist Task Force 669 focusing on the communication between a World Analysis and World Representation components as part of the ETSI ISG Augmented Reality Framework architecture (https://www.etsi.org/deliver/etsi_gs/ARF/001_099/003/01.01.01_60/gs_ARF003v010101p.pdf).*
*The set of the World Representation authoring components includes:*
Sylvain Renault's avatar
Sylvain Renault committed

*•	The Python, C++ and C# source code for servers and clients generated from OpenAPI available here (https://forge.etsi.org/rep/arf/arf005)*
Sylvain Renault's avatar
Sylvain Renault committed

*•	A Unity plugin and a Unity editor for authoring and accessing a World Representation hosted on a World Storage server.*
Sylvain Renault's avatar
Sylvain Renault committed

*All these components are available under the ETSI Labs group “World Storage API Helpers”: https://labs.etsi.org/rep/arf/world-storage-api-helpers*
Sylvain Renault's avatar
Sylvain Renault committed

*If you wish to contribute to this project or any other projects in the context of the [ETSI ISG Augmented Reality Framework architecture](https://www.etsi.org/committee/1420-arf), please refer to the ["How to get involved in an ISG" section on the ETSI website](https://www.etsi.org/how-to-get-involved-in-an-isg)*
Sylvain Renault's avatar
Sylvain Renault committed

Sylvain Renault's avatar
Sylvain Renault committed

# Description
Sylvain Renault's avatar
Sylvain Renault committed

This repo should be used to construct a Python server compliant to the ARF World Storage API. It uses auto-generated python server code. We propose to use the open source OpenAPI-Generator for this.
## Repo Content
Sylvain Renault's avatar
Sylvain Renault committed

|   |  Files / Folders |                                                                                    Description                                                                                    |
|:-:|:--------------:|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| 📂 | wrapper  | The folder where the python World Analysis code with WS REST and WA websocket connection is implemented |
Sylvain Renault's avatar
Sylvain Renault committed

## Requirements
Sylvain Renault's avatar
Sylvain Renault committed

What you need:
Sylvain Renault's avatar
Sylvain Renault committed

1.	Installed npm: https://phoenixnap.com/kb/install-node-js-npm-on-windows
2.	Installed openapi generator with npm: https://openapi-generator.tech/docs/installation/
3.	Optional: Installed docker (recommanded): https://www.docker.com/get-started 
Sylvain Renault's avatar
Sylvain Renault committed

## Auto-generate client code for WS

Use/define following setup for the config file `openapitools.json`:

```
{
  "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
  "spaces": 2,
  "generator-cli": {
    "version": "7.6.0",
    "generators":{
      "python": {
     "generatorName": "python",
     "output": "./generated_wa_client",
     "inputSpec": "./openapi/API/worldanalysis/worldanalysisopenapi.yaml",
     "additionalProperties": {
      "packageName": "ETSI.ARF.OpenAPI.WorldAnalysis"
     }
     }
    }
  }
}
```

Open a command shell and execute:
```
  npx openapi-generator-cli generate
```
Sylvain Renault's avatar
Sylvain Renault committed

## Installing the python module on your local computer
Sylvain Renault's avatar
Sylvain Renault committed

It's recommended to create the enviroment with conda (if available)
Sylvain Renault's avatar
Sylvain Renault committed

```
conda create -n openapi
conda activate openapi
```
Sylvain Renault's avatar
Sylvain Renault committed

Install the World Analysis OpenAPI:

```
pip install .\generated_wa_client
```

In case of not having the pip installed for your cml you can use following line:

```
py -m pip install .\generated_wa_client
```

## Installing the python module for WebSockets on your local computer

Install the common package for async WebSockets:
Sylvain Renault's avatar
Sylvain Renault committed

```
pip install websockets
```
Sylvain Renault's avatar
Sylvain Renault committed

In case of not having the pip installed for your cml you can use following line:
Sylvain Renault's avatar
Sylvain Renault committed

```
py -m pip install websockets
```
Sylvain Renault's avatar
Sylvain Renault committed

## Running the test script
Sylvain Renault's avatar
Sylvain Renault committed

Run python script with:
```
cd wrapper
python WorldAnalysisWrapper.py
```