Compare commits

...

10 Commits

Author SHA1 Message Date
邱棚 eb5d0b2218 feat:build 2024-07-12 12:26:02 +08:00
Katherine Scott 877157a0d9
Add note for ROS users. (#1941)
* update rules_boost to latest version (#1898)

Signed-off-by: Xùdōng Yáng <wyverald@gmail.com>
Signed-off-by: kscottz <katherineAScott@gmail.com>

* Add note for ROS users.

Signed-off-by: kscottz <katherineAScott@gmail.com>

* spelling errors.

Signed-off-by: kscottz <katherineAScott@gmail.com>

---------

Signed-off-by: Xùdōng Yáng <wyverald@gmail.com>
Signed-off-by: kscottz <katherineAScott@gmail.com>
Co-authored-by: Xùdōng Yáng <wyverald@gmail.com>
2024-01-05 11:05:32 -08:00
Xùdōng Yáng ef00de2317
update rules_boost to latest version (#1898)
Signed-off-by: Xùdōng Yáng <wyverald@gmail.com>
2022-09-06 21:44:43 +02:00
Wolfgang Hess 9ab557476d
Add Debian Bullseye to the install scripts, CI, docs. (#1897)
Signed-off-by: Wolfgang Hess <whess@fsfe.org>
2022-07-28 08:09:21 +02:00
XiaotaoGuo 1173e80c45
removed unused param from cmake macro (#1847)
Signed-off-by: XiaotaoGuo <xtguo1995@outlook.com>
2022-07-23 15:10:49 +02:00
Linh Nguyen ca526de1f8
Fix crash caused by setting gravity lower bound (#1893)
Signed-off-by: Linh Nguyen <linh.nguyen@enway.ai>
2022-07-21 19:47:18 +02:00
Wolfgang Hess dc6263414b
Remove Debian Stretch from CI. (#1895)
It has reached end-of-life with the
end of LTS on June 30, 2022.

Signed-off-by: Wolfgang Hess <whess@fsfe.org>
2022-07-19 20:26:53 +02:00
Wolfgang Hess 7b8b29d6d5
Fix CI for Ubuntu 18.04 by disabling gRPC test build for now. (#1891)
Signed-off-by: Wolfgang Hess <whess@fsfe.org>
2022-07-16 13:05:24 +02:00
Takashi Ogura 5663e340c0
Fix typo in trajectory_builder_3d.lua (#1870)
Fix the comment (`use_intensites` -> `use_intensities`)

Signed-off-by: Takashi Ogura <t.ogura@gmail.com>
2022-07-04 19:39:13 +02:00
Wolfgang Hess f76f849e6a
Add Ubuntu 22.04 to the install scripts, CI, docs. (#1888)
Signed-off-by: Wolfgang Hess <whess@fsfe.org>
2022-07-04 19:38:24 +02:00
19 changed files with 209 additions and 81 deletions

15
.github/workflows/ci-bullseye.yaml vendored Normal file
View File

@ -0,0 +1,15 @@
name: Debian Bullseye CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run the Dockerfile
run: docker build . -f Dockerfile.bullseye

15
.github/workflows/ci-jammy.yaml vendored Normal file
View File

@ -0,0 +1,15 @@
name: Ubuntu 22.04 CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run the Dockerfile
run: docker build . -f Dockerfile.jammy

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
build
bazel-*
/scripts/abseil-cpp/

View File

@ -29,6 +29,8 @@ include("${PROJECT_SOURCE_DIR}/cmake/functions.cmake")
google_initialize_cartographer_project()
google_enable_testing()
list(APPEND CMAKE_PREFIX_PATH "/usr/local/stow/absl")
find_package(absl REQUIRED)
set(BOOST_COMPONENTS iostreams)
if(WIN32)
@ -268,6 +270,41 @@ target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
${PROTOBUF_INCLUDE_DIR})
# TODO(hrapp): This should not explicitly list pthread and use
# PROTOBUF_LIBRARIES, but that failed on first try.
#
function(get_library_paths target)
get_target_property(LINK_LIBS ${target} INTERFACE_LINK_LIBRARIES)
if(NOT LINK_LIBS)
message(WARNING "Target ${target} has no INTERFACE_LINK_LIBRARIES")
return()
endif()
foreach(lib IN LISTS LINK_LIBS)
if(TARGET ${lib})
get_target_property(TYPE ${lib} TYPE)
if(TYPE STREQUAL "INTERFACE_LIBRARY")
get_library_paths(${lib})
elseif(TYPE STREQUAL "STATIC_LIBRARY" OR TYPE STREQUAL "SHARED_LIBRARY" OR TYPE STREQUAL "MODULE_LIBRARY")
get_target_property(LIB_PATH ${lib} LOCATION)
if(LIB_PATH)
message(STATUS "Library ${lib} is located at ${LIB_PATH}")
else()
message(WARNING "Library ${lib} has no LOCATION property")
endif()
endif()
else()
if("${lib}" MATCHES "-NOTFOUND$")
message(WARNING "Library ${lib} is NOTFOUND")
else()
message(STATUS "Linked library: ${lib}")
endif()
endif()
endforeach()
endfunction()
# absl::base
get_library_paths(absl::base)
target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY}
absl::algorithm
absl::base

View File

@ -22,7 +22,7 @@ ENV CC=$cc
ENV CXX=$cxx
# This base image doesn't ship with sudo, apt-utils. tzdata is installed here to avoid hanging later
# when it would wait for user input.
# when it would wait for user input.
RUN apt-get update && apt-get install -y sudo apt-utils tzdata && rm -rf /var/lib/apt/lists/*
COPY scripts/install_debs_cmake.sh cartographer/scripts/
@ -31,11 +31,5 @@ COPY scripts/install_abseil.sh cartographer/scripts/
RUN cartographer/scripts/install_abseil.sh && rm -rf /var/lib/apt/lists/*
COPY scripts/install_proto3.sh cartographer/scripts/
RUN cartographer/scripts/install_proto3.sh && rm -rf protobuf
COPY scripts/install_grpc.sh cartographer/scripts/
RUN cartographer/scripts/install_grpc.sh && rm -rf grpc
COPY scripts/install_async_grpc.sh cartographer/scripts/
RUN cartographer/scripts/install_async_grpc.sh && rm -rf async_grpc
COPY scripts/install_prometheus_cpp.sh cartographer/scripts/
RUN cartographer/scripts/install_prometheus_cpp.sh && rm -rf prometheus-cpp
COPY . cartographer
RUN cartographer/scripts/install_cartographer_cmake_with_grpc.sh && rm -rf cartographer
RUN cartographer/scripts/install_cartographer_cmake.sh && rm -rf cartographer

41
Dockerfile.bionic.grpc Normal file
View File

@ -0,0 +1,41 @@
# Copyright 2020 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM ubuntu:bionic
ARG cc
ARG cxx
# Set the preferred C/C++ compiler toolchain, if given (otherwise default).
ENV CC=$cc
ENV CXX=$cxx
# This base image doesn't ship with sudo, apt-utils. tzdata is installed here to avoid hanging later
# when it would wait for user input.
RUN apt-get update && apt-get install -y sudo apt-utils tzdata && rm -rf /var/lib/apt/lists/*
COPY scripts/install_debs_cmake.sh cartographer/scripts/
RUN cartographer/scripts/install_debs_cmake.sh && rm -rf /var/lib/apt/lists/*
COPY scripts/install_abseil.sh cartographer/scripts/
RUN cartographer/scripts/install_abseil.sh && rm -rf /var/lib/apt/lists/*
COPY scripts/install_proto3.sh cartographer/scripts/
RUN cartographer/scripts/install_proto3.sh && rm -rf protobuf
COPY scripts/install_grpc.sh cartographer/scripts/
RUN cartographer/scripts/install_grpc.sh && rm -rf grpc
COPY scripts/install_async_grpc.sh cartographer/scripts/
RUN cartographer/scripts/install_async_grpc.sh && rm -rf async_grpc
COPY scripts/install_prometheus_cpp.sh cartographer/scripts/
RUN cartographer/scripts/install_prometheus_cpp.sh && rm -rf prometheus-cpp
COPY . cartographer
RUN cartographer/scripts/install_cartographer_cmake_with_grpc.sh && rm -rf cartographer

View File

@ -1,4 +1,4 @@
# Copyright 2016 The Cartographer Authors
# Copyright 2022 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM debian:stretch
FROM debian:bullseye
ARG cc
ARG cxx
@ -26,11 +26,5 @@ RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/*
COPY scripts/install_debs_cmake.sh cartographer/scripts/
RUN cartographer/scripts/install_debs_cmake.sh && rm -rf /var/lib/apt/lists/*
COPY scripts/install_abseil.sh cartographer/scripts/
RUN cartographer/scripts/install_abseil.sh && rm -rf /var/lib/apt/lists/*
COPY scripts/install_ceres.sh cartographer/scripts/
RUN cartographer/scripts/install_ceres.sh && rm -rf ceres-solver
COPY scripts/install_proto3.sh cartographer/scripts/
RUN cartographer/scripts/install_proto3.sh && rm -rf protobuf
COPY . cartographer
RUN cartographer/scripts/install_cartographer_cmake.sh && rm -rf cartographer

View File

@ -22,7 +22,7 @@ ENV CC=$cc
ENV CXX=$cxx
# This base image doesn't ship with sudo, apt-utils. tzdata is installed here to avoid hanging later
# when it would wait for user input.
# when it would wait for user input.
RUN apt-get update && apt-get install -y sudo apt-utils tzdata && rm -rf /var/lib/apt/lists/*
COPY scripts/install_debs_cmake.sh cartographer/scripts/

31
Dockerfile.jammy Normal file
View File

@ -0,0 +1,31 @@
# Copyright 2020 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM ubuntu:jammy
ARG cc
ARG cxx
# Set the preferred C/C++ compiler toolchain, if given (otherwise default).
ENV CC=$cc
ENV CXX=$cxx
# This base image doesn't ship with sudo, apt-utils. tzdata is installed here to avoid hanging later
# when it would wait for user input.
RUN apt-get update && apt-get install -y sudo apt-utils tzdata && rm -rf /var/lib/apt/lists/*
COPY scripts/install_debs_cmake.sh cartographer/scripts/
RUN cartographer/scripts/install_debs_cmake.sh && rm -rf /var/lib/apt/lists/*
COPY . cartographer
RUN cartographer/scripts/install_cartographer_cmake.sh && rm -rf cartographer

View File

@ -16,7 +16,7 @@
Cartographer
============
|build| |docs| |license|
|build-jammy| |build-focal| |build-bionic| |build-bullseye| |build-buster| |docs| |license|
Purpose
=======
@ -30,6 +30,23 @@ configurations.
.. _Cartographer: https://github.com/cartographer-project/cartographer
.. _SLAM: https://en.wikipedia.org/wiki/Simultaneous_localization_and_mapping
A Note for ROS Users
====================
**Cartographer is no longer actively maintained.**
On rare occasions critical pull requests may be merged, but no new development is currently taking place, including issue response.
If you are installing Cartographer in ROS 1 / ROS 2 using a binary package that package is a fork of this repository.
The ROS fork of Cartographer is only maintained in a limited capacity.
No new development takes place on this fork, but pull requests may be merged at the maintainers' discretion.
The ROS fork of Cartographer, and the ROS wrapper library, can be found at these locations:
- `Cartographer Fork <https://github.com/ros2/cartographer>`_
- `Cartographer ROS <https://github.com/ros2/cartographer_ros>`_
Additional discussion can be found in `this ROS Discourse thread<https://discourse.ros.org/t/rolling-and-soon-humble-release-of-both-cartographer-and-cartographer-ros-v2-and-call-for-testing/25137>`_.
Getting started
===============
@ -83,10 +100,26 @@ Slides of these Cartographer Open House meetings are listed below.
- June 22, 2017: `Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/170622/sildes.pdf>`_
- June 8, 2017: `Slides <https://storage.googleapis.com/cartographer-public-data/cartographer-open-house/170608/slides.pdf>`_
.. |build| image:: https://github.com/cartographer-project/cartographer/actions/workflows/ci-focal.yaml/badge.svg
.. |build-jammy| image:: https://github.com/cartographer-project/cartographer/actions/workflows/ci-jammy.yaml/badge.svg
:alt: Ubuntu 22.04 Build Status
:scale: 100%
:target: https://github.com/cartographer-project/cartographer/actions/workflows/ci-jammy.yaml
.. |build-focal| image:: https://github.com/cartographer-project/cartographer/actions/workflows/ci-focal.yaml/badge.svg
:alt: Ubuntu 20.04 Build Status
:scale: 100%
:target: https://github.com/cartographer-project/cartographer/actions/workflows/ci-focal.yaml
.. |build-bionic| image:: https://github.com/cartographer-project/cartographer/actions/workflows/ci-bionic.yaml/badge.svg
:alt: Ubuntu 18.04 Build Status
:scale: 100%
:target: https://github.com/cartographer-project/cartographer/actions/workflows/ci-bionic.yaml
.. |build-bullseye| image:: https://github.com/cartographer-project/cartographer/actions/workflows/ci-bullseye.yaml/badge.svg
:alt: Debian Bullseye Build Status
:scale: 100%
:target: https://github.com/cartographer-project/cartographer/actions/workflows/ci-bullseye.yaml
.. |build-buster| image:: https://github.com/cartographer-project/cartographer/actions/workflows/ci-buster.yaml/badge.svg
:alt: Debian Buster Build Status
:scale: 100%
:target: https://github.com/cartographer-project/cartographer/actions/workflows/ci-buster.yaml
.. |docs| image:: https://readthedocs.org/projects/google-cartographer/badge/?version=latest
:alt: Documentation Status
:scale: 100%

View File

@ -20,11 +20,10 @@ def cartographer_repositories():
_maybe(
http_archive,
name = "com_github_nelhage_rules_boost",
sha256 = "371f49e7b29e44a718baf8b9a2dd3eca865005a851c9ecf8fb6a10a715aa58dd",
strip_prefix = "rules_boost-a5a95642f6097f8949020646ffe89d7243008981",
sha256 = "f7d620c0061631d5b7685cd1065f2e2bf0768559555010a75e8e4720006f5867",
strip_prefix = "rules_boost-c3fae06e819ed8b93e31b150387dce4864758643",
urls = [
"https://mirror.bazel.build/github.com/nelhage/rules_boost/archive/a5a95642f6097f8949020646ffe89d7243008981.tar.gz",
"https://github.com/nelhage/rules_boost/archive/a5a95642f6097f8949020646ffe89d7243008981.tar.gz",
"https://github.com/nelhage/rules_boost/archive/c3fae06e819ed8b93e31b150387dce4864758643.tar.gz",
],
)

View File

@ -374,6 +374,8 @@ void OptimizationProblem3D::Solve(
auto imu_it = imu_data.begin();
auto prev_node_it = node_it;
bool gravity_block_added = false;
for (++node_it; node_it != trajectory_end; ++node_it) {
const NodeId first_node_id = prev_node_it->id;
const NodeSpec3D& first_node_data = prev_node_it->data;
@ -432,6 +434,7 @@ void OptimizationProblem3D::Solve(
C_nodes.at(third_node_id).translation(),
&trajectory_data.gravity_constant,
trajectory_data.imu_calibration.data());
gravity_block_added = true;
}
problem.AddResidualBlock(
RotationCostFunction3D::CreateAutoDiffCostFunction(
@ -442,8 +445,11 @@ void OptimizationProblem3D::Solve(
trajectory_data.imu_calibration.data());
}
// Force gravity constant to be positive.
problem.SetParameterLowerBound(&trajectory_data.gravity_constant, 0, 0.0);
if (gravity_block_added) {
// Force gravity constant to be positive.
problem.SetParameterLowerBound(&trajectory_data.gravity_constant, 0,
0.0);
}
}
}

View File

@ -22,7 +22,7 @@ macro(_parse_arguments ARGS)
"${OPTIONS}" "${ONE_VALUE_ARG}" "${MULTI_VALUE_ARGS}" ${ARGS})
endmacro(_parse_arguments)
macro(_common_compile_stuff VISIBILITY)
macro(_common_compile_stuff)
set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}")
set_target_properties(${NAME} PROPERTIES
@ -34,7 +34,7 @@ endmacro(_common_compile_stuff)
function(google_test NAME ARG_SRC)
add_executable(${NAME} ${ARG_SRC})
_common_compile_stuff("PRIVATE")
_common_compile_stuff()
# Make sure that gmock always includes the correct gtest/gtest.h.
target_include_directories("${NAME}" SYSTEM PRIVATE
@ -49,7 +49,7 @@ function(google_binary NAME)
add_executable(${NAME} ${ARG_SRCS})
_common_compile_stuff("PRIVATE")
_common_compile_stuff()
install(TARGETS "${NAME}" RUNTIME DESTINATION bin)
endfunction()

View File

@ -106,7 +106,7 @@ TRAJECTORY_BUILDER_3D = {
},
},
-- When setting use_intensites to true, the intensity_cost_function_options_0
-- When setting use_intensities to true, the intensity_cost_function_options_0
-- parameter in ceres_scan_matcher has to be set up as well or otherwise
-- CeresScanMatcher will CHECK-fail.
use_intensities = false,

View File

@ -75,10 +75,6 @@ On Ubuntu 18.04 (Bionic):
:language: bash
:lines: 20-
.. literalinclude:: ../../scripts/install_ceres.sh
:language: bash
:lines: 20-
.. literalinclude:: ../../scripts/install_proto3.sh
:language: bash
:lines: 20-
@ -97,8 +93,8 @@ on systems that meet the following requirements:
* 64-bit, modern CPU (e.g. 3rd generation i7)
* 16 GB RAM
* Ubuntu 18.04 (Bionic), 20.04 (Focal)
* gcc version 6.3.0, 7.5.0, 9.3.0
* Ubuntu 18.04 (Bionic), 20.04 (Focal), 22.04 (Jammy)
* gcc version 7.5.0, 8.3.0, 9.3.0, 10.2.1, 11.2.0
Known Issues
------------

View File

@ -43,7 +43,6 @@
<depend>libboost-iostreams-dev</depend>
<depend>eigen</depend>
<depend>libabsl-dev</depend>
<depend>libcairo2-dev</depend>
<depend>libceres-dev</depend>
<depend>libgflags-dev</depend>

View File

@ -19,7 +19,7 @@ set -o verbose
git clone https://github.com/abseil/abseil-cpp.git
cd abseil-cpp
git checkout d902eb869bcfacc1bad14933ed9af4bed006d481
git checkout 215105818dfde3174fe799600bb0f3cae233d0bf # 20211102.0
mkdir build
cd build
cmake -G Ninja \

View File

@ -1,31 +0,0 @@
#!/bin/sh
# Copyright 2016 The Cartographer Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -o errexit
set -o verbose
VERSION="1.13.0"
# Build and install Ceres.
git clone https://ceres-solver.googlesource.com/ceres-solver
cd ceres-solver
git checkout tags/${VERSION}
mkdir build
cd build
cmake .. -G Ninja -DCXX11=ON
ninja
CTEST_OUTPUT_ON_FAILURE=1 ninja test
sudo ninja install

View File

@ -27,6 +27,7 @@ sudo apt-get install -y \
google-mock \
libboost-all-dev \
libcairo2-dev \
libceres-dev \
libcurl4-openssl-dev \
libeigen3-dev \
libgflags-dev \
@ -35,19 +36,16 @@ sudo apt-get install -y \
libsuitesparse-dev \
lsb-release \
ninja-build \
python3-sphinx \
stow
# Install Ceres Solver and Protocol Buffers support if available.
# Install Protocol Buffers and Abseil if available.
# No need to build it ourselves.
if [[ "$(lsb_release -sc)" = "focal" || "$(lsb_release -sc)" = "buster" ]]
then
sudo apt-get install -y python3-sphinx libgmock-dev libceres-dev protobuf-compiler
else
sudo apt-get install -y python-sphinx
if [[ "$(lsb_release -sc)" = "bionic" ]]
then
sudo apt-get install -y libceres-dev
fi
fi
case "$(lsb_release -sc)" in
jammy|bullseye)
sudo apt-get install -y libgmock-dev protobuf-compiler libabsl-dev ;;
focal|buster)
sudo apt-get install -y libgmock-dev protobuf-compiler ;;
bionic)
;;
esac