# DroneCore.OS on Stribog

## Introduction

Similar to DCS1 & 2, we provide various packages for developers, so they can seamlessly integrate their applications.

{% content-ref url="/pages/nfflcubAG94SY3jIlEDQ" %}
[DroneCore.OS on DCS 1 & 2 (with Orin NX)](/dronecore.os/dronecore-os-dcs-1-and-2-with-orin-nx.md)
{% endcontent-ref %}

You can see the whole application group [here on GitLabGitLab](https://gitlab.com/airvolute_oss/dronecore.os). Repositories are publicly available. This is a simple list of available applications:

* [av-stream-selector](https://gitlab.com/airvolute_oss/dronecore.os/av-stream-selector)
* [av-stribog-cam](https://gitlab.com/airvolute_oss/dronecore.os/av-stribog-cam)
* [mavlink-udp-comm-template](https://gitlab.com/airvolute_oss/dronecore.os/mavlink-udp-comm-template)
* [mavlink-udp-interface](https://gitlab.com/airvolute_oss/dronecore.os/mavlink-udp-interface)
* [av-mavlink-configuration](https://gitlab.com/airvolute_oss/dronecore.os/av-mavlink-configuration)
* [mavlink-nextvision-adapter](https://gitlab.com/airvolute_oss/dronecore.os/mavlink-nextvision-adapter)
* [nv-gimbal-example](https://gitlab.com/airvolute_oss/dronecore.os/nv-gimbal-example)

### Unified package structure

Each of aforementioned packages have similar structure, let's take a look at an example from `av-stribog-cam` :

<figure><img src="/files/m5ybnRmz219Cj8LYp5mk" alt=""><figcaption></figcaption></figure>

This way, it is easier to orient in all of packages.

* **Docs**: it is self explanatory, but each package has a simple auto-generated GitLab wiki page ([example](https://airvolute_oss.gitlab.io/dronecore.os/av-stribog-cam/)).
* **Include:** header files.
* **Resources:** this one is quite important. You can find key config files for the packages.
* **Src:** source files.

### Stribog filesystem structure

The structure is easy. You can find `release` folder in Stribog `home` folder. The name of the folder depends on the version you have. Let's assume that it's called `av-release_stribog_open_source_2024-10-03_2` . The structure of the release folder if as follows:

```
/av-release_stribog_open_source_2024-10-03_2/
├─ install.sh
├─ pairing_files/
├─ src/
│  ├─ av-mavlink-configuration/
│  ├─ av-stream-selector/
│  ├─ av-stribog-cam/
│  ├─ . . ./
```

* install.sh -> installs all the packages and dependencies. This is there just for clarification. Stribogs come with already all things pre-installed.
* pairing\_files -> applications that are needed to do the pairing procedure.
* src -> Source files even with build folders. This folder contains all projects form DroneCore.OS.

## av-stream-selector

Stribog UAVs have multiple camera systems installed. For the users to be able to display these streams remotely, we provide `av-stream-selector` package. The package has two executables:

* av\_stream\_selector
* av\_stream\_selector\_no\_gst

`av_stream_selector` binary uses [input-selector](https://gstreamer.freedesktop.org/documentation/coreelements/input-selector.html?gi-language=c) gstreamer element to select from multiple video sources and the outputs it to one selected gstreamer sink.

On the other hand `av_stream_selector_no_gst` leverages only the Mavlink protocol to just share information about all streams inside the UAV via the Mavlink protocol. This is typically used with GCS application. For example QGC automatically detects these Mavlink messages and creates a new menu where streams can be selected.

<figure><img src="/files/mm2SWLmEkF8ZV3Eoirja" alt=""><figcaption></figcaption></figure>

### av\_stream\_selector configuration (gst version)

To use av\_stream\_selector with our package `av-stribog-cam` that launches camera streams, some configuration needs to be done in both `av-stream-selector` and `av-stribog-cam` packages. Since we are now talking about Gstreamer version, **all streams need to be published on localhost address** - edit [av-stribog-cam config files](https://gitlab.com/airvolute_oss/dronecore.os/av-stribog-cam/-/tree/main/resources?ref_type=heads) accordingly. Look at the example for NextVision tc358743 camera chip:

```
tc358743:
  enabled: true
  name: tc358743-nextvision
  device: /dev/av-tc358743-camera-csib
  width: 1280
  height: 720
  fps-n: 50
  fps-d: 1
  format: UYVY
  enc-type: 0  # [0 - HW, 1 - SW]
  udp-host: 127.0.0.1
  udp-port: 8020
```

For the simplification, let's assume we have OV9281 stream on port 8000. Then we can also take a look at av-stream-selector config:

```
av-stream-selector:
  input-streams:
    - name: tc358743
      ip-address: 127.0.0.1
      port: 8020

    - name: ov9281
      ip-address: 127.0.0.1
      port: 8000

  output-stream:
    name: stream_output
    ip-address: 192.168.55.100 # IP of GCS
    port: 8560
  

  mavlink-udp-comm:
    target-ip: "127.0.0.1"
    target-port: 14730
    component-id: 100
```

Be aware, that at this time, GCS IP is `192.168.55.100` - this is the case if you are connected via the DEV usb to you computer. av-stream-selector then reacts to [MAV\_CMD\_VIDEO\_START\_STREAMING](https://mavlink.io/en/messages/common.html#MAV_CMD_VIDEO_START_STREAMING) message and "switches" the stream according to it.

### av\_stream\_selector\_no\_gst configuration (non-gst version)

The main difference is in `av-stribog-cam` config. Because now we do not publish one outputting stream to the GCS. Instead we publish all streams there and we let GCS to choose from them. So we need to define IP's in each camera config, again we use NextVision config as an example:

```
tc358743:
  enabled: true
  name: tc358743-nextvision
  device: /dev/av-tc358743-camera-csib
  width: 1280
  height: 720
  fps-n: 50
  fps-d: 1
  format: UYVY
  enc-type: 0  # [0 - HW, 1 - SW]
  udp-host: 192.168.55.100 # IP of GCS
  udp-port: 8020
```

We should alter this in each camera config that we want to use. Then av-stream-selector config should be changed accordingly. *Note: we do not define `output-stream` element now.*

```
av-stream-selector:
  input-streams:
    - name: tc358743
      ip-address: 192.168.55.100
      port: 8020

    - name: ov9281
      ip-address: 192.168.55.100
      port: 8000
  

  mavlink-udp-comm:
    target-ip: "127.0.0.1"
    target-port: 14730
    component-id: 100
```

## av-stribog-cam

This package serves as a starting point when working with cameras. You can take a look at the code and add pipeline elements to your liking. Other than that, you can of course use the package as is. **But be aware of its limitations - stream is not very optimized, so it is not suitable to be transmitted through proprietary radios (Doodle/Silvus/Microhard etc.). It runs nice via DEV USB.** In case of optimization you need to add some parameters and elements to existing pipelines.

If you want to use the package as is, you can take a look at the [resource config files](https://gitlab.com/airvolute_oss/dronecore.os/av-stribog-cam/-/tree/main/resources?ref_type=heads), which are self explanatory and you can adjust them as you wish.

## mavlink-udp-comm-template

This package serves as a sample for developers when working with our mavlink-udp-interface lib, which is described lower at this page.

## mavlink-udp-interface

The package is simple C++ interface for Mavlink communication. It is programmed that it is efficient and modern in terms of C++ standards. This is something that was not provided by Mavlink ecosystem, so we decided to code it for you. It works best when used together with [`mavlink-router`](https://github.com/mavlink-router/mavlink-router) .

## av-mavlink-configuration

This one is used to set correct message rates as we use it in Stribog. Of course you are more than welcome to adjust it to your needs. You just edit the [resource file, which can be seen here](https://gitlab.com/airvolute_oss/dronecore.os/av-mavlink-configuration/-/blob/main/resources/config.yml?ref_type=heads).

## mavlink-nextvision-adpater

As a part of Stribog (Airvolute) ecosystem, we provide NextVision interface to Mavlink too. This feature is not included with NextVision gimbals/cameras so we add it. When Stribogs are bought together with NextVision systems, you get the license for our nextvision library for free. Mavlink-nextvision-adapter will then work flawlessly. You can also take a look at it and use it as a template when working with Airvolute's nextvision library.

## nv-gimbal-example

Only purpose of this is to show capabilities of Airvolute's NextVision library. User can control gimbal with keyboard arrows.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.airvolute.com/uas-platforms/discovery-stribog/dronecore.os-on-stribog.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
