Overview
Integration with SENSR
SENSR is built to be integrated with other software solutions. This section describes how to pilot SENSR through its APIs and process SENSR's output data with another system.
- SENSR's output data described in the Output Specification page,
- Data can be integrated through the SENSR Software Development Kit that supports Python, C++, Javascript,
- SENSR can be controlled through its REST API.
Process SENSR output data
Software Development Kit
SENSR's output data can be received and processed through the SDK by connecting to the Master Node.
It is recommended to deploy the SDK on the machine that will be used for integrating with SENSR.
Installation instructions can be found on the SDK's page. The SDK supports Python, C++ and JavaScript for processing the output data.
For each language, more information is provided in the README files in the SDK repository.
Output specification
SENSR encodes data through Protobuf and sends it through a TCP Websocket. The full specification can be found on the Output Specification page.
The Websocket Endpoints are sent as follows:
| Communication Protocol | TCP (Websocket) |
|---|---|
| Data Encoding | Protobuf 3 |
| Output Port | 5050 |
| Protobuf Message | OutputMessage |
| Communication Protocol | TCP (Websocket) |
|---|---|
| Data Encoding | Protobuf 3 |
| Output Port | 5051 |
| Protobuf Message | PointResult |
REST API remote control
SENSR can be remote-controlled through its REST API. They allow to:
- Control Algo Nodes,
- Change parameters,
- Add and remove zones,
- Restart the pipeline,
- Record data...
Specification
The REST API is fully documented with usage examples one REST API specification page.
Security
By default the REST API and Output message are shared through the http protocol. The following steps describe how to enable secure mode and ensure that all outbound/inbound packets are secured through SSL.
- In the Master Node, generate certificate files by running
generate_certificate.shwith the ip address of the publishing packets. (E.g.$./generate_certificate.sh 192.168.0.100) - The certificate file will be located under
$HOME/seoulrobotics/keys - Update parameters to ensure the secure mode is used:
- Master Node: In
bin/data/app_config/app_settings.toml, changesecurity.enable_ssl - API queries: Run the queries in the form
$ curl -X GET 'https://localhost:9080/... - SDK:
- Use the output modules
_secure - Make sure the variable
use_ssl=True - Example: In message_listener.py at L31 :
use_ssl=True
- Use the output modules
- Master Node: In