[cartographer]Upgrade to v1.0.0, remake patch and fix build error. (#6492)

This commit is contained in:
JackBoosY 2019-05-18 04:44:32 +08:00 committed by Phil Christensen
parent 41c7755acf
commit 2e51afcd65
5 changed files with 218 additions and 157 deletions

View File

@ -1,4 +1,4 @@
Source: cartographer Source: cartographer
Version: 0.3.0-6 Version: 1.0.0
Build-Depends: ceres[eigensparse], gflags, glog, lua, cairo, boost-iostreams, gtest, protobuf Build-Depends: ceres[suitesparse], gflags, glog, lua, cairo, boost-iostreams, gtest, protobuf
Description: Google 2D & 3D SLAM package Description: Google 2D & 3D SLAM package

View File

@ -1,10 +1,10 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt
index bc92e9b..4c1826a 100644 index 95bb132..fbd624d 100644
--- a/CMakeLists.txt --- a/CMakeLists.txt
+++ b/CMakeLists.txt +++ b/CMakeLists.txt
@@ -226,7 +226,7 @@ target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE @@ -237,7 +237,7 @@ if(${BUILD_PROMETHEUS})
"${GMOCK_INCLUDE_DIRS}") target_compile_definitions(${PROJECT_NAME} PUBLIC USE_PROMETHEUS=1)
target_link_libraries(${PROJECT_NAME} PUBLIC ${GMOCK_LIBRARY}) endif()
-set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}") -set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}")
+set(TARGET_COMPILE_FLAGS "-D_DISABLE_EXTENDED_ALIGNED_STORAGE ${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}") +set(TARGET_COMPILE_FLAGS "-D_DISABLE_EXTENDED_ALIGNED_STORAGE ${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}")

View File

@ -0,0 +1,25 @@
diff --git a/cartographer/common/internal/testing/thread_pool_for_testing.cc b/cartographer/common/internal/testing/thread_pool_for_testing.cc
index f804e13..c987f68 100644
--- a/cartographer/common/internal/testing/thread_pool_for_testing.cc
+++ b/cartographer/common/internal/testing/thread_pool_for_testing.cc
@@ -16,7 +16,7 @@
#include "cartographer/common/internal/testing/thread_pool_for_testing.h"
-#include <unistd.h>
+//#include <unistd.h>
#include <algorithm>
#include <chrono>
#include <numeric>
diff --git a/cartographer/mapping/pose_graph_interface.h b/cartographer/mapping/pose_graph_interface.h
index 6483ef4..6456720 100644
--- a/cartographer/mapping/pose_graph_interface.h
+++ b/cartographer/mapping/pose_graph_interface.h
@@ -18,6 +18,7 @@
#define CARTOGRAPHER_MAPPING_POSE_GRAPH_INTERFACE_H_
#include <vector>
+#include <array>
#include "cartographer/common/optional.h"
#include "cartographer/mapping/id.h"

View File

@ -1,146 +1,181 @@
CMakeLists.txt | 45 ++++++++++++++++++++++---------------- diff --git a/CMakeLists.txt b/CMakeLists.txt
cartographer/common/math.h | 4 +++- index 2e3a686..f36f15a 100644
cartographer/common/thread_pool.cc | 2 +- --- a/CMakeLists.txt
cmake/functions.cmake | 10 ++++----- +++ b/CMakeLists.txt
4 files changed, 35 insertions(+), 26 deletions(-) @@ -25,27 +25,33 @@ option(BUILD_GRPC "build Cartographer gRPC support" false)
option(BUILD_PROMETHEUS "build Prometheus monitoring support" false)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 55e9adc..bc92e9b 100644 include("${PROJECT_SOURCE_DIR}/cmake/functions.cmake")
--- a/CMakeLists.txt -google_initialize_cartographer_project()
+++ b/CMakeLists.txt -google_enable_testing()
@@ -26,18 +26,23 @@ option(BUILD_GRPC "build Cartographer gRPC support" false) +#google_initialize_cartographer_project()
set(GRPC_PLUGIN_PATH "/usr/local/bin/grpc_cpp_plugin") +#google_enable_testing()
include("${PROJECT_SOURCE_DIR}/cmake/functions.cmake") find_package(Boost REQUIRED COMPONENTS iostreams)
-google_initialize_cartographer_project() find_package(Ceres REQUIRED COMPONENTS SuiteSparse)
-google_enable_testing() find_package(Eigen3 REQUIRED)
+#google_initialize_cartographer_project() -find_package(LuaGoogle REQUIRED)
+#google_enable_testing() +find_package(Lua REQUIRED)
find_package(Protobuf 3.0.0 REQUIRED)
find_package(Boost REQUIRED COMPONENTS iostreams) +find_package(glog REQUIRED)
find_package(Ceres REQUIRED COMPONENTS SparseLinearAlgebraLibrary) +find_package(gflags REQUIRED)
find_package(Eigen3 REQUIRED)
-find_package(LuaGoogle REQUIRED) if (${BUILD_GRPC})
+find_package(Lua REQUIRED) find_package(async_grpc REQUIRED)
find_package(Protobuf 3.0.0 REQUIRED) endif()
+find_package(glog REQUIRED)
+find_package(gflags REQUIRED) -include(FindPkgConfig)
-PKG_SEARCH_MODULE(CAIRO REQUIRED cairo>=1.12.16)
-include(FindPkgConfig) +#include(FindPkgConfig)
-PKG_SEARCH_MODULE(CAIRO REQUIRED cairo>=1.12.16) +#PKG_SEARCH_MODULE(CAIRO REQUIRED cairo>=1.12.16)
- +if(CMAKE_BUILD_TYPE STREQUAL Debug)
+#include(FindPkgConfig) + set(CAIRO_LIB_SUFFIX d)
+#PKG_SEARCH_MODULE(CAIRO REQUIRED cairo>=1.12.16) +endif()
+if(CMAKE_BUILD_TYPE STREQUAL Debug) +find_library(CAIRO_LIBRARY cairo${CAIRO_LIB_SUFFIX})
+ set(CAIRO_LIB_SUFFIX d)
+endif() # Only build the documentation if we can find Sphinx.
+find_library(CAIRO_LIBRARY cairo${CAIRO_LIB_SUFFIX}) -find_package(Sphinx)
# Only build the documentation if we can find Sphinx. -if(SPHINX_FOUND)
find_package(Sphinx) - add_subdirectory("docs")
if(SPHINX_FOUND) -endif()
@@ -144,15 +149,15 @@ configure_file( +#find_package(Sphinx)
${PROJECT_SOURCE_DIR}/cartographer/common/config.h.cmake +#if(SPHINX_FOUND)
${PROJECT_BINARY_DIR}/cartographer/common/config.h) +# add_subdirectory("docs")
+#endif()
-google_binary(cartographer_autogenerate_ground_truth
- SRCS # Install catkin package.xml
- cartographer/ground_truth/autogenerate_ground_truth_main.cc install(FILES package.xml DESTINATION share/cartographer)
-) @@ -169,20 +175,20 @@ configure_file(
- ${PROJECT_SOURCE_DIR}/cartographer/common/config.h.cmake
-google_binary(cartographer_compute_relations_metrics ${PROJECT_BINARY_DIR}/cartographer/common/config.h)
- SRCS
- cartographer/ground_truth/compute_relations_metrics_main.cc -google_binary(cartographer_autogenerate_ground_truth
-) - SRCS
+#google_binary(cartographer_autogenerate_ground_truth - cartographer/ground_truth/autogenerate_ground_truth_main.cc
+# SRCS -)
+# cartographer/ground_truth/autogenerate_ground_truth_main.cc -
+#) -google_binary(cartographer_compute_relations_metrics
+# - SRCS
+#google_binary(cartographer_compute_relations_metrics - cartographer/ground_truth/compute_relations_metrics_main.cc
+# SRCS -)
+# cartographer/ground_truth/compute_relations_metrics_main.cc -
+#) -google_binary(cartographer_migrate_serialization_format
- SRCS
if(${BUILD_GRPC}) - cartographer/io/migrate_serialization_format_main.cc
google_binary(cartographer_grpc_server -)
@@ -167,7 +172,7 @@ foreach(ABS_FIL ${ALL_TESTS}) +#google_binary(cartographer_autogenerate_ground_truth
get_filename_component(FIL_WE ${REL_FIL} NAME_WE) +# SRCS
# Replace slashes as required for CMP0037. +# cartographer/ground_truth/autogenerate_ground_truth_main.cc
string(REPLACE "/" "." TEST_TARGET_NAME "${DIR}/${FIL_WE}") +#)
- google_test("${TEST_TARGET_NAME}" ${ABS_FIL}) +#
+ #google_test("${TEST_TARGET_NAME}" ${ABS_FIL}) +#google_binary(cartographer_compute_relations_metrics
if(${BUILD_GRPC}) +# SRCS
target_link_libraries("${TEST_TARGET_NAME}" PUBLIC grpc++) +# cartographer/ground_truth/compute_relations_metrics_main.cc
endif() +#)
@@ -190,8 +195,9 @@ target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC +#
target_link_libraries(${PROJECT_NAME} PUBLIC ${Boost_LIBRARIES}) +#google_binary(cartographer_migrate_serialization_format
+# SRCS
# We expect find_package(Ceres) to have located these for us. +# cartographer/io/migrate_serialization_format_main.cc
-target_link_libraries(${PROJECT_NAME} PUBLIC glog) +#)
-target_link_libraries(${PROJECT_NAME} PUBLIC gflags)
+#target_link_libraries(${PROJECT_NAME} PUBLIC glog) if(${BUILD_GRPC})
+#target_link_libraries(${PROJECT_NAME} PUBLIC gflags) google_binary(cartographer_grpc_server
+target_link_libraries(${PROJECT_NAME} PUBLIC ${CAIRO_LIBRARY}) @@ -213,8 +219,9 @@ target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
target_link_libraries(${PROJECT_NAME} PUBLIC ${Boost_LIBRARIES})
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
"${CAIRO_INCLUDE_DIRS}") # We expect find_package(Ceres) to have located these for us.
@@ -201,7 +207,8 @@ target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC -target_link_libraries(${PROJECT_NAME} PUBLIC glog)
${PROTOBUF_INCLUDE_DIR}) -target_link_libraries(${PROJECT_NAME} PUBLIC gflags)
# TODO(hrapp): This should not explicitly list pthread and use +#target_link_libraries(${PROJECT_NAME} PUBLIC glog)
# PROTOBUF_LIBRARIES, but that failed on first try. +#target_link_libraries(${PROJECT_NAME} PUBLIC gflags)
-target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY} pthread) +target_link_libraries(${PROJECT_NAME} PUBLIC ${CAIRO_LIBRARY})
+#target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY} pthread)
+target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY}) target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
if(${BUILD_GRPC}) "${CAIRO_INCLUDE_DIRS}")
target_link_libraries(${PROJECT_NAME} PUBLIC grpc++) @@ -224,7 +231,8 @@ target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
endif() ${PROTOBUF_INCLUDE_DIR})
diff --git a/cartographer/common/math.h b/cartographer/common/math.h # TODO(hrapp): This should not explicitly list pthread and use
index f0ae9e2..d32bdbe 100644 # PROTOBUF_LIBRARIES, but that failed on first try.
--- a/cartographer/common/math.h -target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY} pthread)
+++ b/cartographer/common/math.h +#target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY} pthread)
@@ -16,7 +16,9 @@ +target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY})
if(${BUILD_GRPC})
#ifndef CARTOGRAPHER_COMMON_MATH_H_ target_link_libraries(${PROJECT_NAME} PUBLIC grpc++)
#define CARTOGRAPHER_COMMON_MATH_H_ target_link_libraries(${PROJECT_NAME} PUBLIC async_grpc)
- @@ -234,7 +242,7 @@ if(${BUILD_PROMETHEUS})
+ #ifndef M_PI target_compile_definitions(${PROJECT_NAME} PUBLIC USE_PROMETHEUS=1)
+ #define M_PI 3.14159265358979323846 endif()
+ #endif
#include <cmath> -set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}")
#include <vector> +set(TARGET_COMPILE_FLAGS "-D_DISABLE_EXTENDED_ALIGNED_STORAGE ${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}")
set_target_properties(${PROJECT_NAME} PROPERTIES
diff --git a/cartographer/common/thread_pool.cc b/cartographer/common/thread_pool.cc COMPILE_FLAGS ${TARGET_COMPILE_FLAGS})
index fdda166..178472f 100644
--- a/cartographer/common/thread_pool.cc @@ -255,7 +263,7 @@ foreach(ABS_FIL ${ALL_TESTS})
+++ b/cartographer/common/thread_pool.cc get_filename_component(FIL_WE ${REL_FIL} NAME_WE)
@@ -16,7 +16,7 @@ # Replace slashes as required for CMP0037.
string(REPLACE "/" "." TEST_TARGET_NAME "${DIR}/${FIL_WE}")
#include "cartographer/common/thread_pool.h" - google_test("${TEST_TARGET_NAME}" ${ABS_FIL})
+ #google_test("${TEST_TARGET_NAME}" ${ABS_FIL})
-#include <unistd.h> if(${BUILD_GRPC})
+//#include <unistd.h> target_link_libraries("${TEST_TARGET_NAME}" PUBLIC grpc++)
#include <algorithm> target_link_libraries("${TEST_TARGET_NAME}" PUBLIC async_grpc)
#include <chrono> @@ -263,7 +271,7 @@ foreach(ABS_FIL ${ALL_TESTS})
#include <numeric> if(${BUILD_PROMETHEUS})
diff --git a/cmake/functions.cmake b/cmake/functions.cmake target_link_libraries("${TEST_TARGET_NAME}" PUBLIC prometheus-cpp)
index 3bfd343..b41a84e 100644 endif()
--- a/cmake/functions.cmake - target_link_libraries("${TEST_TARGET_NAME}" PUBLIC ${TEST_LIB})
+++ b/cmake/functions.cmake + #target_link_libraries("${TEST_TARGET_NAME}" PUBLIC ${TEST_LIB})
@@ -118,12 +118,12 @@ macro(google_initialize_cartographer_project) endforeach()
set(LIST_FILES_CMD "find ${PROJECT_SOURCE_DIR}/ -not -iwholename '*.git*' | sort | sed 's/^/#/'")
set(FILES_LIST_PATH "${PROJECT_BINARY_DIR}/AllFiles.cmake") # Add the binary directory first, so that port.h is included after it has
set(DETECT_CHANGES_CMD "bash" "-c" "${LIST_FILES_CMD} | diff -N -q ${FILES_LIST_PATH} - || ${LIST_FILES_CMD} > ${FILES_LIST_PATH}") diff --git a/cartographer/common/math.h b/cartographer/common/math.h
- add_custom_target(${PROJECT_NAME}_detect_changes ALL index c4a77ef..0248f66 100644
- COMMAND ${DETECT_CHANGES_CMD} --- a/cartographer/common/math.h
- VERBATIM +++ b/cartographer/common/math.h
- ) @@ -17,6 +17,10 @@
+ #add_custom_target(${PROJECT_NAME}_detect_changes ALL #ifndef CARTOGRAPHER_COMMON_MATH_H_
+ # COMMAND ${DETECT_CHANGES_CMD} #define CARTOGRAPHER_COMMON_MATH_H_
+ # VERBATIM
+ #) +#ifndef M_PI
if(NOT EXISTS ${FILES_LIST_PATH}) +#define M_PI 3.14159265358979323846
- execute_process(COMMAND ${DETECT_CHANGES_CMD}) +#endif
+ # execute_process(COMMAND ${DETECT_CHANGES_CMD}) +
endif() #include <cmath>
include(${FILES_LIST_PATH}) #include <vector>
endmacro()
diff --git a/cartographer/common/thread_pool.cc b/cartographer/common/thread_pool.cc
index bc3c743..db424d1 100644
--- a/cartographer/common/thread_pool.cc
+++ b/cartographer/common/thread_pool.cc
@@ -16,7 +16,7 @@
#include "cartographer/common/thread_pool.h"
-#include <unistd.h>
+//#include <unistd.h>
#include <algorithm>
#include <chrono>
#include <numeric>
diff --git a/cmake/functions.cmake b/cmake/functions.cmake
index 3bfd343..3d961b0 100644
--- a/cmake/functions.cmake
+++ b/cmake/functions.cmake
@@ -118,12 +118,12 @@ macro(google_initialize_cartographer_project)
set(LIST_FILES_CMD "find ${PROJECT_SOURCE_DIR}/ -not -iwholename '*.git*' | sort | sed 's/^/#/'")
set(FILES_LIST_PATH "${PROJECT_BINARY_DIR}/AllFiles.cmake")
set(DETECT_CHANGES_CMD "bash" "-c" "${LIST_FILES_CMD} | diff -N -q ${FILES_LIST_PATH} - || ${LIST_FILES_CMD} > ${FILES_LIST_PATH}")
- add_custom_target(${PROJECT_NAME}_detect_changes ALL
- COMMAND ${DETECT_CHANGES_CMD}
- VERBATIM
- )
+ #add_custom_target(${PROJECT_NAME}_detect_changes ALL
+ # COMMAND ${DETECT_CHANGES_CMD}
+ # VERBATIM
+ #)
if(NOT EXISTS ${FILES_LIST_PATH})
- execute_process(COMMAND ${DETECT_CHANGES_CMD})
+ #execute_process(COMMAND ${DETECT_CHANGES_CMD})
endif()
include(${FILES_LIST_PATH})
endmacro()

View File

@ -5,12 +5,13 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github( vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH OUT_SOURCE_PATH SOURCE_PATH
REPO googlecartographer/cartographer REPO googlecartographer/cartographer
REF a7ed7e224f98b396762c865b81b62dc3abea2e81 REF 1.0.0
SHA512 2ab167c1c314591b4916baf70b8ad92ae542986c3578319d2454c904adae10f8027bc696579d6e2864d3606a6711563b82438e847527cad4ab0c2bd603a63eb7 SHA512 4e3b38ee40d9758cbd51f087578b82efb7d1199b4b7696d31f45938ac06250caaea2b4d85ccb0a848c958ba187a0101ee95c87323ca236c613995b23b215041c
HEAD_REF master HEAD_REF master
PATCHES PATCHES
${CMAKE_CURRENT_LIST_DIR}/fix-find-packages.patch fix-find-packages.patch
${CMAKE_CURRENT_LIST_DIR}/disable-C2338-cartographer.patch disable-C2338-cartographer.patch
fix-build-error.patch
) )
vcpkg_configure_cmake( vcpkg_configure_cmake(