Skip to content

Usage of Solex CC to create custom controls

mtbsteve edited this page Feb 23, 2020 · 4 revisions

Introduction

Within the original Redtail project, it was required to carry a laptop with a remote connection to the TX2 to start, stop and to control the ROS nodes. With Solex Google Play store and its extension framework Solex-CC it is easily possible to build the required extensions and menus to control the ROS nodes and to launch the drone so that a laptop is (almost) no longer required. Note that Solex needs to be purchased from the Google Play store.

This repository includes the workers for the start menu, the ZED camera control and to launch the drone with the px4 controller via MAVROS.

To install, copy the workers into the Solex-CC workers directory and follow the instructions of Solex-CC to deploy them.

Start Menu Worker

This worker allows to launch and shutdown of:

  • stereo_dnn_ros ap_zed_resnet18_2D_fp16 DNN (includes the zed_wrapper and the ros_rtsp streaming server)
  • caffe_ros ap_zed_ros_trailnet DNN (includes the zed wrapper and ros_rtsp streaming server)
  • darknet-yolo DNN (requires that either the stereo_dnn or caffe_ros node has been initiated before)
  • MAVROS

In addition, you can directly shutdown the TX2.

Start menu

Camera Worker

Camera controls are displayed on th flight screen. You can:

  • start/stop video recording
  • take a picture

Note that it is possible to take a picture during video recording in parallel.

image

With the image node selector, you can choose between:

  • The rectified video image
  • Depth confidence map
  • YOLO object detection and
  • a Full 4 frame view of video, yolo, depth map and a color-code stereo depth map.

For the full 4 frame view the stereoDNN node must be up and running.

image

Launch Drone Worker

On the bottom of the flight screen you will find a red "Launch Drone on Trailnet" button. By pressing this button, the px4 controller ROS node will be launched, the results of trailnet DNN analyzed, and the corrresponding autonomous steering actions transmitted via MAVROS to the flight controller.

Pressing the button again will cancel that node, the drone will return to AltHold mode and control is given back to RC.

Video Worker

With this worker, you can switch between the available ROS image topics and select the video stream to be displayed in Solex. You may define a RSP video stream by adding a RTSP video node in the file $CATKIN_WS/src/ros_rtsp/config/stream_setup.yaml. Please see the documentation inside the .yaml file on how to set it up. You can select almost all rtsp_image topics listed under rostopic list. Then add the defined nodes into the worker.js file like:

......
function getFeatures() {
    d("getFeatures()");
    
    // Return a single feature, or multiple
    return {
        video: { 
            supported: true,
            endpoints: [
                {
                    name: "ZED-Video ROS node", 
                    type: "rtsp",
                    url: "rtsp://10.0.1.128:8554/zedimage" // include your node here
                },
                {
                    name: "ZED-YOLO ROS node", 
                    type: "rtsp",
                    url: "rtsp://10.0.1.128:8554/zedyolo"
                }
            ]
        }
    };
}
.........

The result in Solex should then look like: Image

Joystick

With Solex-CC, its also possible to use a joystick or gamepad, such as the Logitech 710, as input device and to send the inputs to the ROS /joy node and use it as input for the trailnet DNN. Connect the joystick to the USB port, ensure that the joystick worker is loaded in SolexCC. To test, run roscore & followed by rostopic echo /joy on the TX2. When you move the sticks, you should see an output like:

header: 
  seq: 877
  stamp: 
    secs: 1906559565
    nsecs:         1
  frame_id: ''
axes: [-0.38823527097702026, -0.14509797096252441, 0.0, 0.0, 0.0, 0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]