Skip to content

Commit

Permalink
OSDK 3.5: Accessing live video from the FPV camera and main camera of…
Browse files Browse the repository at this point in the history
… M210 and M210 RTK is now possible!
  • Loading branch information
zliDJI committed Dec 18, 2017
1 parent d7650f3 commit 42eb990
Show file tree
Hide file tree
Showing 30 changed files with 1,759 additions and 78 deletions.
53 changes: 53 additions & 0 deletions EULA.txt

Large diffs are not rendered by default.

466 changes: 466 additions & 0 deletions License.txt

Large diffs are not rendered by default.

19 changes: 9 additions & 10 deletions README.md
@@ -1,4 +1,4 @@
# DJI Onboard SDK (OSDK) 3.4
# DJI Onboard SDK (OSDK) 3.5

[![Join the chat at https://gitter.im/dji-sdk/Onboard-SDK](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dji-sdk/Onboard-SDK?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Expand All @@ -7,34 +7,33 @@
The DJI Onboard SDK allows you to connect your own Onboard Computer to a [supported](https://developer.dji.com/onboard-sdk/documentation/introduction/osdk-hardware-introduction.html#supported-products) DJI vehicle or flight controller using a serial port (TTL UART). For full documentation, please visit the [DJI Developer Site](https://developer.dji.com/onboard-sdk/documentation/). Documentation regarding the code can be found in the [OSDK API Reference](https://developer.dji.com/onboard-api-reference/index.html) section of the developer website.

## Latest Release
OSDK 3.4.2 was released on 13 Dec 2017. Along with OSDK 3.4.1, this is a bugfix release fixing build issues for STM32, Qt, and resolving issues #212 and #221. Additionally, MIT license verbiage has been added to the open source components of OSDK. Links to DJI EULA have been added for headers accompanying closed-source binaries.
OSDK 3.5 was released on 15 Dec 2017. This release brings new features for the Matrice 210 and 210 RTK aircraft. Developers will now have access to the live streams of the main (Zenmuse X4 and X5S) and FPV cameras. Additionally, more complete license information is added to the repository.

## Last Major Release

OSDK 3.4 was released on 22 Nov 2017. This release introduces support for Matrice 210 and 210 RTK. Developers will now have access to previously unavailable data such as front-facing and downward-facing stereo camera feeds through USB. Please see the [release notes](https://developer.dji.com/onboard-sdk/documentation/appendix/releaseNotes.html) for more information.
OSDK 3.4 was released on 22 Nov 2017. This release introduces support for Matrice 210 and 210 RTK. Developers will now have access to previously unavailable data such as front-facing and downward-facing stereo camera feeds through USB. Please see the [release notes](https://developer.dji.com/onboard-sdk/documentation/appendix/releaseNotes.html) for more information. OSDK 3.4.2 hotfix release fixes some bugs present in 3.4.

## Firmware Compatibility

| Aircraft/FC | Firmware Package Version | Flight Controller Version | OSDK Branch | Notes |
|-------------------|--------------------------|---------------------------|------------------------|-----------------------------------------------------------------------|
| **M210/M210 RTK** | **1.1.0410+** | **3.2.39.12+** | **OSDK 3.4 (Current)** | Requires DJI Assistant 2 version 1.1.8 |
| **M210/M210 RTK** | **1.1.0410+** | **3.2.39.12+** | **OSDK 3.4+ ** | Requires DJI Assistant 2 version 1.1.8 |
| | | | | |
| **M600/M600 Pro** | **1.0.1.65** | **3.2.41.9** | **OSDK 3.4 (Current)** | |
| **M600/M600 Pro** | **1.0.1.65** | **3.2.41.9** | **OSDK 3.4+ ** | |
| | *1.0.1.65* | *3.2.41.9* | OSDK 3.3 | Firmware released 10/24/17 |
| | *1.0.1.60* | *3.2.41.5* | *Not Supported* | Firmware pulled due to instability |
| | **1.0.1.20** | **3.2.15.62** | **OSDK 3.3 (Current)** | 3.3 backward compatiblity released 10/18 |
| | **1.0.1.20** | **3.2.15.62** | **OSDK 3.3 ** | 3.3 backward compatiblity released 10/18 |
| | 1.0.0.80 | 3.2.15.00 | OSDK 3.2 | |
| | | | | |
| **A3/A3 Pro** | **1.7.1.5** | **3.2.36.8** | **OSDK 3.4 (Current)** | |
| **A3/A3 Pro** | **1.7.1.5** | **3.2.36.8** | **OSDK 3.4+ ** | |
| | 1.7.1.5 | 3.2.36.8 | OSDK 3.3 | |
| | 1.7.0.5 | 3.2.15.50 | OSDK 3.2 | |
| | 1.7.0.0 | 3.2.15.37 | OSDK 3.2 | |
| | | | | |
| **N3** | **1.7.1.5** | **3.2.36.8** | **OSDK 3.4 (Current)** | |
| **N3** | **1.7.1.5** | **3.2.36.8** | **OSDK 3.4+ ** | |
| | 1.7.1.5 | 3.2.36.8 | OSDK 3.3 | |
| | 1.7.0.0 | 3.2.15.37 | OSDK 3.2 | |
| | | | | |
| **M100** | 1.3.1.0 | 3.1.10.0 | **OSDK 3.4 (Current)** | |
| **M100** | 1.3.1.0 | 3.1.10.0 | **OSDK 3.4 ** | |



Expand Down
16 changes: 15 additions & 1 deletion osdk-core/CMakeLists.txt
Expand Up @@ -129,6 +129,15 @@ if(ADVANCED_SENSING)
add_dependencies(${PROJECT_NAME} advanced-sensing)
endif()

find_package(FFMPEG REQUIRED)

if(FFMPEG_FOUND)
message("Found FFMPEG FFMPEG_INCLUDE_DIR = ${FFMPEG_INCLUDE_DIR}")
message("Found FFMPEG FFMPEG_LIBRARIES = ${FFMPEG_LIBRARIES}")
else()
message("Cannot Find FFMPEG")
endif(FFMPEG_FOUND)

target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${ADVANCED_SENSING_INCLUDE_DIRS}>)
target_link_libraries(${PROJECT_NAME} PRIVATE ${ADVANCED_SENSING_LIBRARY})
Expand All @@ -137,7 +146,10 @@ if(ADVANCED_SENSING)
target_include_directories(${PROJECT_NAME} PUBLIC ${LIBUSB_1_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PUBLIC ${LIBUSB_1_LIBRARIES})

set(OSDK_INTERFACE_LIBS ${OSDK_INTERFACE_LIBS} ${LIBUSB_1_LIBRARIES})
target_include_directories(${PROJECT_NAME} PUBLIC ${FFMPEG_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} PUBLIC ${FFMPEG_LIBRARIES})

set(OSDK_INTERFACE_LIBS ${OSDK_INTERFACE_LIBS} ${LIBUSB_1_LIBRARIES} ${FFMPEG_LIBRARIES})
set(MODULE_BUILD_INTERFACE ${MODULE_BUILD_INTERFACE} ${ADVANCED_SENSING_LIBRARY})
set(MODULE_INSTALL_INTERFACE ${MODULE_INSTALL_INTERFACE} $<INSTALL_PREFIX>/lib/libadvanced-sensing.a)

Expand Down Expand Up @@ -222,6 +234,8 @@ if(ADVANCED_SENSING)
${ADVANCED_SENSING_INCLUDE_DIRS}/dji_advanced_sensing.hpp
${ADVANCED_SENSING_INCLUDE_DIRS}/dji_advanced_sensing_protocol.hpp
${ADVANCED_SENSING_INCLUDE_DIRS}/linux_usb_device.hpp
${ADVANCED_SENSING_INCLUDE_DIRS}/dji_camera_image.hpp
${ADVANCED_SENSING_INCLUDE_DIRS}/dji_camera_stream.hpp
)
endif()

Expand Down
@@ -0,0 +1,17 @@
# Distributed under the OSI-approved MIT License. See accompanying
# file LICENSE or https://github.com/Crascit/DownloadProject for details.

cmake_minimum_required(VERSION 2.8.2)

project(${DL_ARGS_PROJ}-download NONE)

include(ExternalProject)
ExternalProject_Add(${DL_ARGS_PROJ}-download
${DL_ARGS_UNPARSED_ARGUMENTS}
SOURCE_DIR "${DL_ARGS_SOURCE_DIR}"
BINARY_DIR "${DL_ARGS_BINARY_DIR}"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
182 changes: 182 additions & 0 deletions osdk-core/cmake-modules/DownloadProject/DownloadProject.cmake
@@ -0,0 +1,182 @@
# Distributed under the OSI-approved MIT License. See accompanying
# file LICENSE or https://github.com/Crascit/DownloadProject for details.
#
# MODULE: DownloadProject
#
# PROVIDES:
# download_project( PROJ projectName
# [PREFIX prefixDir]
# [DOWNLOAD_DIR downloadDir]
# [SOURCE_DIR srcDir]
# [BINARY_DIR binDir]
# [QUIET]
# ...
# )
#
# Provides the ability to download and unpack a tarball, zip file, git repository,
# etc. at configure time (i.e. when the cmake command is run). How the downloaded
# and unpacked contents are used is up to the caller, but the motivating case is
# to download source code which can then be included directly in the build with
# add_subdirectory() after the call to download_project(). Source and build
# directories are set up with this in mind.
#
# The PROJ argument is required. The projectName value will be used to construct
# the following variables upon exit (obviously replace projectName with its actual
# value):
#
# projectName_SOURCE_DIR
# projectName_BINARY_DIR
#
# The SOURCE_DIR and BINARY_DIR arguments are optional and would not typically
# need to be provided. They can be specified if you want the downloaded source
# and build directories to be located in a specific place. The contents of
# projectName_SOURCE_DIR and projectName_BINARY_DIR will be populated with the
# locations used whether you provide SOURCE_DIR/BINARY_DIR or not.
#
# The DOWNLOAD_DIR argument does not normally need to be set. It controls the
# location of the temporary CMake build used to perform the download.
#
# The PREFIX argument can be provided to change the base location of the default
# values of DOWNLOAD_DIR, SOURCE_DIR and BINARY_DIR. If all of those three arguments
# are provided, then PREFIX will have no effect. The default value for PREFIX is
# CMAKE_BINARY_DIR.
#
# The QUIET option can be given if you do not want to show the output associated
# with downloading the specified project.
#
# In addition to the above, any other options are passed through unmodified to
# ExternalProject_Add() to perform the actual download, patch and update steps.
# The following ExternalProject_Add() options are explicitly prohibited (they
# are reserved for use by the download_project() command):
#
# CONFIGURE_COMMAND
# BUILD_COMMAND
# INSTALL_COMMAND
# TEST_COMMAND
#
# Only those ExternalProject_Add() arguments which relate to downloading, patching
# and updating of the project sources are intended to be used. Also note that at
# least one set of download-related arguments are required.
#
# If using CMake 3.2 or later, the UPDATE_DISCONNECTED option can be used to
# prevent a check at the remote end for changes every time CMake is run
# after the first successful download. See the documentation of the ExternalProject
# module for more information. It is likely you will want to use this option if it
# is available to you. Note, however, that the ExternalProject implementation contains
# bugs which result in incorrect handling of the UPDATE_DISCONNECTED option when
# using the URL download method or when specifying a SOURCE_DIR with no download
# method. Fixes for these have been created, the last of which is scheduled for
# inclusion in CMake 3.8.0. Details can be found here:
#
# https://gitlab.kitware.com/cmake/cmake/commit/bdca68388bd57f8302d3c1d83d691034b7ffa70c
# https://gitlab.kitware.com/cmake/cmake/issues/16428
#
# If you experience build errors related to the update step, consider avoiding
# the use of UPDATE_DISCONNECTED.
#
# EXAMPLE USAGE:
#
# include(DownloadProject)
# download_project(PROJ googletest
# GIT_REPOSITORY https://github.com/google/googletest.git
# GIT_TAG master
# UPDATE_DISCONNECTED 1
# QUIET
# )
#
# add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
#
#========================================================================================


set(_DownloadProjectDir "${CMAKE_CURRENT_LIST_DIR}")

include(CMakeParseArguments)

function(download_project)

set(options QUIET)
set(oneValueArgs
PROJ
PREFIX
DOWNLOAD_DIR
SOURCE_DIR
BINARY_DIR
# Prevent the following from being passed through
CONFIGURE_COMMAND
BUILD_COMMAND
INSTALL_COMMAND
TEST_COMMAND
)
set(multiValueArgs "")

cmake_parse_arguments(DL_ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

# Hide output if requested
if (DL_ARGS_QUIET)
set(OUTPUT_QUIET "OUTPUT_QUIET")
else()
unset(OUTPUT_QUIET)
message(STATUS "Downloading/updating ${DL_ARGS_PROJ}")
endif()

# Set up where we will put our temporary CMakeLists.txt file and also
# the base point below which the default source and binary dirs will be.
# The prefix must always be an absolute path.
if (NOT DL_ARGS_PREFIX)
set(DL_ARGS_PREFIX "${CMAKE_BINARY_DIR}")
else()
get_filename_component(DL_ARGS_PREFIX "${DL_ARGS_PREFIX}" ABSOLUTE
BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
endif()
if (NOT DL_ARGS_DOWNLOAD_DIR)
set(DL_ARGS_DOWNLOAD_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-download")
endif()

# Ensure the caller can know where to find the source and build directories
if (NOT DL_ARGS_SOURCE_DIR)
set(DL_ARGS_SOURCE_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-src")
endif()
if (NOT DL_ARGS_BINARY_DIR)
set(DL_ARGS_BINARY_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-build")
endif()
set(${DL_ARGS_PROJ}_SOURCE_DIR "${DL_ARGS_SOURCE_DIR}" PARENT_SCOPE)
set(${DL_ARGS_PROJ}_BINARY_DIR "${DL_ARGS_BINARY_DIR}" PARENT_SCOPE)

# The way that CLion manages multiple configurations, it causes a copy of
# the CMakeCache.txt to be copied across due to it not expecting there to
# be a project within a project. This causes the hard-coded paths in the
# cache to be copied and builds to fail. To mitigate this, we simply
# remove the cache if it exists before we configure the new project. It
# is safe to do so because it will be re-generated. Since this is only
# executed at the configure step, it should not cause additional builds or
# downloads.
file(REMOVE "${DL_ARGS_DOWNLOAD_DIR}/CMakeCache.txt")

# Create and build a separate CMake project to carry out the download.
# If we've already previously done these steps, they will not cause
# anything to be updated, so extra rebuilds of the project won't occur.
# Make sure to pass through CMAKE_MAKE_PROGRAM in case the main project
# has this set to something not findable on the PATH.
configure_file("${_DownloadProjectDir}/DownloadProject.CMakeLists.cmake.in"
"${DL_ARGS_DOWNLOAD_DIR}/CMakeLists.txt")
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
-D "CMAKE_MAKE_PROGRAM:FILE=${CMAKE_MAKE_PROGRAM}"
.
RESULT_VARIABLE result
${OUTPUT_QUIET}
WORKING_DIRECTORY "${DL_ARGS_DOWNLOAD_DIR}"
)
if(result)
message(FATAL_ERROR "CMake step for ${DL_ARGS_PROJ} failed: ${result}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
${OUTPUT_QUIET}
WORKING_DIRECTORY "${DL_ARGS_DOWNLOAD_DIR}"
)
if(result)
message(FATAL_ERROR "Build step for ${DL_ARGS_PROJ} failed: ${result}")
endif()

endfunction()
2 changes: 1 addition & 1 deletion osdk-core/cmake-modules/External_AdvancedSensing.cmake
@@ -1,7 +1,7 @@
include(ExternalProject)
message( STATUS "External library - DJI Advanced Sensing for stereo cameras" )

set(VERSION "1.0.0")
set(VERSION "2.0.0")
set(LIB_NAME advanced-sensing)
set(LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_NAME}-${VERSION})

Expand Down
8 changes: 4 additions & 4 deletions osdk-core/cmake-modules/FindAdvancedSensing.cmake
Expand Up @@ -13,8 +13,8 @@ else (ADVANCED_SENSING_LIBRARY AND ADVANCED_SENSING_INCLUDE_DIRS)
NAMES
dji_advanced_sensing_protocol.hpp
PATHS
${CMAKE_CURRENT_SOURCE_DIR}/advanced-sensing-1.0.0/inc
${EXECUTABLE_OUTPUT_PATH}/advanced-sensing-1.0.0/inc
${CMAKE_CURRENT_SOURCE_DIR}/advanced-sensing-2.0.0/inc
${EXECUTABLE_OUTPUT_PATH}/advanced-sensing-2.0.0/inc
PATH_SUFFIXES
advanced-sensing
)
Expand All @@ -23,8 +23,8 @@ else (ADVANCED_SENSING_LIBRARY AND ADVANCED_SENSING_INCLUDE_DIRS)
NAMES
advanced-sensing
PATHS
${CMAKE_CURRENT_SOURCE_DIR}/advanced-sensing-1.0.0/lib
${EXECUTABLE_OUTPUT_PATH}/advanced-sensing-1.0.0/lib
${CMAKE_CURRENT_SOURCE_DIR}/advanced-sensing-2.0.0/lib
${EXECUTABLE_OUTPUT_PATH}/advanced-sensing-2.0.0/lib
NO_DEFAULT_PATH
)

Expand Down

0 comments on commit 42eb990

Please sign in to comment.