Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add QGC Mission import capability #235

Merged
merged 43 commits into from
Feb 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
08b2417
Add submodule 'json11'
Jan 23, 2018
609a9ff
Add Mission plugin capability to import mission from QGC plan
Jan 23, 2018
ce2f95f
Modify & refactor Fly mission example to test Mission import from QGr…
Jan 23, 2018
71c61b6
Move logic of importing QGC mission to MissionImpl class
Jan 23, 2018
41bb019
Add photo interval info extrated from QGC mission plan
Jan 23, 2018
98971ac
Fix auto type conversion from size_t to double pointed by AppVeyor
Jan 23, 2018
7ded4ff
Correct docs for `MissioItem::to_str()`
Jan 23, 2018
9ad6a79
Modify signature of Mission::import_mission_items_from_QGC_plan()
Jan 23, 2018
cd99476
Improved debug prints for QGC plan mission commit
Jan 23, 2018
16442ef
Removed doubtful comment in QGC import mission commit
Jan 23, 2018
a401257
Update info on QGroundControl Plan file format
Jan 24, 2018
58459d1
Add Unit test for QGC Mission import in Mission plugin
Feb 3, 2018
126d3e9
Rebase with Flexible plugin arch (QGC Mission import)
Feb 4, 2018
79184af
Restored Fly mission example (QGC Mission import)
Feb 4, 2018
302aa0c
Refactor Fly mission example
Feb 4, 2018
32d9b27
Add Fly QGC Mission example
Feb 4, 2018
1dad402
Remove obsolete "libs/json11" (QGC Mission import)
Feb 4, 2018
ac38d41
Fix double to float conv error (QGC Mission import)
Feb 4, 2018
2108e4e
Fix Travis-CI type conversion err (QGC Mission import)
Feb 4, 2018
d470c9a
Add note on "not having a break" (QGC Mission import)
Feb 5, 2018
f9b7bb9
Correct indentation, Add Fallthrough (QGC Mission import)
Feb 5, 2018
c7122cf
Rename `camera_action_delay_s` to `loiter_time_s` (QGC Mission import)
Feb 6, 2018
99fe33d
Handle MAV_CMD_NAV_LOITER_TIME (QGC Mission import)
Feb 6, 2018
09d1c7e
Group DroneCore mission items with location (QGC Mission import)
Feb 6, 2018
e2f8bbd
Fix "Distant is too far..." and other changes (QGC Mission importer)
Feb 7, 2018
320fbff
Refactor Fly QGC Mission (QGC Mission import)
Feb 7, 2018
3c7688b
Relocate Unit test compose() method to the end (QGC Mission import)
Feb 7, 2018
0ffb5e3
Rename QGC importer method to `import_QGC_mission()`
Feb 7, 2018
830ca9a
QGC Mission Importer: Rename importer method
Feb 9, 2018
2621d89
QGC Mission reporter: Fix review comments
Feb 12, 2018
dec1e1e
QGC Mission Importer: Remove old json11 path
Feb 12, 2018
4977b50
build_system: fix json submodule
JonasVautherin Feb 12, 2018
fac1743
build_system: some cleanup with unit tests
JonasVautherin Feb 12, 2018
7cc6f34
Correct name of submodules in .gitmodules
Feb 14, 2018
fc3d6c1
.gitmodules: Correct name of submoduels
Feb 15, 2018
53fe582
cmake/unit_tests: Add cURL include dir
Feb 15, 2018
a827e58
Follow Me Example : Remove linking `pthread`
Feb 15, 2018
4b70726
appveyor: fix unit test for mission import test
julianoes Feb 15, 2018
45ab3b4
QGC Mission Importer: Use absolute path for QGC sample plan
Feb 15, 2018
d0b9140
Appveyor: Copy debug DLLs for mission and json11
Feb 15, 2018
c0b620d
Fly QGC Mission example: Update sample plan path
Feb 15, 2018
2313a3e
Appveyor: Revert copying debug version of DLLs
Feb 15, 2018
84c73a7
QGC Mission Importer: Use `WINDOWS` flag instead of WIN32
Feb 15, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
[submodule "libs/include/mavlink/v2.0"]
[submodule "mavlink_v2"]
path = third_party/mavlink/include/mavlink/v2.0
url = https://github.com/mavlink/c_library_v2.git
[submodule "libs/gtest"]
[submodule "gtest"]
path = third_party/gtest
url = https://github.com/google/googletest
[submodule "curl-android-ios"]
path = core/third_party/curl-android-ios
url = https://github.com/dronecore/curl-android-ios.git
[submodule "libs/tinyxml2"]
[submodule "tinyxml2"]
path = core/third_party/tinyxml2
url = https://github.com/leethomason/tinyxml2.git
[submodule "grpc/server/proto"]
[submodule "dronecore-proto"]
path = grpc/server/proto
url = https://github.com/dronecore/DroneCore-Proto.git
[submodule "third_party/zlib"]
[submodule "zlib"]
path = third_party/zlib
url = https://github.com/madler/zlib
ignore = dirty
[submodule "json11"]
path = plugins/mission/third_party/json11
url = https://github.com/dropbox/json11
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ include(cmake/compiler_flags.cmake)
include(cmake/zlib.cmake)
include(cmake/curl.cmake)

# We support install in order to use the header and library files in
# other applications.
if(ANDROID)
set(lib_path "lib/android/${ANDROID_ABI}")
elseif(IOS)
Expand All @@ -21,14 +19,12 @@ else()
set(lib_path "lib")
endif()

# We want to use consistent install directories across libraries.
set(dronecore_install_include_dir "include/dronecore")
set(dronecore_install_lib_dir ${lib_path})

add_subdirectory(core)
add_subdirectory(plugins)

# Add external plugins.
if (DEFINED EXTERNAL_DIR AND NOT EXTERNAL_DIR STREQUAL "")
add_subdirectory(${EXTERNAL_DIR}/plugins
${CMAKE_CURRENT_BINARY_DIR}/${EXTERNAL_DIR}/plugins)
Expand All @@ -52,6 +48,8 @@ if(NOT IOS AND NOT ANDROID)
add_subdirectory(${EXTERNAL_DIR}/integration_tests
${CMAKE_CURRENT_BINARY_DIR}/${EXTERNAL_DIR}/integration_tests)
endif()

include(cmake/unit_tests.cmake)
endif()

if (DROP_DEBUG EQUAL 1)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ run_all_tests: default
${MAKE} -C build/default check

run_unit_tests: default
build/default/core/unit_tests_runner
build/default/unit_tests_runner

run_integration_tests: default
build/default/integration_tests/integration_tests_runner
Expand Down
22 changes: 12 additions & 10 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,17 @@ test: on
test_script:
- cd C:\dronecore
- if "%configuration%"=="Debug" (
copy build\third_party\gtest\googlemock\gtest\Debug\gtestd.dll build\core\Debug\ &&
copy build\third_party\gtest\googlemock\gtest\Debug\gtest_maind.dll build\core\Debug\ &&
copy build\third_party\gtest\googlemock\Debug\gmockd.dll build\core\Debug\ &&
cd build\core\Debug &&
unit_tests_runner.exe
copy build\third_party\gtest\googlemock\gtest\Debug\gtestd.dll build\Debug\ &&
copy build\third_party\gtest\googlemock\gtest\Debug\gtest_maind.dll build\Debug\ &&
copy build\third_party\gtest\googlemock\Debug\gmockd.dll build\Debug\ &&
copy build\plugins\mission\Debug\dronecore_mission.dll build\Debug\ &&
copy build\plugins\mission\third_party\json11\Debug\json11.dll build\Debug\ &&
build\Debug\unit_tests_runner.exe
) else (
copy build\third_party\gtest\googlemock\gtest\Release\gtest.dll build\core\Release\ &&
copy build\third_party\gtest\googlemock\gtest\Release\gtest_main.dll build\core\Release\ &&
copy build\third_party\gtest\googlemock\Release\gmock.dll build\core\Release\ &&
cd build\core\Release &&
unit_tests_runner.exe
copy build\third_party\gtest\googlemock\gtest\Release\gtest.dll build\Release\ &&
copy build\third_party\gtest\googlemock\gtest\Release\gtest_main.dll build\Release\ &&
copy build\third_party\gtest\googlemock\Release\gmock.dll build\Release\ &&
copy build\plugins\mission\Release\dronecore_mission.dll build\Release\ &&
copy build\plugins\mission\third_party\json11\Release\json11.dll build\Release\ &&
build\Release\unit_tests_runner.exe
)
31 changes: 31 additions & 0 deletions cmake/unit_tests.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
include_directories(${CMAKE_SOURCE_DIR}/core)
include_directories(${CMAKE_SOURCE_DIR}/third_party/mavlink/include)
include_directories(${CURL_INCLUDE_DIRS})

add_executable(unit_tests_runner
${UNIT_TEST_SOURCES}
)

if (MSVC)
# We need this to prevent linking errors from happening in the Windows build.
target_compile_definitions(unit_tests_runner PRIVATE -DGTEST_LINKED_AS_SHARED_LIBRARY)
target_compile_options(unit_tests_runner PUBLIC "/wd4251" "/wd4275")
endif()

target_compile_definitions(unit_tests_runner PRIVATE FAKE_TIME=1)

set_target_properties(unit_tests_runner
PROPERTIES COMPILE_FLAGS ${warnings}
)

target_link_libraries(unit_tests_runner
dronecore
dronecore_mission
gtest
gtest_main
gmock
)

add_test(unit_tests
unit_tests_runner
)
52 changes: 11 additions & 41 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,44 +124,14 @@ install(FILES
DESTINATION "include/dronecore"
)


if(NOT IOS AND NOT ANDROID)
# SYSTEM because we don't want warnings for gtest headers.
include_directories(SYSTEM third_party/gtest/googletest/include)
include_directories(SYSTEM third_party/gtest/googlemock/include)

add_executable(unit_tests_runner
global_include_test.cpp
mavlink_channels_test.cpp
unittests_main.cpp
# TODO: add this again
#core/http_loader_test.cpp
timeout_handler_test.cpp
call_every_handler_test.cpp
curl_test.cpp
${plugin_unittest_source_files}
)

if (MSVC)
# We need this to prevent linking errors from happening in the Windows build.
target_compile_definitions(unit_tests_runner PRIVATE -DGTEST_LINKED_AS_SHARED_LIBRARY)
target_compile_options(unit_tests_runner PUBLIC "/wd4251" "/wd4275")
endif()

target_compile_definitions(unit_tests_runner PRIVATE FAKE_TIME=1)

set_target_properties(unit_tests_runner
PROPERTIES COMPILE_FLAGS ${warnings}
)

target_link_libraries(unit_tests_runner
dronecore
gtest
gtest_main
gmock
)

add_test(unit_tests
unit_tests_runner
)
endif()
list(APPEND UNIT_TEST_SOURCES
${CMAKE_SOURCE_DIR}/core/global_include_test.cpp
${CMAKE_SOURCE_DIR}/core/mavlink_channels_test.cpp
${CMAKE_SOURCE_DIR}/core/unittests_main.cpp
# TODO: add this again
#${CMAKE_SOURCE_DIR}/core/http_loader_test.cpp
${CMAKE_SOURCE_DIR}/core/timeout_handler_test.cpp
${CMAKE_SOURCE_DIR}/core/call_every_handler_test.cpp
${CMAKE_SOURCE_DIR}/core/curl_test.cpp
)
set(UNIT_TEST_SOURCES ${UNIT_TEST_SOURCES} PARENT_SCOPE)
Loading