Skip to content

Commit ffacf71

Browse files
Merge pull request #262 from yuckinus/main
Small bugfixes
2 parents c3dacf5 + 31a5de2 commit ffacf71

5 files changed

Lines changed: 708 additions & 702 deletions

File tree

‎apps/lidar_odometry_step_1/lidar_odometry_gui.cpp‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ void lidar_odometry_gui()
843843
params.in_out_params_indoor.resolution_X = 0.01;
844844
}
845845
ImGui::SameLine();
846-
ImGui::InputDouble("X", &params.in_out_params_outdoor.resolution_X, 0.0, 0.0, "%.3f");
846+
ImGui::InputDouble("X##ndt", &params.in_out_params_outdoor.resolution_X, 0.0, 0.0, "%.3f");
847847
if (ImGui::IsItemHovered())
848848
ImGui::SetTooltip(xText);
849849
if (params.in_out_params_outdoor.resolution_X < 0.01)
@@ -859,7 +859,7 @@ void lidar_odometry_gui()
859859
params.in_out_params_indoor.resolution_Y = 0.01;
860860
}
861861
ImGui::SameLine();
862-
ImGui::InputDouble("Y", &params.in_out_params_outdoor.resolution_Y, 0.0, 0.0, "%.3f");
862+
ImGui::InputDouble("Y##ndt", &params.in_out_params_outdoor.resolution_Y, 0.0, 0.0, "%.3f");
863863
if (ImGui::IsItemHovered())
864864
ImGui::SetTooltip(yText);
865865
if (params.in_out_params_outdoor.resolution_Y < 0.01)
@@ -875,7 +875,7 @@ void lidar_odometry_gui()
875875
params.in_out_params_indoor.resolution_Z = 0.01;
876876
}
877877
ImGui::SameLine();
878-
ImGui::InputDouble("Z", &params.in_out_params_outdoor.resolution_Z, 0.0, 0.0, "%.3f");
878+
ImGui::InputDouble("Z##ndt", &params.in_out_params_outdoor.resolution_Z, 0.0, 0.0, "%.3f");
879879
if (ImGui::IsItemHovered())
880880
ImGui::SetTooltip(zText);
881881
if (params.in_out_params_outdoor.resolution_Z < 0.01)
@@ -1450,8 +1450,9 @@ void lidar_odometry_gui()
14501450
}
14511451
}
14521452
}
1453-
ImGui::End();
14541453
}
1454+
1455+
ImGui::End();
14551456
}
14561457

14571458
void progress_window()

‎apps/lidar_odometry_step_1/lidar_odometry_utils.cpp‎

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,35 @@ unsigned long long int get_rgd_index(const Eigen::Vector3d p, const Eigen::Vecto
2525
return get_index(x, y, z);
2626
}
2727

28+
std::vector<Point3Di> decimate(const std::vector<Point3Di>& points, double bucket_x, double bucket_y, double bucket_z)
29+
{
30+
// std::cout << "points.size before decimation: " << points.size() << std::endl;
31+
Eigen::Vector3d b(bucket_x, bucket_y, bucket_z);
32+
std::vector<Point3Di> out;
33+
34+
std::vector<PointCloud::PointBucketIndexPair> ip;
35+
ip.resize(points.size());
36+
out.reserve(points.size());
37+
38+
for (int i = 0; i < points.size(); i++)
39+
{
40+
ip[i].index_of_point = i;
41+
ip[i].index_of_bucket = get_rgd_index(points[i].point, b);
42+
}
43+
std::sort(ip.begin(), ip.end(), [](const PointCloud::PointBucketIndexPair& a, const PointCloud::PointBucketIndexPair& b)
44+
{ return a.index_of_bucket < b.index_of_bucket; });
45+
46+
if (ip.size() != 0)
47+
out.emplace_back(points[ip[0].index_of_point]);
48+
49+
for (int i = 1; i < ip.size(); i++)
50+
if (ip[i - 1].index_of_bucket != ip[i].index_of_bucket)
51+
out.emplace_back(points[ip[i].index_of_point]);
52+
53+
// std::cout << "points.size after decimation: " << out.size() << std::endl;
54+
return out;
55+
}
56+
2857
Eigen::Matrix4d getInterpolatedPose(const std::map<double, Eigen::Matrix4d> &trajectory, double query_time)
2958
{
3059

@@ -91,35 +120,6 @@ Eigen::Matrix4d getInterpolatedPose(const std::map<double, Eigen::Matrix4d> &tra
91120
return ret;
92121
}
93122

94-
std::vector<Point3Di> decimate(const std::vector<Point3Di> &points, double bucket_x, double bucket_y, double bucket_z)
95-
{
96-
// std::cout << "points.size before decimation: " << points.size() << std::endl;
97-
Eigen::Vector3d b(bucket_x, bucket_y, bucket_z);
98-
std::vector<Point3Di> out;
99-
100-
std::vector<PointCloud::PointBucketIndexPair> ip;
101-
ip.resize(points.size());
102-
out.reserve(points.size());
103-
104-
for (int i = 0; i < points.size(); i++)
105-
{
106-
ip[i].index_of_point = i;
107-
ip[i].index_of_bucket = get_rgd_index(points[i].point, b);
108-
}
109-
std::sort(ip.begin(), ip.end(), [](const PointCloud::PointBucketIndexPair &a, const PointCloud::PointBucketIndexPair &b)
110-
{ return a.index_of_bucket < b.index_of_bucket; });
111-
for (int i = 1; i < ip.size(); i++)
112-
{
113-
// std::cout << ip[i].index_of_bucket << " ";
114-
if (ip[i - 1].index_of_bucket != ip[i].index_of_bucket)
115-
{
116-
out.emplace_back(points[ip[i].index_of_point]);
117-
}
118-
}
119-
// std::cout << "points.size after decimation: " << out.size() << std::endl;
120-
return out;
121-
}
122-
123123
void limit_covariance(Eigen::Matrix3d &io_cov)
124124
{
125125
return;

‎apps/multi_session_registration/multi_session_registration.cpp‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2850,7 +2850,6 @@ void project_gui()
28502850
}
28512851
}
28522852
}
2853-
//
28542853
}
28552854
}
28562855

@@ -2960,9 +2959,9 @@ void project_gui()
29602959
// }
29612960
}
29622961
}
2963-
2964-
ImGui::End();
29652962
}
2963+
2964+
ImGui::End();
29662965
}
29672966

29682967
void display()
@@ -3385,7 +3384,7 @@ void display()
33853384
{
33863385
if (ImGui::MenuItem("Open project", "Ctrl+O"))
33873386
openProject();
3388-
if (ImGui::MenuItem("Save project", "Ctrl+S", nullptr, sessions.size() > 0))
3387+
if (ImGui::MenuItem("Save project", "Ctrl+S", nullptr, project_settings.session_file_names.size() > 0))
33893388
saveProject();
33903389

33913390
ImGui::Separator();
@@ -3437,7 +3436,7 @@ void display()
34373436
ImGui::Separator();
34383437

34393438
ImGui::Text("(x,y,z,r00,r01,r02,r10,r11,r12,r20,r21,r22)");
3440-
if (ImGui::MenuItem("Save all as csv (timestamp Lidar)"))
3439+
if (ImGui::MenuItem("Save all as csv (timestamp Lidar)##1"))
34413440
{
34423441
for (size_t i = 0; i < project_settings.session_file_names.size(); ++i)
34433442
{
@@ -3502,7 +3501,7 @@ void display()
35023501

35033502
std::cout << "Finished saving all trajectories to CSV files." << std::endl;
35043503
}
3505-
if (ImGui::MenuItem("Save all as csv (timestamp Unix)"))
3504+
if (ImGui::MenuItem("Save all as csv (timestamp Unix)##1"))
35063505
{
35073506
for (size_t i = 0; i < project_settings.session_file_names.size(); ++i)
35083507
{
@@ -3557,7 +3556,7 @@ void display()
35573556
}
35583557
}
35593558
}
3560-
if (ImGui::MenuItem("Save all as csv (timestamp Lidar, Unix)"))
3559+
if (ImGui::MenuItem("Save all as csv (timestamp Lidar, Unix)##1"))
35613560
{
35623561
for (size_t i = 0; i < project_settings.session_file_names.size(); ++i)
35633562
{
@@ -3618,7 +3617,7 @@ void display()
36183617
ImGui::Separator();
36193618
ImGui::Text("(x,y,z,qx,qy,qz,qw)");
36203619

3621-
if (ImGui::MenuItem("Save all as csv (timestamp Lidar)"))
3620+
if (ImGui::MenuItem("Save all as csv (timestamp Lidar)##2"))
36223621
{
36233622
for (size_t i = 0; i < project_settings.session_file_names.size(); ++i)
36243623
{
@@ -3678,7 +3677,7 @@ void display()
36783677

36793678
std::cout << "Finished saving all trajectories to CSV files." << std::endl;
36803679
}
3681-
if (ImGui::MenuItem("Save all as csv (timestamp Unix)"))
3680+
if (ImGui::MenuItem("Save all as csv (timestamp Unix)##2"))
36823681
{
36833682
for (size_t i = 0; i < project_settings.session_file_names.size(); ++i)
36843683
{
@@ -3738,7 +3737,7 @@ void display()
37383737

37393738
std::cout << "Finished saving all trajectories to CSV files." << std::endl;
37403739
}
3741-
if (ImGui::MenuItem("Save all as csv (timestamp Lidar, Unix)"))
3740+
if (ImGui::MenuItem("Save all as csv (timestamp Lidar, Unix)##2"))
37423741
{
37433742
for (size_t i = 0; i < project_settings.session_file_names.size(); ++i)
37443743
{

0 commit comments

Comments
 (0)