• Stars
    star
    443
  • Rank 98,504 (Top 2 %)
  • Language
    C++
  • Created about 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Official ROS packages for DJI onboard SDK.

DJI Onboard SDK ROS 4.1.0

Latest Update

OSDK-ROS 4.1.0 was released on 20 January 2021.You need to read newest update below to get update information. Please see the release notes and ROS sample setup for more information.And We will update ROS Wiki later.

1. feature

This 4.1.0 version releases a feature package: dji_osdk_ros. The package contains two different framework's interface. OSDK-ROS-obsoleted kept ros3.8.1's interface.
(note:We will cancel support for the OSDK-ROS-obsoleted's interface in the next version.)

OSDK-ROS4.1.0 interface OSDK-ROS-obsoleted interface
files below in dji_osdk_ros folder files below in dji_osdk_ros_obsoleted folder

This update mainly includes:

  1. Battery information interface and sample;

  2. hms interface and sample;

  3. update flight-control interface and sample: include:

    set_joystick_mode
    joystick_action
    get/set_go_home_altitude
    set_home_point
    rename 'set_current_point_as_home' to 'set_current_aircraft_point_as_home'
    rename 'enable_avoid' to 'set_horizon_avoid_enable'
    rename 'enable_upwards_avoid' to 'set_upwards_avoid_enable'
    get_acoid_enable_status
    kill_switch
    emergency_brake
    update flight_task_control,include:
    a.add velocity and yaw rate control action
    b.add turn on/off motor action
    c.add force landing and confirm landing action
    d.add cancel landing and cancel go home action

  4. fixed telemetry_node problem:displayMode and rcConnection is zero.

  5. we also kept all services and topics of osdk-ros 3.8.1. If you want to use these interfaces,you need to run dji_sdk_node and use it's services and topics.
    (note: These interfaces are not fully compatible with onboard-sdk4.0.1.And they will not be supported in next osdk-ros version.)

nodes services's name topics's name
dji_vehicle_node get_drone_type
flight_control_node flight_task_control
set_go_home_altitude
get_go_home_altitude
set_current_aircraft_point_as_home
set_horizon_avoid_enable
set_upwards_avoid_enable
set_local_pos_reference
joystick_action
set_joystick_mode
set_home_point
get_avoid_enable_status
obtain_release_control_authority
kill_switch
emergency_brake
gimbal_camera_control_node gimbal_task_control
camera_task_set_EV
camera_task_set_shutter_speed
camera_task_set_aperture
camera_task_set_ISO
camera_task_set_focus_point
camera_task_tap_zoom_point
camera_task_set_zoom_para
camera_task_zoom_ctrl
camera_start_shoot_single_photo
camera_start_shoot_aeb_photo
camera_start_shoot_burst_photo
camera_start_shoot_interval_photo
camera_stop_shoot_photo
camera_record_video_action
telemetry_node dji_osdk_ros/attitude
dji_osdk_ros/battery_state
dji_osdk_ros/imu
dji_osdk_ros/flight_status
dji_osdk_ros/gps_health
dji_osdk_ros/gps_position
dji_osdk_ros/vo_position
dji_osdk_ros/height_above_takeoff
dji_osdk_ros/velocity
dji_osdk_ros/from_mobile_data
dji_osdk_ros/from_payload_data
dji_osdk_ros/gimbal_angle
dji_osdk_ros/rc
dji_osdk_ros/local_position
dji_osdk_ros/local_frame_ref
dji_osdk_ros/time_sync_nmea_msg
dji_osdk_ros/time_sync_gps_utc
dji_osdk_ros/time_sync_fc_time_utc
dji_osdk_ros/time_sync_pps_source
dji_osdk_ros/main_camera_images
dji_osdk_ros/fpv_camera_images
dji_osdk_ros/camera_h264_stream
dji_osdk_ros/stereo_240p_front_left_images
dji_osdk_ros/stereo_240p_front_right_images
dji_osdk_ros/stereo_240p_down_front_images
dji_osdk_ros/stereo_240p_down_back_images
dji_osdk_ros/stereo_240p_front_depth_images
dji_osdk_ros/stereo_vga_front_left_images
dji_osdk_ros/stereo_vga_front_right_images
time_sync_node dji_osdk_ros/time_sync_nmea_msg
dji_osdk_ros/time_sync_gps_utc
dji_osdk_ros/time_sync_fc_time_utc
dji_osdk_ros/time_sync_pps_source
mission_node dji_osdk_ros/mission_waypoint_upload
dji_osdk_ros/mission_waypoint_action
dji_osdk_ros/mission_waypoint_getInfo
dji_osdk_ros/mission_waypoint_getSpeed
dji_osdk_ros/mission_waypoint_setSpeed
dji_osdk_ros/mission_hotpoint_upload
dji_osdk_ros/mission_hotpoint_action
dji_osdk_ros/mission_hotpoint_getInfo
dji_osdk_ros/mission_hotpoint_updateYawRate
dji_osdk_ros/mission_hotpoint_resetYaw
dji_osdk_ros/mission_hotpoint_updateRadius
dji_osdk_ros/mission_status
camera_stream_node setup_camera_stream
camera_h264_node setup_camera_h264
stereo_vision_depth_perception_node get_m300_stereo_params
stereo_240p_subscription
stereo_depth_subscription
stereo_vga_subscription
mobile_device_node send_data_to_mobile_device
payload_device_node send_data_to_payload_device_server
waypointV2_node dji_osdk_ros/waypointV2_initSetting
dji_osdk_ros/waypointV2_uploadMission
dji_osdk_ros/waypointV2_downloadMission
dji_osdk_ros/waypointV2_uploadAction
dji_osdk_ros/waypointV2_startMission
dji_osdk_ros/waypointV2_stopMission
dji_osdk_ros/waypointV2_pauseMission
dji_osdk_ros/waypointV2_resumeMission
dji_osdk_ros/waypointV2_generateActions
dji_osdk_ros/waypointV2_setGlobalCruisespeed
dji_osdk_ros/waypointV2_getGlobalCruisespeed
dji_osdk_ros/waypointV2_subscribeMissionEvent dji_osdk_ros/waypointV2_mission_event
dji_osdk_ros/waypointV2_subscribeMissionState dji_osdk_ros/swaypointV2_mission_state
battery_node get_whole_battery_info
get_single_battery_dynamic_info
hms_node get_hms_data

2. Prerequisites

The system environment we have tested is in the table below.

system version ubuntu 16.04
processor architecture x86(mainfold2-c),armv8(mainfold2-g)

Firmware Compatibility

OSDK-ROS 4.1.0's firmware compatibility depends on onboard-sdk 4.1.0's. you can get more information here;

Ros

you need to install ros first.Install instruction can be found at: http://wiki.ros.org/ROS/Installation. We just tested ROS kinetic version.

C++11 Compiler

We compile with C + + 11 Standard.

onboard-sdk

you need to download onboard-sdk4.1.0,and install it.

$mkdir build
$cd build
$cmake..
$sudo make -j7 install

nema-comms

$sudo apt install ros-{release}-nmea-comms

note:we only test on kinetic,but it should be support on other version.

ffmpeg

$sudo apt install ffmpeg

libusb-1.0-0-dev

$sudo apt install libusb-1.0-0-dev

libsdl2-dev

$sudo apt install libsdl2-dev

opencv3.x

We use OpenCV to show images from camera stream. Download and install instructions can be found at: http://opencv.org. Tested with OpenCV 3.3.0.Suggest using 3.3.0+.

stereo-vision function

Follow the instruction of here.

3.Permission

uart permission

You need to add your user to the dialout group to obtain read/write permissions for the uart communication.

$sudo usermod -a -G dialout ${USER}

Then log out of your user account and log in again for the permissions to take effect.

usb permission

You will need to add an udev file to allow your system to obtain permission and to identify DJI USB port.

$cd /etc/udev/rules.d/
$sudo vi DJIDevice.rules

Then add these content into DJIDevice.rules.

SUBSYSTEM=="usb", ATTRS{idVendor}=="2ca3", MODE="0666"

At last,you need to reboot your computer to make sure it works.

4. Building dji_osdk_ros pkg

create workspace

If you don't have a catkin workspace, create one as follows:

$mkdir catkin_ws
$cd catkin_ws
$mkdir src
$cd src
$catkin_init_workspace

add osdk-ros 4.1.0

Download osdk-ros 4.1.0 and put it into src.

Build the dji_osdk_ros ROS package

$cd ..
$catkin_make

Configuration

1.Remember to source your setup.bash.

$source devel/setup.bash

2.Edit the launch file and enter your App ID, Key, Baudrate and Port name in the designated places.
(note:there are two launch file.
dji_sdk_node.launch is for dji_sdk_node.(3.8.1's interface)
dji_vehicle_node is for dji_vehicle_node(4.1.0's interface)
)

$rosed dji_osdk_ros dji_sdk_node.launch
$rosed dji_osdk_ros dji_vehicle_node.launch

3.Remember to add UserConfig.txt to correct path.(in the current work directory)

If you want to run dji_sdk_node.launch, you need to put UserConfig.txt into /home/{user}/.ros. dji_vehicle_node.launch does not need UserConfig.txt.

Running the Samples

1.Start up the dji_osdk_ros ROS node.
if you want to use OSDK ROS 4.1.0's services and topics:

$roslaunch dji_osdk_ros dji_vehicle_node.launch

if you want to adapt to OSDK ROS 3.8.1's services and topics:

$roslaunch dji_osdk_ros dji_sdk_node.launch

2.Open up another terminal and cd to your catkin_ws location, and start up a sample (e.g. flight control sample).

$source devel/setup.bash
$rosrun dji_osdk_ros flight_control_node

note:if you want to rosrun dji_sdk_node,you need to put UserConfig.txt into current work directory.
3.Follow the prompt on screen to choose an action for the drone to do.

Support

You can get support from DJI and the community with the following methods:

More Repositories

1

Tello-Python

This is a collection of python modules that interact with the Ryze Tello drone.
Python
1,346
star
2

Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Java
976
star
3

Onboard-SDK

DJI Onboard SDK Official Repository
C++
904
star
4

Mobile-SDK-iOS

DJI Mobile SDK for iOS: http://developer.dji.com/mobile-sdk/
Objective-C
576
star
5

RoboMaster-SDK

DJI RoboMaster Python SDK and Sample Code for RoboMaster EP.
C
322
star
6

Mobile-SDK-Android-V5

MSDK V5 Sample
Java
254
star
7

Payload-SDK

DJI Payload SDK Official Repository
C
223
star
8

Windows-SDK

DJI Windows SDK: http://developer.dji.com/windows-sdk/
C
166
star
9

Mobile-UXSDK-Android

DJI Mobile UXSDK is a suite of product agnostic UI objects that fast tracks the development of Android applications using the DJI Mobile SDK.
151
star
10

Guidance-SDK

The official Guidance SDK package for Windows, Ubuntu and XU3.
C++
134
star
11

DJI-Cloud-API-Demo

Java
120
star
12

Mobile-UXSDK-Beta-Android

Mobile Android UXSDK Beta
Java
97
star
13

Cloud-API-Demo-Web

Vue
93
star
14

Android-Bridge-App

Source code of DJI Android Bridge App.
Java
93
star
15

Guidance-SDK-ROS

The official ROS package of Guidance SDK for 32/64 bit Ubuntu and XU3
C++
80
star
16

Mobile-UXSDK-iOS

DJI Mobile UXSDK is a suite of product agnostic UI objects that fast tracks the development of iOS applications using the DJI Mobile SDK.
Objective-C
73
star
17

Mobile-SDK-Tutorial

GitBook Link
CSS
61
star
18

Mobile-SDK-Doc

Source code and docs for the documentation page of DJI Mobile SDK Developer Website.
HTML
52
star
19

FlightRecordParsingLib

DJI Flight Record Parsing Lib
C++
45
star
20

DJI-IoTEdge

This project is a sample for you to learn how to combine Microsoft Azure IoT Edge DJI Windows SDK and DJI Drones.
C#
45
star
21

iOS-Bridge-App

The source code of DJI Bridge App project
Objective-C
38
star
22

DJIWidget

The DJIWidget is a delightful DJI library includes VideoPreviewer for video decoding.
C
35
star
23

Manifold-Cam

The project realizes to get the video data from X3 camera on M100.
C
34
star
24

Onboard-SDK-Doc

Source code and docs for the documentation page of DJI Onboard SDK Developer Website.
HTML
34
star
25

Mobile-UXSDK-Beta-iOS

Mobile iOS UXSDK Beta
Objective-C
23
star
26

Cloud-API-Doc

20
star
27

Edge-SDK

DJI Edge SDK Official Repository
C++
19
star
28

Windows-SDK-Doc

Source code and docs for the documentation page of DJI Windows SDK Developer Website.
HTML
18
star
29

Mobile-OSDK-iOS-App

Mobile - OnboardSDK communication iOS app
Objective-C
15
star
30

Payload-SDK-Doc

Source code and docs for the documentation page of DJI Payload SDK Developer Website.
HTML
14
star
31

DJIPSDKVideoStreamCheckTool

PSDK video stream check tool, used to check whether the specified video stream conforms to the PSDK video stream standard
C
13
star
32

Guidance-SDK-Doc

Source code and docs for the documentation page of DJI Guidance SDK Developer Website.
CSS
9
star
33

Mobile-SDK-Tutorial-V5

Mobile SDK Tutorial V5 Public
6
star
34

Onboard-SDK-Resources

6
star
35

Onboard-SDK-ROS-Release

4
star
36

DJIFlySafeDatabaseResource

DJIFlySafeDatabaseResource bundle.
Ruby
2
star
37

DJINetworkRTKHelper

The DJINetworkRTKHelper is used for Network RTK service in DJI Mobile SDK.
Ruby
2
star
38

OnboardSDK-Ping-iOSApp

Companion iOS App for Ping ADS-B integration to DJI onboard SDK.
Objective-C
1
star
39

Payload-SDK-Tutorial

Payload SDK Tutorial
1
star