Skip to content

Commit

Permalink
Major release 3.2.0! This release brings support for LiDAR collision …
Browse files Browse the repository at this point in the history
…avoidance and LiDAR Mapping. A number of bugfixes and improvements are also added. See Release notes for more!
  • Loading branch information
amenonDJI committed Dec 23, 2016
1 parent ce652e8 commit b53e821
Show file tree
Hide file tree
Showing 10 changed files with 515 additions and 190 deletions.
24 changes: 24 additions & 0 deletions contrib/External_CollisionAvoidance.cmake
@@ -0,0 +1,24 @@
include(ExternalProject)
message( "External project - DJI Collision Avoidance" )

set(VERSION "1.0.0")
set(PROJECT_NAME dji-ros-collision-avoidance)
set(PKG_NAME collision-avoidance)

ExternalProject_Add(${PROJECT_NAME}
UPDATE_COMMAND ""
GIT_REPOSITORY https://github.com/dji-sdk/Onboard-SDK-Resources.git
GIT_TAG ${PKG_NAME}-${VERSION}
PATCH_COMMAND ""
)

ExternalProject_Get_Property(${PROJECT_NAME} source_dir)

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/../../../${PROJECT_NAME})

add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E tar xzf ${source_dir}/${PKG_NAME}-${VERSION}.tar.gz
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../../../${PROJECT_NAME}
)

20 changes: 20 additions & 0 deletions contrib/External_GTest.cmake
@@ -0,0 +1,20 @@
include(ExternalProject)
message( "External project - GoogleTest" )

if(GTEST)
if (CMAKE_SYSTEM_NAME MATCHES Linux)
find_package(Threads)
ExternalProject_Add(
googletest
# Disable update step
UPDATE_COMMAND ""
GIT_REPOSITORY https://github.com/google/googletest.git
CMAKE_ARGS -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=DebugLibs
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=ReleaseLibs
-DCMAKE_CXX_FLAGS=${MSVC_COMPILER_DEFS}
-Dgtest_force_shared_crt=${GTEST_FORCE_SHARED_CRT}
-Dgtest_disable_pthreads=${GTEST_DISABLE_PTHREADS}
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/../../../devel)
endif ()
endif ()

24 changes: 24 additions & 0 deletions contrib/External_Pointcloud2Las.cmake
@@ -0,0 +1,24 @@
include(ExternalProject)
message( "External project - DJI Pointcloud to LAS Converter" )

set(VERSION "1.0.0")
set(PROJECT_NAME dji-ros-pointcloud2las)
set(PKG_NAME pointcloud2las)

ExternalProject_Add(${PROJECT_NAME}
UPDATE_COMMAND ""
GIT_REPOSITORY https://github.com/dji-sdk/Onboard-SDK-Resources.git
GIT_TAG ${PKG_NAME}-${VERSION}
PATCH_COMMAND ""
)

ExternalProject_Get_Property(${PROJECT_NAME} source_dir)

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/../../../${PROJECT_NAME})

add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E tar xzf ${source_dir}/${PKG_NAME}-${VERSION}.tar.gz
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../../../${PROJECT_NAME}
)

68 changes: 55 additions & 13 deletions dji_sdk/CMakeLists.txt
@@ -1,6 +1,12 @@
cmake_minimum_required(VERSION 2.8.3)
project(dji_sdk)

option(GTEST "Build with Google Test framework" ON)

# Add module path for <name>.cmake conf files
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/Onboard-SDK-ROS/contrib)
include(${CMAKE_MODULE_PATH}/External_GTest.cmake)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
Expand All @@ -19,7 +25,6 @@ find_package(catkin REQUIRED COMPONENTS
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
Expand Down Expand Up @@ -166,7 +171,7 @@ catkin_package(
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
include
include
${catkin_INCLUDE_DIRS}
)

Expand Down Expand Up @@ -194,6 +199,54 @@ target_link_libraries(dji_sdk_node
${catkin_LIBRARIES}
)

#############
## Testing ##
#############
find_package(rostest REQUIRED)
find_package(GTest QUIET)

if(GTEST_FOUND)
message("Found GTest on the system\n")
endif()

# Create a gtest executable with target name "dji_sdk_test"
# which is not built by "make all" but only by "make tests"
# add one/multiple source files to the executable target
# register the rostest launch file "test/dji_sdk-node.test"
add_rostest_gtest(${PROJECT_NAME}_test
test/${PROJECT_NAME}-node.test
src/test/${PROJECT_NAME}_test.cpp
src/modules/dji_sdk_node_actions.cpp
src/modules/dji_sdk_node_services.cpp
src/modules/dji_sdk_node_main.cpp
src/modules/dji_sdk_node_mission.cpp)

if(TARGET ${PROJECT_NAME}_test)
add_dependencies(${PROJECT_NAME}_test
dji_sdk_generate_messages_cpp
dji_sdk_lib)

target_link_libraries(${PROJECT_NAME}_test
${catkin_LIBRARIES}
dji_sdk_lib
gtest
gtest_main
pthread)
endif()

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)

option(USE_COLLISION_AVOIDANCE "Use DJI collision avoidance library" OFF)
if(USE_COLLISION_AVOIDANCE)
include(${CMAKE_MODULE_PATH}/External_CollisionAvoidance.cmake)
endif()

option(USE_POINTCLOUD2LAS "Use DJI Pointcloud to LAS converter library" OFF)
if(USE_POINTCLOUD2LAS)
include(${CMAKE_MODULE_PATH}/External_Pointcloud2Las.cmake)
endif()

#############
## Install ##
#############
Expand Down Expand Up @@ -236,15 +289,4 @@ install(DIRECTORY launch
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

#############
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_dji_sdk.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)

0 comments on commit b53e821

Please sign in to comment.