Skip to content

Commit 96e0832

Browse files
authored
fix(pl): Fix LIO-SAM segfaults (#76)
* Clean up lio-sam implementation * Pin more versions
1 parent 362ad5b commit 96e0832

3 files changed

Lines changed: 12 additions & 22 deletions

File tree

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@ compile_commands.json
3131
# cloned pipelines
3232
cpp/bindings/pipelines-src
3333

34-
# beads
34+
# Beads / Dolt files (added by bd init)
3535
.beads/
36+
.dolt/
37+
*.db
38+
.beads-credential-key

cpp/bindings/pipelines/lio_sam.h

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class LioSam: public ev::Pipeline {
119119

120120
// Getters
121121
const std::map<std::string, std::vector<ev::Point>> map() override {
122-
return ev::make_map("map", *lio_sam_->getMap());
122+
return ev::make_map("features", *lio_sam_->getMap());
123123
}
124124

125125
// Setters
@@ -150,38 +150,25 @@ class LioSam: public ev::Pipeline {
150150
}
151151

152152
void add_imu(ev::ImuMeasurement mm) override {
153-
std::cout << "EV: Adding IMU measurement at time " << mm.stamp.to_sec()
154-
<< std::endl;
155153
lio_sam_->addImuMeasurement(ev::convert<lio_sam::Imu>(mm));
156-
std::cout << "EV: Finished adding IMU measurement at time "
157-
<< mm.stamp.to_sec() << std::endl;
158154
}
159155

160156
void add_lidar(ev::LidarMeasurement mm) override {
161-
std::cout << "EV: Adding lidar measurement at time " << mm.stamp.to_sec()
162-
<< std::endl;
163157
// Set everything up
164158
auto cloud =
165159
ev::convert_iter<pcl::PointCloud<lio_sam::PointXYZIRT>>(mm.points)
166160
// NOTE: This likely causes a copy, see if we can avoid that later
167161
.makeShared();
168162

169163
// Run through pipeline
170-
std::cout << "EV: Adding lidar measurement" << std::endl;
171164
lio_sam_->addLidarMeasurement(mm.stamp.to_sec(), cloud);
172-
std::cout << "EV: Finished adding lidar measurement" << std::endl;
173165

174166
// Save pose
175-
// std::cout << "EV: Getting pose from LIO-SAM" << std::endl;
176-
// const auto pose = ev::convert<ev::SE3>(lio_sam_->getPose()) * lidar_T_imu_;
177-
// std::cout << "EV: Pose: " << pose.to_string() << std::endl;
178-
// this->save(mm.stamp, pose);
179-
// std::cout << "EV: Pose saved" << std::endl;
167+
const auto pose = ev::convert<ev::SE3>(lio_sam_->getPose()) * lidar_T_imu_;
168+
this->save(mm.stamp, pose);
180169

181170
// Save features
182-
// std::cout << "EV: Getting most recent frame from LIO-SAM" << std::endl;
183-
// this->save(mm.stamp, "features", *lio_sam_->getMostRecentFrame());
184-
// std::cout << "EV: Most recent frame saved" << std::endl;
171+
this->save(mm.stamp, "features", *lio_sam_->getMostRecentFrame());
185172
}
186173

187174
private:

cpp/setup_pipelines.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if [ ! -d "LIO-SAM" ]; then
2222
fi
2323
cd LIO-SAM
2424
git stash
25-
git checkout master
25+
git checkout d35ce0606b6326377b631ae9cedd73c74066eacc
2626
cd ..
2727

2828
# LOAM
@@ -31,7 +31,7 @@ if [ ! -d "loam" ]; then
3131
fi
3232
cd loam
3333
git stash
34-
git checkout main
34+
git checkout 48fc3a8c05ec3ea19c57f9565f453292c36b9bdf
3535
git apply ../../pipelines/loam.patch
3636
cd ..
3737

@@ -69,15 +69,15 @@ if [ ! -d "direct_lidar_inertial_odometry" ]; then
6969
fi
7070
cd direct_lidar_inertial_odometry
7171
git stash
72-
git checkout master
72+
git checkout 5cda5f359a70174a98001256ffd7234cbfeccf38
7373
cd ..
7474

7575
if [ ! -d "form" ]; then
7676
git clone https://github.com/rpl-cmu/form.git
7777
fi
7878
cd form
7979
git stash
80-
git switch --detach main
80+
git switch --detach v0.1.1
8181
git apply ../../pipelines/form.patch
8282
cd ..
8383

0 commit comments

Comments
 (0)