LogoLogo
  • Welcome
  • Vehicle Operation
    • Getting started
    • Auterion Suite
      • Dashboard
      • Fleet Management
        • Vehicles
          • Cloud Features
          • Groups
        • Flights
        • Compliance
      • Manufacturer
        • Service Bulletins
      • Administration
      • User Management
      • Simulations
    • Auterion Mission Control
      • Installation
      • First steps
      • UI Breakdown
        • Navigating between the views
        • Fly View
          • Fly View UI Overview
          • Vehicle status indicator
          • Flight mode selector
          • Quick actions sidebar
          • Connection manager
          • Vehicle Dashboard
          • Flight Map
          • Camera View
          • Monitoring the Flight
          • Flying Manually (RC/Joystick)
          • Flying a Mission
        • Plan View
          • Plan UI Overview
          • Plan tools
            • Mission Menu
            • Waypoint Missions
            • Survey Patterns
              • Area Survey
              • Corridor Scan
          • Mission Summary
          • Mission Editor Tab
            • Start Section
            • Mission Section
            • End Section
            • Extras
          • Terrain visualization
          • GeoFence
          • Rally Points
        • Quick Vehicle Menu
          • Pre-Flight Checklist
          • Connectivity
        • Photo Gallery
        • Settings
        • Pilot Login
      • Useful resources
        • Mission Planning
          • Mission Cloud Sync
          • Terrain Following
          • Import Geo-Awareness data or KML overlays
        • Maps and Custom Overlays
          • Using Offline Maps
          • Importing GeoPDF overlays
        • Track GCS as Smart Asset in Suite
        • Live PX4 Log Streaming
        • Monitor Local Flights with ADS-B
        • GPS Denied Workflow
        • Windows Crash Logs Analysis
        • Screen Recordings
    • Remote Controllers
      • Skynav Remote Controller
        • Installing Mission Control
        • Joystick and Button Mapping
        • Using LTE for Online Maps in the Field
        • Advanced Radio Settings
        • Drop Guards and Chest Strap
        • Unit Serial Number
    • Settings & Maintenance
      • Vehicle Setup
      • WiFi Setup
      • Compass Calibration
      • Safety Setup
      • Joystick Setup
      • Vehicle Web UI
      • Software Update
      • Remote ID
        • How Remote ID works
        • Remote ID indicators in AMC
        • Frequently Asked Questions
    • Precise Flight
  • App development
    • Getting Started
      • Development environment Setup
      • Connecting to a device
      • Application Development
    • App Framework
      • Building your First App
      • Apps API
      • Sensor Data
      • Video Streams
      • Photos
      • Hardware Peripherals
      • Persistent Storage
      • MAVLink
      • Native Docker Compose
      • App Parameters
      • Log App Data to Auterion Suite
        • How to log Time Series Data
        • How to log basic Text Output
      • How to store an App's Binary Data on Skynode
      • User Web Interfaces
      • Build Arguments
      • Debugging apps with SSH
      • Debugging Apps with gdb
      • PX4 Messages in ROS 2
      • DDS / ROS2 Configuration
      • Structuring Applications with Multiple Services
    • Auterion SDK
      • Installation
      • Write Your First App
      • SDK API
      • Flight Mode API
        • Flight Mode API
        • Dynamics in Body Frame
        • Dynamics in Local Frame
        • Go-To in Local Frame
      • System State API
      • Peripheral Actuator Control API
      • Camera API
      • Navigation Input API
        • Global Navigation
        • Local Navigation
      • Visual Tracking API
    • Simulation
      • Virtual Skynode
        • Simulation-Gazebo Reference
        • Simulation-AirSim Reference
        • Connecting from other Computers
        • Resetting Virtual Skynode
        • Multiple Virtual Skynodes on single machine
      • Physical Skynode
    • Resources
      • Cross Compilation - Faster Builds
      • Auterion CLI Reference
      • Troubleshooting
      • App Tutorial
      • Skynode Vision Kit S
        • Set up the Vision Kit
        • Install and test a simple vision app
    • Legacy app workflow
      • App Development
      • MAVLink
      • Using the App Template
      • Example Applications
        • Autopilot Telemetry (C++)
        • Autopilot Telemetry (Python)
        • Photo Gallery
  • Hardware Integration
    • Getting started
      • Required Sensors
      • Wiring Skynode to the Vehicle
      • Actuators Setup
      • Sensors Setup
        • Set Orientations
        • Compass Calibration
        • Gyroscope calibration
        • Accelerometer calibration
        • Level horizon calibration
        • Airspeed calibration
      • Bench Test
      • Tuning
      • Creating Airframe Configurations for APX4
    • Skynode
      • Skynode X
      • Skynode ENT/GOV
      • Skynode X Integration and Development Kit
        • Get Skynode ready
        • Power Skynode
        • Register Skynode
        • Connect Skynode to AMC
        • Sensors and Peripherals
        • Next steps
      • Payloads
        • Generic USB Webcams (UVC)
        • Workswell Wiris Pro
        • Trillium HD40-LV
        • NextVision Gimbals (with TRIP2)
        • Sony Alpha a7R IV
        • Phase One iXM-100
        • Gremsy Gimbals
      • Connectivity
        • USB-C Network Connection
        • WiFi
        • LTE Setup
        • SIYI MK15
        • Microhard Data Link
        • Data Link Wiring
        • Silvus Data Link
        • Doodle Labs Data Link
        • Custom Data Link
        • Ethernet Interface Configuration
      • Skynode LED Meanings
      • Troubleshooting
      • Legacy DSM/DSMX Support
      • Peripherals
        • Power Module
        • 12S Power Module
        • Pixhawk Adapter Board
        • Pixhawk Payload Bus
        • Data Link Module
        • PX4 F9P GPS
        • Freefly RTK GPS
        • Airspeed Sensor
        • LIDAR
        • USB camera
        • See3CAM_24CUG
    • Skynode S
      • Datasheet
      • Interfaces
      • Basic Vehicle Integration
      • Add LTE to Skynode S
      • Skynode S LED status indicator
      • Skynode S flight logs
    • AI Node
      • Datasheet
      • Evaluation Kit
        • Power AI Node
        • Wiring AI Node to Skynode
        • Internet sharing with Skynode
        • Activate AI Node on Suite
      • Dimensions and CAD model
      • Interfaces
      • Connectivity
        • USB Network Connection
        • Serial Debug Connection
        • AI Node as Network Bridge
        • Standalone Internet Access
      • Updating AuterionOS
    • Advanced Airframe Integration
      • Custom power setup
      • Wiring without Breakout Boards
      • Gripper Integration
        • Setting up Payload Delivery with Gripper
      • ESC Calibration
      • Camera Calibration
        • Camera Calibration on a Computer
        • Camera Calibration on Skynode
      • Serial Port Configuration
    • Flight controller customization
      • AMC's Advanced Mode
      • Flight Controller Shell
      • Micro XRCE-DDS
    • AuterionOS Customization
      • OEM Tools Installation
      • Adding SSH keys
      • Changing the Root Password
      • Modifying Environment Variables
      • Pre-install Applications
      • Suite Manufacturer Tools
    • AuterionOS System Guide
      • Introduction
      • Flashing PX4 Binary and Vehicle Config
      • Building and Flashing PX4 Firmware
      • SSH Access
      • Filesystem and partitions
      • Environment Variables Reference
      • Types of AuterionOS Images
      • Mavlink Routing and Endpoints
      • Packaging AuterionOS Image
    • Additional Resources
      • Remote ID
        • How Remote ID works
        • Vehicle Serial Number
        • Communication Diagram
        • Remote ID configuration
        • How Auterion tested
      • Auto-Tuning
  • Release Notes
    • APX4
      • APX4 3.2
        • APX4 3.2.10
        • APX4 3.2.1
      • APX4 3.1
        • APX4 3.1.1
        • APX4 3.1.0
      • APX4 3.0
        • APX4 3.0.8
        • APX4 3.0.5
      • APX4 2.7
        • APX4 2.7.37
        • APX4 2.7.25
        • APX4 2.7.20
        • APX4 2.7.12
        • APX4 2.7.7
        • APX4 2.7.6
      • APX4 2.6
        • APX4 2.6.1
      • APX4 2.5
        • APX4 2.5.14
        • APX4 2.5.13
        • APX4 2.5.8
        • APX4 2.5.7
        • APX4 2.5.5
        • APX4 2.5.4
        • APX4 2.5.0
      • APX4 2.4
        • APX4 2.4.2
        • APX4 2.4.1
      • APX4 2.3
        • APX4 2.3.0
      • APX4 2.2
        • APX4 2.2.2
        • APX4 2.2.0
      • APX4 2.1
        • APX4 2.1.1
        • APX4 2.1.0
      • APX4 2.0
        • APX4 2.0.2
        • APX4 2.0.0
    • AuterionOS
      • AOS for AI Node
        • AI Node AOS 1.1.0
        • AI Node AOS 1.0.2
        • AI Node AOS 1.0.0
        • AI Node AOS 0.7.0
        • AI Node AOS 0.6.1
        • AI Node AOS 0.6.0
        • AI Node AOS 0.5.0
        • AI Node AOS 0.4.0
      • AOS for Skynode
        • AOS 3.7
          • AOS 3.7.25
          • AOS 3.7.9
        • AOS 3.6
          • AOS 3.6.14
        • AOS 3.5
          • AOS 3.5.13
        • AOS 3.3
          • AOS 3.3.9
        • AOS 3.2
          • AOS 3.2.9
        • AOS 2.19
          • AOS 2.19.14
        • AOS 2.15
          • AOS 2.15.10
          • AOS 2.15.7
        • AOS 2.12
          • AOS 2.12.8
        • AOS 2.10
          • AOS 2.10.2
        • AOS 2.8
          • AOS 2.8.1
        • AOS 2.7
          • AOS 2.7.15
        • AOS 2.6
          • AOS 2.6.1
        • AOS 2.5
          • AOS 2.5.14
          • AOS 2.5.13
          • AOS 2.5.8
          • AOS 2.5.7
          • AOS 2.5.5
          • AOS 2.5.4
          • AOS 2.5.0
        • AOS 2.4
          • AOS 2.4.1
        • AOS 2.3
          • AOS 2.3.0
        • AOS 2.2
          • AOS 2.2.2
          • AOS 2.2.0
        • AOS 2.1
          • AOS 2.1.1
          • AOS 2.1.0
        • AOS 2.0
          • AOS 2.0.2
          • AOS 2.0.0
    • Auterion Mission Control
      • AMC 1.34
        • AMC 1.34.21
        • AMC 1.34.14
      • AMC 1.33
        • AMC 1.33.13
      • AMC 1.32
        • AMC 1.32.7
      • AMC 1.30
        • AMC 1.30.17
      • AMC 1.29
        • AMC 1.29.7
      • AMC 1.26
        • AMC 1.26.8
      • AMC 1.22
        • AMC 1.22.3
      • AMC 1.19
        • AMC 1.19.5
      • AMC 1.18
        • AMC 1.18.3-1
        • AMC 1.18.3
      • AMC 1.17
        • AMC 1.17.10
        • AMC 1.17.9
      • AMC 1.15
        • AMC 1.15.0
      • AMC 1.14
        • AMC 1.14.6
        • AMC 1.14.0
      • AMC 1.13
      • AMC 1.12
      • AMC 1.11
      • AMC 1.10
        • AMC 1.10.1
        • AMC 1.10.0
      • AMC 1.9
        • AMC 1.9.1
        • AMC 1.9.0
      • AMC 1.8
    • Hardware
      • Skynode Rev 11 (Jan 2022)
Powered by GitBook
On this page
  • Tracking Interface API Documentation
  • Subscribing to Tracking Requests
  • Subscribing to Camera Data
  • Publishing Tracking Updates
  • Publishing Annotated Images
  • Publishing Zoomed-In Images
  • Rendering the Tracking Result on the Ground Station
  1. App development
  2. Auterion SDK

Visual Tracking API

The Visual Tracking API is used as an intermediary between Auterion Mission Control and a computer vision app that is running the tracking logic on the video stream and producing a tracking result

PreviousLocal NavigationNextSimulation

Last updated 10 months ago

Related C++ Header in the Auterion SDK: <auterion_sdk/tracking/tracking_interface.hpp>

The Auterion SDK offers a programming interface for subscribing to incoming tracking requests issued by the user and camera images. In return it facilitates sending out tracking updates in the form of "tracking results" and optionally modified camera frames which can be used to draw annotations into the video feed displayed to the user. The Tracking Interface does not provide a tracking algorithm itself.

Inputs of the Tracking Interface:

  • Live camera feed as a series of images

  • User actions in Auterion Mission Control, such as the "track" action with pixel coordinates

Outputs of the Tracking Interface:

  • Tracking result, which includes the center coordinates as well as a bounding box of the tracked object

  • Image frames that are visualized in Auterion Mission Control. These frames may be altered by the app performing the tracking to visualize certain results or draw an information overlay.

Tracking Interface API Documentation

To instantiate the Tracking Interface in Auterion SDK use the following C++ class:

auterion::TrackingInterface tracking_interface(sdk);

The constructor of TrackingInterface requires an instance of the Auterion SDK as an argument.

The screenshot above illustrates a simulated multicopter actively tracking a tree in a virtual 3D environment. The Tracking Interface is used inside of an AuterionOS app (see App Framework) on the simulated drone; the Tracking Interface enables the app to receive tracking requests from AMC, e.g. object selection using the blue "Track" tool in the sidebar on the left, and images from the camera. The app uses the interface to provide a visual feedback to AMC, including the location of the tracked object in the frame (green crosshair and rectangle).

Subscribing to Tracking Requests

The TrackingInterface provides several subscription methods to register callbacks for the following tracking requests:

  • subscribeTrackingSelection(callback): Register a callback function that will be called with the selection structure which has the following member variables:

    • cv::Point2d normalized_point : Normalized coordinates of the tracking selection center in the displayed region (in [0,1]).

    • cv::Size2d normalized_window_size : Normalized size of the tracking selection window in the displayed region (in [0,1]).

    • std::optional<rclcpp::Time> timestamp : Timestamp of the tracking selection.

  • subscribeTrackingZoomChange(callback): Register a callback function that will be called with the change of zoom level.

  • subscribeTrackingOff(callback): Register a callback function that will be called when tracking is disabled.

The expected callback signatures for the subscription methods are illustrated here:

Tracking Request: Tracking Selection

tracking_interface.subscribeTrackingSelection([this](const auterion::TrackingSelection &selection) {
    std::cout << "Tracking Selection: normalized center(" << selection.normalized_point.x << ", " << selection.normalized_point.y << "), Size(" 
              << selection.normalized_window_size.width << "x" << selection.normalized_window_size.height << ")" << std::endl;
});

Tracking Request: Zoom Change Events

tracking_interface.subscribeTrackingZoomChange([this](const int change) {
    std::cout << "Zoom level changed by: " << change << std::endl;
});

Tracking Request: Tracking Off Events

tracking_interface.subscribeTrackingOff([this]() {
    std::cout << "Tracking has been turned off." << std::endl;
});

Subscribing to Camera Data

Similarly, one can register callbacks to incoming camera images and camera information containing calibration data.

Camera Images

tracking_interface.subscribeImage([this](const auterion::Image& image_in) {
    const cv::Mat image_cv = image_in.asOpenCVMat();
    std::cout << "Received image with dimensions: " << image_cv.cols << "x" << image_cv.rows << std::endl;
});

Camera Information

tracking_interface.subscribeCameraInfo([this](const sensor_msgs::msg::CameraInfo::SharedPtr& camera_info) {
    std::cout << "Width: " << camera_info->width
              << ", Height: " << camera_info->height << std::endl;
    std::cout << "Camera Matrix (K): [" 
              << camera_info->k[0] << ", " << camera_info->k[1] << ", ...]" << std::endl;
    if (!camera_info->d.empty()) {
            std::cout << "Distortion Coefficients: [" 
                      << camera_info->d[0] << ", " << camera_info->d[1] << ", ...]" << std::endl;
    } 
});

Publishing Tracking Updates

Once you are subscribed to an image stream and receive a tracking request, you can send the result of your tracking algorithm for every new image by populating a TrackingResult struct:

cv::Point object_center(320, 240);    // Center of object pixels coords
cv::Size object_size(50, 50);         // Size of object bounding box in pixels
float confidence = 0.85f;             // Tracking confidence

auterion::TrackingResult result(object_center, object_size, confidence);

Then send an update containing your tracking result via the Tracking Interface:

tracking_interface.updateResult(result);

This will make the tracking result available to other apps.

Publishing Annotated Images

To publish annotated images, such as those containing the location of the tracked object within the frame, and share them with a ground control station, one can do the following:

// Retrieve incoming image encoding
auterion::ImageHeader::Encoding encoding = image_in.header().encoding;

// Convert to cv::Mat for drawing
const cv::Mat image_cv = image_in.asOpenCVMat();
cv::Mat image_out = image_cv.clone();
... // optionally draw onto image_out

// Publish annotated image
tracking_interface.updateImage(image_out, encoding);

Whether annotating the image or not, the vision tracking app should call updateImage as otherwise the ground station application won't receive image frames and the user will not be able to see a video stream.

Publishing Zoomed-In Images

In some cases, it may be useful to publish a zoomed-in or cropped version of the original image. To do this one must simply provide information about which region of the original image is displayed in the zoomed image as shown below:

// Define upper-left image quadrant
cv::Rect displayed_region(0, 0, image_cv.cols / 2, image_cv.rows / 2);

// Crop the image
cv::Mat cropped_image = image_cv(displayed_region);

// Resize the cropped image back to the original image size
cv::Mat image_out;
cv::resize(cropped_image, image_out, image_cv.size());

// Update using zoomed image
_tracking_interface.updateImage(image_out, encoding, displayed_region);

The output image given to updateImage should have consistent dimensions across consecutive frames. If the original image is cropped, it must be resized to match the original image dimensions.

Rendering the Tracking Result on the Ground Station

One can additionally provide the tracking result to updateImage to allow the result to be rendered by the ground station:

// Update using zoomed image, and share the tracking result with the GCS
_tracking_interface.updateImage(image_out, encoding, displayed_region, result);

The displayed_region argument is optional and can be set to std::nullopt if the displayed region corresponds to the full image.

If using Auterion Mission Control, sending the tracking result this way will directly display the bounding box of the tracked result in the video feed, as illustrated in the image below.

Object Tracking viewed with Auterion Mission Control (AMC)
An illustration of the relationship between the displayed region of the original image and the output image.
The video stream in Auterion Mission Control, with the tracking result rendered by the ground station.