Test Apps

The Dronecode Camera Manager (DCM) test apps (/test) provide a simple mechanism to test/validate different DCM functionality.

Build the Test Apps

Enter the following command from the DCM root directory to build the test apps:

make test

The tests are then run as described in the following sections.

Test Stream Discovery (test-rtsp-udp-stream-discovery)

This test validates RTSP and UDP stream discovery. It outputs all RTSP streams being published by Avahi.

To run this test app:

  1. Start the DCM for your platform:

    ./dcm -c samples/config/ubuntu.conf
    

    Use the DCM Configuration File for your platform (above we use the Ubuntu configuration).

  2. In a separate terminal (or on another computer connected to the target drone on the same network) run the test app:

    ./test/test-rtsp-udp-stream-discovery
    

The program will output all published DCM streams. Below we show example output for a system with a single camera attached:

Service resolved: '/video0' (rtsp://10.0.2.15:8554/video0)
TXT: ["name=VirtualBox Webcam - Integrated " "frame_size[0]=MJPG(640x480,160x120,320x180,320x240,424x240,640x360,848x480,960x540,1280x720,1920x1080)"]

This is an interactive test of MAVLink stream publishing. The available streams are listed and the selected stream, with the selected resolution, is played.

To run this app:

  1. Start the DCM for your platform:
    ./dcm -c samples/config/ubuntu.conf
    

    Use the DCM Configuration File for your platform (above we use the Ubuntu configuration).

  2. In a separate terminal (or on another computer connected to the target drone on the same network) run the test app:
    ./test/test-mavlink-protocol
    

The output will be similar to:

Open UDP [5]
Bind UDP [5] 0.0.0.0:14550
Dronecode Camera Manager found: sysid: 1

Streams found:
1 - Integrated_Webcam_HD

    Please make your selection (type stream number):
1
Select Horizontal resolution (0 for default): 
0
Select Vertical resolution (0 for default): 
0
Stream Information:
   Status: not streaming
   Resolution: 1280x720
   URI: rtsp://192.168.8.1:8554//video0

And if gstreamer client gst-launch-1.0 is installed, the selected video will be played.

Test Custom Streams (test-custom-stream)

This test app demonstrates how to extend DCM by adding extra streams. This app exports all streams exported by DCM and one extra stream with a dummy video generated by the videotestsrc gstreamer plugin.

The test source code accompanies the guide material in: Extend DCM > Camera Sample Custom.

To test it:

  1. Run the example using configuration for your platform:

    ./test/test-custom-stream -c samples/config/ubuntu.conf
    

    Use the DCM Configuration File for your platform (above we use the Ubuntu configuration).

  2. Watch the video identified by /custom using vlc, for example:

    vlc rtsp://192.168.1.1:8554/custom
    
  3. (Optional) Use the -h argument to list the test app's other command line options:
    ./test/test-custom-stream -h
    

Unit Tests

Test Camera Parameters (test-camera-parameters)

This is a unit test for the camera parameters class. It verifies the storage and retrieval of different data types (stored as string) from map DS works well.

To run this app:

  1. Start the DCM for your platform:
    ./dcm -c samples/config/ubuntu.conf
    

    Use the DCM Configuration File for your platform (above we use the Ubuntu configuration).

  2. In a separate terminal (or on another computer connected to the target drone on the same network) run the test app:

    ./test/test-camera-parameters
    

    The output will be similar to:

    0:  EXIT
    1:  Test Set-Get
    2:  Set Param
    3:  Get Param
    99: Test uint32<->string conversion
    Please enter selection or enter 0 to exit
    
  3. Enter a selection. Depending on the selection you'll be prompted for a parameter ID string, type and/or value. Use these to test the round-trip behaviour for setting parameters.
© Dronecode 2017. License: CC BY 4.0            Updated: 2018-11-20 02:48:35

results matching ""

    No results matching ""