A sample implementation to be able to forward individual data streams from AVETO to external software and vice versa
View Usage
·
Report Bug
·
Request Feature
Table of Contents
The project consists of three components:
- Data Forwarding Measurement Object
- Data Backwarding Measurement Object
- Python example for the receiving side
Object: Processor Object
Name: Data Forwarding
Input: Generic Connector "*"
Output: -
Properties:
Property Name | Type | Default | Description |
---|---|---|---|
FPS Limit | uint32_t | 5 | FPS limit for the forwarding data stream |
No Payload | bool | false | true: Only meta data is forwarded false: Meta data and data is forwarded |
Once created, data packets coming in over a connection are forwarded to each connected client. By default, the forwarding frame rate is limited to 5 frames per second. This limit can be changed using the FPS Limit
property.
By default, the complete packet data and additional metadata is forwarded. If you set the No Payload
property to true, only the metadata is sent.
Object: Processor Object
Name: Data Backwarding
Input: -
Output: RGBA-Image and JSON meta data
After creation, the data sent from the client side is output through the output connectors.
The project includes a small Python example that allows the user to receive data from the AVETO site, display it, and return data that has been processed.
3rd party components measurement objects:
- cppzmq 4.8.1
- msgpack 3.3.0
3rd party components python example:
See example/requirements.txt
Clone this repository and make sure you fulfill following requirements
- Installed AVETO.app >= 2.4.0
- Set AVETO_SDK_PATH as environment variable which by default points to the folder
C:\Program Files\b-plus\AVETO.app\sdk
- Installed Windows SDK-Version 10.0.17763.0
- Installed cppzmq and msgpack
- The firewall must be set so that the AVETO Visualization host can be reached on the ports used for communication.
- Default ports: 5770 - 5789 (TCP), 5870 - 5889 (TCP)
- Install AVETO.app
- Clone the repo
git clone https://github.com/bplus-group/aveto_mo_data_forwarding.git
- Adapt the include and library directories in the Visual Studio Solution that it finds the cppzmq and msgpack dependencies
- Build the project
- Copy the DLLs to your AVETO MO directory (default:
%USERPROFILE%\Documents\AVETO\measobj\
)
Right-click in the node graph editor of the configuration manager and choose Processor Objects -> Data Forwarding MO and Data Backwarding MO as seen below.
Connect the input and output connectors of the objects according to your requirements. An example is shown below.
-
Build the example container:
docker build ./example/ -t data-forwarding-example
-
Determine the ip address of the AVETO Visualization host.
-
Run the example:
docker run -it --rm \ -e AVETO_HOST="<HOST_IP>" \ data-forwarding-example # or with gui access docker run -it --rm \ -e AVETO_HOST="<HOST_IP>" \ -e DISPLAY=$DISPLAY \ -v /tmp/.X11-unix:/tmp/.X11-unix \ data-forwarding-example
NOTE: You can also use the example without docker
NOTE: By default the forwarding is limited to 5fps (can be changed via properties)
ZeroMQ is used for forwarding and backwarding the data. Every datasource gets its own channel/port (starts at 0, default limit: 20)
The following data can currently be forwarded:
image
-> RGBA camera imagesraw
-> every other data typemetadata_only
-> no payload only metadata (can be enabled via mo properties)
If you want to receive data, you have to connect to a ZeroMQ PubSocket (default port 5770 + Channel (TCP)) and subscribe to the corresponding topic.
List of current available topics:
out/image0
If you want to send data, you have to connect to a PullSocket and send the corresponding message to it.
Direction | AVETO.vis socket type | AVETO.vis port | Application socket type |
---|---|---|---|
forwarding | publisher socket | 5770 + Channel | subscriber socket |
backwarding | pull socket | 5870 + Channel | push socket |
For encoding the messages MsgPack is used.
Message formats:
//////////////////////////////////
// Forwarding Message Definition:
//////////////////////////////////
//////////// Base MSG ////////////
1. Source | string | the source where the message originates from (default: "image0")
2. Timestamp | unit64 | the timestamp of the AVETO data packet
3. Type | string | the type of the payload (currently supported: ["image", "raw", "metadata_only"])
4. Format | string | the format of the payload ("RGBA" for image type and the name of the connector in Vis. for all other types)
5. FormatSize | array<int, 3> | description of the the payload format structure (width, height, bits per pixel) (only used for "image")
6. Image | bin format | the payload as 1D byte array
//////////////////////////////////
// Backwarding Message Definition:
//////////////////////////////////
//////////// Base MSG ////////////
1. Target | string | the destination (output channel) to which the msg should go (default: "image0")
2. Timestamp | unit64 | the timestamp of the AVETO data packet (used to match the results to original frames)
3. Type | string | the type of the payload (currently supported: ["image"])
4. Format | string | the format of the payload (currently supported: ["RGBA"])
//////////// RGBA MSG ////////////
5. FormatSize | array<int, 3> | description of the the payload format structure (width, height, bits per pixel)
6. MetaData | string | used for the meta data channel (JSON format, e.g. for list of detections, ...)
7. Image | bin format | the image payload as 1D byte array
If you have a suggestion that would improve this, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/NewFeature
) - Commit your Changes (
git commit -m 'Add some NewFeature'
) - Push to the Branch (
git push origin feature/NewFeature
) - Open a Pull Request
Check License information. See LICENSE
for more information.