Skip to content

Commit 0cb50e3

Browse files
committed
fixed bug where calibration wasn't saving point to class member,
1 parent 0992f1b commit 0cb50e3

File tree

9 files changed

+25
-3
lines changed

9 files changed

+25
-3
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*.pcd filter=lfs diff=lfs merge=lfs -text
2+
*.png filter=lfs diff=lfs merge=lfs -text

doc/img/GUI.png

-504 KB
Loading

doc/img/sponge.png

-1.49 MB
Loading

doc/img/swaggg.png

-24.1 KB
Loading

src/controller/manager/ControllerManager.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ std::shared_ptr<controller::IControllerGUI> controller::ControllerManager::get_g
5959
if (name == "scan") {
6060
return cache->get_scan_controller_gui();
6161
} else if (name == "calibrate") {
62-
std::cout << "calling cache to retrieve controller" << std::endl;
6362
return cache->get_calibration_controller_gui();
6463
} else if (name == "move") {
6564
return cache->get_move_controller_gui();

src/model/calibration/CalibrationModel.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ pcl::PointXYZ model::CalibrationModel::calculate_center_point() {
4444
// solve!!
4545
Eigen::MatrixXd sol_mat = A.bdcSvd(Eigen::ComputeThinU | Eigen::ComputeThinV).solve(b);
4646
std::vector<double> sol_vec(sol_mat.data(), sol_mat.data() + sol_mat.rows() * sol_mat.cols());
47-
return pcl::PointXYZ(sol_vec[0], sol_vec[1], sol_vec[2]);
47+
center_point = pcl::PointXYZ(sol_vec[0], sol_vec[1], sol_vec[2]);
48+
return center_point;
4849
}
4950

5051
pcl::PointXYZ model::CalibrationModel::calculate_center_point(const equations::Normal &axis_dir,

src/view/gui/SwagGUI.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ SwagGUI::SwagGUI(QWidget *parent, controller::ControllerManager *manager) :
2222
ui->cloud_viewer->SetRenderWindow(viewer->getRenderWindow());
2323
viewer->setupInteractor(ui->cloud_viewer->GetInteractor(), ui->cloud_viewer->GetRenderWindow());
2424
ui->cloud_viewer->update();
25+
26+
// set up basic calibration info
27+
cal_angle = ui->calDropdownBasic->get_angle_slider_value() * 3;
28+
cal_rotations = ui->calDropdownBasic->get_rotation_slider_value();
2529
}
2630

2731
SwagGUI::~SwagGUI() {
@@ -47,6 +51,9 @@ void SwagGUI::on_calDropdownBasic_rotationSliderValueChanged(int value) {
4751
void SwagGUI::on_runCalButton_clicked() {
4852
controller::IControllerGUI *c = manager->get_gui_controller("calibrate").get();
4953
FormsPayload vars(cal_name, cal_angle, cal_rotations);
54+
std::cout << vars.name << std::endl;
55+
std::cout << vars.angle << std::endl;
56+
std::cout << vars.rotations << std::endl;
5057
c->update(vars);
5158
c->setAutoDelete(false);
5259
// dont need this for now as the GUI may not have its own console

test/research/depthFiltering/CompareDepthFiltering.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ TEST_F(CompareDepthFilteringFixture, CompareCalFixture) {
7070

7171
/**
7272
* This test compares realsense spatial filtering to pcl bilateral filtering
73+
* Results so far: Seems like realsense filtering vastly outperforms pcl bilateral filtering.
7374
* fixture_raw is raw cloud
7475
*
7576
* Doesn't seem like bilateral filtering does a very good job,
@@ -90,10 +91,14 @@ TEST_F(CompareDepthFilteringFixture, CompareRealsensePCL) {
9091
pcl::io::loadPCDFile<pcl::PointXYZ>(fs::current_path().string() + "/research/depthFiltering/data/fixture_1.pcd",
9192
*fixture_1);
9293

94+
std::cout << fixture_1->size() << std::endl;
95+
96+
9397
*fixture_2 = *fixture_raw;
9498
mod->crop_cloud(fixture_2, cal_min_x, cal_max_x, cal_min_y, cal_max_y, cal_min_z, cal_max_z);
95-
mod->voxel_grid_filter(fixture_2, .001);
99+
mod->voxel_grid_filter(fixture_2, .0005);
96100
mod->bilateral_filter(fixture_2, 50, .05);
101+
std::cout << fixture_2->size() << std::endl;
97102
*fixture_3 = *fixture_raw;
98103
mod->bilateral_filter(fixture_3, 1, .01);
99104
mod->crop_cloud(fixture_3, cal_min_x, cal_max_x, cal_min_y, cal_max_y, cal_min_z, cal_max_z);
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Results from CompareDepthFiltering.cpp
2+
3+
In this experiment, I aimed to compare realsense's ```spatial edge-preserving filter``` against
4+
PCL's ```FastBilateralFilter```. Tuning different parameters and treating the clouds
5+
through decimation filters, realsense's implementation clearly shows better results than PCL's implementation.
6+
7+
oh wait, nvm, let's just get new calibration scans lol
8+
9+
![section opening and closing](example.gif)

0 commit comments

Comments
 (0)