Skip to content

Commit 405a2e8

Browse files
authored
Gtsam 4.3 (#219)
* prevent crash on saving empty map * GTSAM 4.3a0 * require GTSAM 4.3 and gtsam_points 1.2 * fixing minor errors * update README
1 parent 1591f04 commit 405a2e8

20 files changed

+53
-51
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
strategy:
2020
matrix:
2121
DISTRO: [
22-
{ "ubuntu": "noble_gtsam4.2a9", "suffix": "gcc" },
23-
{ "ubuntu": "noble_gtsam4.2a9", "suffix": "llvm" },
24-
{ "ubuntu": "jammy_gtsam4.2a9", "suffix": "gcc" },
25-
{ "ubuntu": "jammy_gtsam4.2a9", "suffix": "llvm" },
26-
{ "ubuntu": "jammy_cuda12.2_gtsam4.2a9", "suffix": "gcc.cuda" },
27-
{ "ubuntu": "jammy_cuda12.2_gtsam4.2a9", "suffix": "llvm.cuda" }
22+
{ "ubuntu": "noble_gtsam4.3a0", "suffix": "gcc" },
23+
{ "ubuntu": "noble_gtsam4.3a0", "suffix": "llvm" },
24+
{ "ubuntu": "jammy_gtsam4.3a0", "suffix": "gcc" },
25+
{ "ubuntu": "jammy_gtsam4.3a0", "suffix": "llvm" },
26+
{ "ubuntu": "jammy_cuda12.2_gtsam4.3a0", "suffix": "gcc.cuda" },
27+
{ "ubuntu": "jammy_cuda12.2_gtsam4.3a0", "suffix": "llvm.cuda" }
2828
]
2929

3030
steps:

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ endif()
2424

2525
find_package(Boost REQUIRED serialization)
2626
find_package(Eigen3 REQUIRED)
27-
find_package(GTSAM REQUIRED)
28-
find_package(gtsam_points REQUIRED)
27+
find_package(GTSAM 4.3 REQUIRED)
28+
find_package(gtsam_points 1.2.0 REQUIRED)
2929
find_package(OpenMP REQUIRED)
3030
find_package(spdlog REQUIRED)
3131

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ If you find this package useful for your project, please consider leaving a comm
2626
[![ROS2](https://github.com/koide3/glim_ros2/actions/workflows/build.yml/badge.svg)](https://github.com/koide3/glim_ros2/actions/workflows/build.yml)
2727
[![EXT](https://github.com/koide3/glim_ext/actions/workflows/build.yml/badge.svg)](https://github.com/koide3/glim_ext/actions/workflows/build.yml)
2828

29+
## Updates
30+
31+
- 2025/06/15 : The base GTSAM version has been changed. Make sure you have rebuilt and installed **GTSAM 4.3a0** and **gtsam_points 1.2.0**.
32+
2933
## Dependencies
3034
### Mandatory
3135
- [Eigen](https://eigen.tuxfamily.org/index.php)

docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ sudo apt install libomp-dev libboost-all-dev libmetis-dev \
1313

1414
# Install GTSAM
1515
git clone https://github.com/borglab/gtsam
16-
cd gtsam && git checkout 4.2a9
16+
cd gtsam && git checkout 4.3a0
1717
mkdir build && cd build
1818
cmake .. -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \
1919
-DGTSAM_BUILD_TESTS=OFF \

include/glim/mapping/global_mapping.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include <any>
44
#include <memory>
55
#include <random>
6-
#include <boost/shared_ptr.hpp>
76
#include <glim/mapping/global_mapping_base.hpp>
87

98
namespace gtsam {
@@ -81,8 +80,8 @@ class GlobalMapping : public GlobalMappingBase {
8180
private:
8281
void insert_submap(int current, const SubMap::Ptr& submap);
8382

84-
boost::shared_ptr<gtsam::NonlinearFactorGraph> create_between_factors(int current) const;
85-
boost::shared_ptr<gtsam::NonlinearFactorGraph> create_matching_cost_factors(int current) const;
83+
std::shared_ptr<gtsam::NonlinearFactorGraph> create_between_factors(int current) const;
84+
std::shared_ptr<gtsam::NonlinearFactorGraph> create_matching_cost_factors(int current) const;
8685

8786
void update_submaps();
8887
gtsam_points::ISAM2ResultExt update_isam2(const gtsam::NonlinearFactorGraph& new_factors, const gtsam::Values& new_values);

include/glim/mapping/global_mapping_pose_graph.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <memory>
66
#include <random>
77
#include <thread>
8-
#include <boost/shared_ptr.hpp>
98
#include <glim/util/concurrent_vector.hpp>
109
#include <glim/mapping/global_mapping_base.hpp>
1110

@@ -103,9 +102,9 @@ class GlobalMappingPoseGraph : public GlobalMappingBase {
103102
private:
104103
void insert_submap(int current, const SubMap::Ptr& submap);
105104

106-
boost::shared_ptr<gtsam::NonlinearFactorGraph> create_odometry_factors(int current) const;
105+
std::shared_ptr<gtsam::NonlinearFactorGraph> create_odometry_factors(int current) const;
107106
void find_loop_candidates(int current);
108-
boost::shared_ptr<gtsam::NonlinearFactorGraph> collect_detected_loops();
107+
std::shared_ptr<gtsam::NonlinearFactorGraph> collect_detected_loops();
109108

110109
void update_submaps();
111110

@@ -120,7 +119,7 @@ class GlobalMappingPoseGraph : public GlobalMappingBase {
120119
std::atomic_bool kill_switch;
121120
std::thread loop_detection_thread;
122121
ConcurrentVector<LoopCandidate> loop_candidates;
123-
ConcurrentVector<boost::shared_ptr<gtsam::NonlinearFactor>> detected_loops;
122+
ConcurrentVector<std::shared_ptr<gtsam::NonlinearFactor>> detected_loops;
124123

125124
std::vector<SubMap::Ptr> submaps;
126125
std::vector<SubMapTarget::Ptr> submap_targets;

include/glim/odometry/odometry_estimation_cpu.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class OdometryEstimationCPU : public OdometryEstimationIMU {
4949
virtual ~OdometryEstimationCPU() override;
5050

5151
private:
52-
virtual gtsam::NonlinearFactorGraph create_factors(const int current, const boost::shared_ptr<gtsam::ImuFactor>& imu_factor, gtsam::Values& new_values) override;
52+
virtual gtsam::NonlinearFactorGraph create_factors(const int current, const std::shared_ptr<gtsam::ImuFactor>& imu_factor, gtsam::Values& new_values) override;
5353

5454
virtual void fallback_smoother() override;
5555

include/glim/odometry/odometry_estimation_ct.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include <memory>
55
#include <future>
66

7-
#include <boost/shared_ptr.hpp>
87
#include <glim/odometry/odometry_estimation_base.hpp>
98

109
namespace gtsam {

include/glim/odometry/odometry_estimation_gpu.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class OdometryEstimationGPU : public OdometryEstimationIMU {
5656

5757
private:
5858
virtual void create_frame(EstimationFrame::Ptr& frame) override;
59-
virtual gtsam::NonlinearFactorGraph create_factors(const int current, const boost::shared_ptr<gtsam::ImuFactor>& imu_factor, gtsam::Values& new_values) override;
59+
virtual gtsam::NonlinearFactorGraph create_factors(const int current, const std::shared_ptr<gtsam::ImuFactor>& imu_factor, gtsam::Values& new_values) override;
6060
virtual void update_frames(const int current, const gtsam::NonlinearFactorGraph& new_factors) override;
6161

6262
void update_keyframes_overlap(int current);

include/glim/odometry/odometry_estimation_imu.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include <memory>
55
#include <random>
66

7-
#include <boost/shared_ptr.hpp>
87
#include <glim/odometry/odometry_estimation_base.hpp>
98

109
namespace gtsam {
@@ -79,7 +78,7 @@ class OdometryEstimationIMU : public OdometryEstimationBase {
7978

8079
protected:
8180
virtual void create_frame(EstimationFrame::Ptr& frame) {}
82-
virtual gtsam::NonlinearFactorGraph create_factors(const int current, const boost::shared_ptr<gtsam::ImuFactor>& imu_factor, gtsam::Values& new_values) = 0;
81+
virtual gtsam::NonlinearFactorGraph create_factors(const int current, const std::shared_ptr<gtsam::ImuFactor>& imu_factor, gtsam::Values& new_values) = 0;
8382

8483
virtual void fallback_smoother() {}
8584
virtual void update_frames(const int current, const gtsam::NonlinearFactorGraph& new_factors);

0 commit comments

Comments
 (0)