summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--cartographer-changes.patch309
-rw-r--r--cartographer.spec138
-rw-r--r--sources1
-rw-r--r--thread_annotations.h60
5 files changed, 509 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..ec9107b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/cartographer-2.0.9004.tar.gz
diff --git a/cartographer-changes.patch b/cartographer-changes.patch
new file mode 100644
index 0000000..f49498a
--- /dev/null
+++ b/cartographer-changes.patch
@@ -0,0 +1,309 @@
+diff --git a/cartographer/cloud/internal/map_builder_server.h b/cartographer/cloud/internal/map_builder_server.h
+index 03a70aa..22644f5 100644
+--- a/cartographer/cloud/internal/map_builder_server.h
++++ b/cartographer/cloud/internal/map_builder_server.h
+@@ -17,6 +17,7 @@
+ #ifndef CARTOGRAPHER_CLOUD_INTERNAL_MAP_BUILDER_SERVER_H
+ #define CARTOGRAPHER_CLOUD_INTERNAL_MAP_BUILDER_SERVER_H
+
++#include "cartographer/common/thread_annotations.h"
+ #include "async_grpc/execution_context.h"
+ #include "async_grpc/server.h"
+ #include "cartographer/cloud/internal/local_trajectory_uploader.h"
+diff --git a/cartographer/common/internal/blocking_queue.h b/cartographer/common/internal/blocking_queue.h
+index cba91c0..1e3ddc3 100644
+--- a/cartographer/common/internal/blocking_queue.h
++++ b/cartographer/common/internal/blocking_queue.h
+@@ -21,6 +21,7 @@
+ #include <deque>
+ #include <memory>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "absl/synchronization/mutex.h"
+ #include "cartographer/common/port.h"
+ #include "cartographer/common/time.h"
+diff --git a/cartographer/common/internal/testing/thread_pool_for_testing.cc b/cartographer/common/internal/testing/thread_pool_for_testing.cc
+index 89744ba..430ba8e 100644
+--- a/cartographer/common/internal/testing/thread_pool_for_testing.cc
++++ b/cartographer/common/internal/testing/thread_pool_for_testing.cc
+@@ -15,7 +15,6 @@
+ */
+
+ #include "cartographer/common/internal/testing/thread_pool_for_testing.h"
+-
+ #ifndef WIN32
+ #include <unistd.h>
+ #endif
+@@ -23,6 +22,7 @@
+ #include <chrono>
+ #include <numeric>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "absl/memory/memory.h"
+ #include "cartographer/common/task.h"
+ #include "cartographer/common/time.h"
+diff --git a/cartographer/common/internal/testing/thread_pool_for_testing.h b/cartographer/common/internal/testing/thread_pool_for_testing.h
+index f733d0f..dc2313c 100644
+--- a/cartographer/common/internal/testing/thread_pool_for_testing.h
++++ b/cartographer/common/internal/testing/thread_pool_for_testing.h
+@@ -16,12 +16,12 @@
+
+ #ifndef CARTOGRAPHER_COMMON_INTERNAL_TESTING_THREAD_POOL_FOR_TESTING_H_
+ #define CARTOGRAPHER_COMMON_INTERNAL_TESTING_THREAD_POOL_FOR_TESTING_H_
+-
+ #include <deque>
+ #include <functional>
+ #include <map>
+ #include <thread>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "absl/synchronization/mutex.h"
+ #include "cartographer/common/thread_pool.h"
+
+diff --git a/cartographer/common/task.cc b/cartographer/common/task.cc
+index 4085c97..643270b 100644
+--- a/cartographer/common/task.cc
++++ b/cartographer/common/task.cc
+@@ -13,7 +13,6 @@
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-
+ #include "cartographer/common/task.h"
+
+ namespace cartographer {
+diff --git a/cartographer/common/task.h b/cartographer/common/task.h
+index ae44fb1..d65b0cd 100644
+--- a/cartographer/common/task.h
++++ b/cartographer/common/task.h
+@@ -16,9 +16,9 @@
+
+ #ifndef CARTOGRAPHER_COMMON_TASK_H_
+ #define CARTOGRAPHER_COMMON_TASK_H_
+-
+ #include <set>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "absl/synchronization/mutex.h"
+ #include "glog/logging.h"
+ #include "thread_pool.h"
+diff --git a/cartographer/common/thread_pool.cc b/cartographer/common/thread_pool.cc
+index 2457152..7d7a62d 100644
+--- a/cartographer/common/thread_pool.cc
++++ b/cartographer/common/thread_pool.cc
+@@ -15,7 +15,6 @@
+ */
+
+ #include "cartographer/common/thread_pool.h"
+-
+ #ifndef WIN32
+ #include <unistd.h>
+ #endif
+@@ -23,6 +22,7 @@
+ #include <chrono>
+ #include <numeric>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "absl/memory/memory.h"
+ #include "cartographer/common/task.h"
+ #include "glog/logging.h"
+diff --git a/cartographer/common/thread_pool.h b/cartographer/common/thread_pool.h
+index 3f6b94c..ff3751d 100644
+--- a/cartographer/common/thread_pool.h
++++ b/cartographer/common/thread_pool.h
+@@ -16,12 +16,12 @@
+
+ #ifndef CARTOGRAPHER_COMMON_THREAD_POOL_H_
+ #define CARTOGRAPHER_COMMON_THREAD_POOL_H_
+-
+ #include <deque>
+ #include <functional>
+ #include <memory>
+ #include <thread>
+ #include <vector>
++#include "cartographer/common/thread_annotations.h"
+
+ #include "absl/container/flat_hash_map.h"
+ #include "absl/synchronization/mutex.h"
+diff --git a/cartographer/common/thread_pool_test.cc b/cartographer/common/thread_pool_test.cc
+index fec82ee..596b145 100644
+--- a/cartographer/common/thread_pool_test.cc
++++ b/cartographer/common/thread_pool_test.cc
+@@ -18,6 +18,7 @@
+
+ #include <vector>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "absl/memory/memory.h"
+ #include "gtest/gtest.h"
+
+diff --git a/cartographer/mapping/internal/2d/pose_graph_2d.cc b/cartographer/mapping/internal/2d/pose_graph_2d.cc
+index 060277e..4434ab9 100644
+--- a/cartographer/mapping/internal/2d/pose_graph_2d.cc
++++ b/cartographer/mapping/internal/2d/pose_graph_2d.cc
+@@ -28,6 +28,7 @@
+ #include <sstream>
+ #include <string>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "Eigen/Eigenvalues"
+ #include "absl/memory/memory.h"
+ #include "cartographer/common/math.h"
+diff --git a/cartographer/mapping/internal/2d/pose_graph_2d.h b/cartographer/mapping/internal/2d/pose_graph_2d.h
+index 3733425..b1ac7cc 100644
+--- a/cartographer/mapping/internal/2d/pose_graph_2d.h
++++ b/cartographer/mapping/internal/2d/pose_graph_2d.h
+@@ -25,6 +25,7 @@
+ #include <set>
+ #include <vector>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "Eigen/Core"
+ #include "Eigen/Geometry"
+ #include "absl/container/flat_hash_map.h"
+diff --git a/cartographer/mapping/internal/3d/pose_graph_3d.cc b/cartographer/mapping/internal/3d/pose_graph_3d.cc
+index 8a91e59..74cc66b 100644
+--- a/cartographer/mapping/internal/3d/pose_graph_3d.cc
++++ b/cartographer/mapping/internal/3d/pose_graph_3d.cc
+@@ -27,6 +27,7 @@
+ #include <sstream>
+ #include <string>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "Eigen/Eigenvalues"
+ #include "absl/memory/memory.h"
+ #include "cartographer/common/math.h"
+diff --git a/cartographer/mapping/internal/3d/pose_graph_3d.h b/cartographer/mapping/internal/3d/pose_graph_3d.h
+index 12a3469..0389a2a 100644
+--- a/cartographer/mapping/internal/3d/pose_graph_3d.h
++++ b/cartographer/mapping/internal/3d/pose_graph_3d.h
+@@ -25,6 +25,7 @@
+ #include <set>
+ #include <vector>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "Eigen/Core"
+ #include "Eigen/Geometry"
+ #include "absl/container/flat_hash_map.h"
+diff --git a/cartographer/mapping/internal/connected_components.h b/cartographer/mapping/internal/connected_components.h
+index 05f327e..420dfe0 100644
+--- a/cartographer/mapping/internal/connected_components.h
++++ b/cartographer/mapping/internal/connected_components.h
+@@ -19,6 +19,7 @@
+
+ #include <map>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "absl/container/flat_hash_map.h"
+ #include "absl/synchronization/mutex.h"
+ #include "cartographer/mapping/proto/connected_components.pb.h"
+diff --git a/cartographer/mapping/internal/constraints/constraint_builder_2d.cc b/cartographer/mapping/internal/constraints/constraint_builder_2d.cc
+index ad3dfb7..d7e0c57 100644
+--- a/cartographer/mapping/internal/constraints/constraint_builder_2d.cc
++++ b/cartographer/mapping/internal/constraints/constraint_builder_2d.cc
+@@ -27,6 +27,7 @@
+ #include <tuple>
+ #include <utility>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "Eigen/Eigenvalues"
+ #include "absl/memory/memory.h"
+ #include "cartographer/common/math.h"
+diff --git a/cartographer/mapping/internal/constraints/constraint_builder_2d.h b/cartographer/mapping/internal/constraints/constraint_builder_2d.h
+index 6667fdb..5e41da9 100644
+--- a/cartographer/mapping/internal/constraints/constraint_builder_2d.h
++++ b/cartographer/mapping/internal/constraints/constraint_builder_2d.h
+@@ -24,6 +24,7 @@
+ #include <map>
+ #include <vector>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "Eigen/Core"
+ #include "Eigen/Geometry"
+ #include "absl/synchronization/mutex.h"
+diff --git a/cartographer/mapping/internal/constraints/constraint_builder_3d.cc b/cartographer/mapping/internal/constraints/constraint_builder_3d.cc
+index 87b3742..c3eb767 100644
+--- a/cartographer/mapping/internal/constraints/constraint_builder_3d.cc
++++ b/cartographer/mapping/internal/constraints/constraint_builder_3d.cc
+@@ -27,6 +27,7 @@
+ #include <tuple>
+ #include <utility>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "Eigen/Eigenvalues"
+ #include "absl/memory/memory.h"
+ #include "cartographer/common/math.h"
+diff --git a/cartographer/mapping/internal/constraints/constraint_builder_3d.h b/cartographer/mapping/internal/constraints/constraint_builder_3d.h
+index 247a9da..d909358 100644
+--- a/cartographer/mapping/internal/constraints/constraint_builder_3d.h
++++ b/cartographer/mapping/internal/constraints/constraint_builder_3d.h
+@@ -24,6 +24,7 @@
+ #include <map>
+ #include <vector>
+
++#include "cartographer/common/thread_annotations.h"
+ #include "Eigen/Core"
+ #include "Eigen/Geometry"
+ #include "absl/synchronization/mutex.h"
+diff --git a/cartographer/mapping/internal/range_data_collator_test.cc b/cartographer/mapping/internal/range_data_collator_test.cc
+index 43ceb00..6435e50 100644
+--- a/cartographer/mapping/internal/range_data_collator_test.cc
++++ b/cartographer/mapping/internal/range_data_collator_test.cc
+@@ -203,3 +203,4 @@ TEST(RangeDataCollatorTest, ThreeSensorsWithIntensities) {
+ } // namespace
+ } // namespace mapping
+ } // namespace cartographer
++
+diff --git a/cartographer/sensor/imu_data.h b/cartographer/sensor/imu_data.h
+index 18f1b6e..d5c504f 100644
+--- a/cartographer/sensor/imu_data.h
++++ b/cartographer/sensor/imu_data.h
+@@ -25,9 +25,9 @@ namespace cartographer {
+ namespace sensor {
+
+ struct ImuData {
+- common::Time time;
+- Eigen::Vector3d linear_acceleration;
+- Eigen::Vector3d angular_velocity;
++ common::Time time{};
++ Eigen::Vector3d linear_acceleration{Eigen::Vector3d::Zero()};
++ Eigen::Vector3d angular_velocity{Eigen::Vector3d::Zero()};
+ };
+
+ // Converts 'imu_data' to a proto::ImuData.
+diff --git a/scripts/build_test_asan.sh b/scripts/build_test_asan.sh
+old mode 100755
+new mode 100644
+diff --git a/scripts/install_abseil.sh b/scripts/install_abseil.sh
+old mode 100755
+new mode 100644
+diff --git a/scripts/install_async_grpc.sh b/scripts/install_async_grpc.sh
+old mode 100755
+new mode 100644
+diff --git a/scripts/install_cartographer_bazel.sh b/scripts/install_cartographer_bazel.sh
+old mode 100755
+new mode 100644
+diff --git a/scripts/install_cartographer_cmake.sh b/scripts/install_cartographer_cmake.sh
+old mode 100755
+new mode 100644
+diff --git a/scripts/install_cartographer_cmake_with_grpc.sh b/scripts/install_cartographer_cmake_with_grpc.sh
+old mode 100755
+new mode 100644
+diff --git a/scripts/install_debs_bazel.sh b/scripts/install_debs_bazel.sh
+old mode 100755
+new mode 100644
+diff --git a/scripts/install_debs_cmake.sh b/scripts/install_debs_cmake.sh
+old mode 100755
+new mode 100644
+diff --git a/scripts/install_grpc.sh b/scripts/install_grpc.sh
+old mode 100755
+new mode 100644
+diff --git a/scripts/install_prometheus_cpp.sh b/scripts/install_prometheus_cpp.sh
+old mode 100755
+new mode 100644
+diff --git a/scripts/install_proto3.sh b/scripts/install_proto3.sh
+old mode 100755
+new mode 100644
+diff --git a/scripts/update_configuration_doc.py b/scripts/update_configuration_doc.py
+old mode 100755
+new mode 100644
diff --git a/cartographer.spec b/cartographer.spec
new file mode 100644
index 0000000..27769d6
--- /dev/null
+++ b/cartographer.spec
@@ -0,0 +1,138 @@
+%bcond_with tests
+%bcond_without weak_deps
+
+%define ros_distro humble
+
+%global debug_package %{nil}
+%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
+%global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$
+%global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$
+
+%define RosPkgName cartographer
+
+Name: ros-%{ros_distro}-%{RosPkgName}
+Version: 2.0.9004
+Release: 1%{?dist}%{?release_suffix}
+Summary: ROS cartographer package
+
+Url: https://github.com/cartographer-project/cartographer
+License: Apache 2.0
+Source0: %{RosPkgName}-%{version}.tar.gz
+Source1: thread_annotations.h
+Patch0: cartographer-changes.patch
+
+Requires: boost-devel
+Requires: eigen3-devel
+Requires: abseil-cpp-devel
+Requires: cairo-devel
+Requires: ceres-solver-devel
+Requires: gflags-devel
+Requires: glog-devel
+Requires: lua-devel
+Requires: protobuf-devel
+Requires: ros-%{ros_distro}-ros-workspace
+
+BuildRequires: boost-devel
+BuildRequires: eigen3-devel
+BuildRequires: abseil-cpp-devel
+BuildRequires: cairo-devel
+BuildRequires: ceres-solver-devel
+BuildRequires: gflags-devel
+BuildRequires: glog-devel
+BuildRequires: lua-devel
+BuildRequires: protobuf-devel
+BuildRequires: git
+BuildRequires: gmock-devel
+BuildRequires: gtest-devel
+BuildRequires: python3-sphinx
+BuildRequires: cmake
+BuildRequires: ros-%{ros_distro}-ros-workspace
+
+%if 0%{?with_tests}
+%endif
+
+Provides: %{name}-devel = %{version}-%{release}
+Provides: %{name}-doc = %{version}-%{release}
+Provides: %{name}-runtime = %{version}-%{release}
+
+%description
+Cartographer is a system that provides real-time simultaneous localization
+ and mapping (SLAM) in 2D and 3D across multiple platforms and sensor
+ configurations.
+
+%prep
+%autosetup -p1 -n %{RosPkgName}-%{version}
+# Patch0 adds #include "cartographer/common/thread_annotations.h" but the
+# upstream tarball doesn't ship it; provide a stub with no-op macros.
+cp %{SOURCE1} cartographer/common/thread_annotations.h
+
+%build
+# Needed to bootstrap since the ros_workspace package does not yet exist.
+export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages
+
+# In case we're installing to a non-standard location, look for a setup.sh
+# in the install tree and source it. It will set things like
+# CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
+if [ -f "/opt/ros/%{ros_distro}/setup.sh" ]; then . "/opt/ros/%{ros_distro}/setup.sh"; fi
+mkdir -p .obj-%{_target_platform} && cd .obj-%{_target_platform}
+%cmake3 \
+ -UINCLUDE_INSTALL_DIR \
+ -ULIB_INSTALL_DIR \
+ -USYSCONF_INSTALL_DIR \
+ -USHARE_INSTALL_PREFIX \
+ -ULIB_SUFFIX \
+ -DCMAKE_INSTALL_PREFIX="/opt/ros/%{ros_distro}" \
+ -DAMENT_PREFIX_PATH="/opt/ros/%{ros_distro}" \
+ -DCMAKE_PREFIX_PATH="/opt/ros/%{ros_distro}" \
+ -DSETUPTOOLS_DEB_LAYOUT=OFF \
+%if !0%{?with_tests}
+ -DBUILD_TESTING=OFF \
+%endif
+ ..
+
+%make_build
+
+%install
+# Needed to bootstrap since the ros_workspace package does not yet exist.
+export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages
+
+# In case we're installing to a non-standard location, look for a setup.sh
+# in the install tree and source it. It will set things like
+# CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
+if [ -f "/opt/ros/%{ros_distro}/setup.sh" ]; then . "/opt/ros/%{ros_distro}/setup.sh"; fi
+%make_install -C .obj-%{_target_platform}
+
+%if 0%{?with_tests}
+%check
+# Needed to bootstrap since the ros_workspace package does not yet exist.
+export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages
+
+# Look for a Makefile target with a name indicating that it runs tests
+TEST_TARGET=$(%__make -qp -C .obj-%{_target_platform} | sed "s/^\(test\|check\):.*/\\1/;t f;d;:f;q0")
+if [ -n "$TEST_TARGET" ]; then
+# In case we're installing to a non-standard location, look for a setup.sh
+# in the install tree and source it. It will set things like
+# CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
+if [ -f "/opt/ros/%{ros_distro}/setup.sh" ]; then . "/opt/ros/%{ros_distro}/setup.sh"; fi
+CTEST_OUTPUT_ON_FAILURE=1 \
+ %make_build -C .obj-%{_target_platform} $TEST_TARGET || echo "RPM TESTS FAILED"
+else echo "RPM TESTS SKIPPED"; fi
+%endif
+
+%files
+/opt/ros/%{ros_distro}
+
+%changelog
+* Thu Oct 08 2026 kuyan_kubuds <kuyan@kubuds.cn> - 2.0.9004-1
+- Sync cartographer 2.0.9004 from humble branch to master
+
+* Mon Sep 21 2026 Wanming Hu <huwanming@huawei.com> - 2.0.9004-1
+- Upgrade cartographer from 1.0.0 to 2.0.9004 for ROS 2 Humble.
+
+* Thu Nov 14 2024 Your Name <your.email@example.com> - 1.0.0
+- Simplified CMake patch to add compile flags to GOOG_CXX_FLAGS
+- Fix installed CMake files paths in spec file
+- Remove build-time absolute paths from installed files
+
+* Tue Dec 15 2020 openEuler Buildteam <hanhaomin008@126.com>
+- Package init
diff --git a/sources b/sources
new file mode 100644
index 0000000..974603c
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+c2373c3026dc2c71e8ce53171727f64f cartographer-2.0.9004.tar.gz
diff --git a/thread_annotations.h b/thread_annotations.h
new file mode 100644
index 0000000..c66e861
--- /dev/null
+++ b/thread_annotations.h
@@ -0,0 +1,60 @@
+#ifndef CARTOGRAPHER_COMMON_THREAD_ANNOTATIONS_H
+#define CARTOGRAPHER_COMMON_THREAD_ANNOTATIONS_H
+
+#ifndef LOCKS_EXCLUDED
+#define LOCKS_EXCLUDED(...)
+#endif
+
+#ifndef GUARDED_BY
+#define GUARDED_BY(x)
+#endif
+
+#ifndef EXCLUSIVE_LOCKS_REQUIRED
+#define EXCLUSIVE_LOCKS_REQUIRED(...)
+#endif
+
+#ifndef SHARED_LOCKS_REQUIRED
+#define SHARED_LOCKS_REQUIRED(...)
+#endif
+
+#ifndef ACQUIRED_BEFORE
+#define ACQUIRED_BEFORE(...)
+#endif
+
+#ifndef ACQUIRED_AFTER
+#define ACQUIRED_AFTER(...)
+#endif
+
+#ifndef REQUIRES
+#define REQUIRES(...)
+#endif
+
+#ifndef ACQUIRE
+#define ACQUIRE(...)
+#endif
+
+#ifndef RELEASE
+#define RELEASE(...)
+#endif
+
+#ifndef EXCLUDES
+#define EXCLUDES(...)
+#endif
+
+#ifndef ASSERT_EXCLUSIVE_LOCK
+#define ASSERT_EXCLUSIVE_LOCK(...)
+#endif
+
+#ifndef ASSERT_SHARED_LOCK
+#define ASSERT_SHARED_LOCK(...)
+#endif
+
+#ifndef RETURN_CAPABILITY
+#define RETURN_CAPABILITY(x)
+#endif
+
+#ifndef NO_THREAD_SAFETY_ANALYSIS
+#define NO_THREAD_SAFETY_ANALYSIS
+#endif
+
+#endif // CARTOGRAPHER_COMMON_THREAD_ANNOTATIONS_H