Skip to content
This repository has been archived by the owner on Sep 21, 2018. It is now read-only.

GUI App for Automatic Extrinsic Calibration of Range and Visual Sensors (Karnik Ram R) #2

Open
EduFdez opened this issue Apr 23, 2018 · 105 comments

Comments

@EduFdez
Copy link
Contributor

EduFdez commented Apr 23, 2018

Initial description

Range and visual sensors are being increasingly used alongside one another in mobile robots. With their increasing use, calibration techniques that can accurately estimate the 6-DoF transformation between them are becoming increasingly important. In this regard, an end-to-end application with an easy-to-use graphical user interface for the extrinsic calibration of different types of sensors is proposed. The app will be able to calibrate the extrinsics of 3D LiDARs, RGB-D cameras, RGB cameras, and any combination between them. Automatic and target-less calibration algorithms based on line matching, plane matching, and trajectory matching will be implemented and integrated into the app. The user will be able to directly visualize the calibration results inside the app and also compare different algorithms wherever possible, and significantly reduce calibration efforts.

See the GSoC project proposal

Progress: All comments below reflect the interactions between the GSoC student and the mentors.

@EduFdez
Copy link
Contributor Author

EduFdez commented Apr 23, 2018

Student: @karnikram
Main mentor: @EduFdez
Backup mentors: @jlblancoc , @jolting

@EduFdez EduFdez changed the title GUI App for Automatic Extrinsic Calibration of Range and Visual Sensors (Karnik Ram R) #2 GUI App for Automatic Extrinsic Calibration of Range and Visual Sensors (Karnik Ram R) Apr 23, 2018
@karnikram
Copy link

Hi @EduFdez, @jlblancoc, and @jolting!
Thank you so much for this opportunity, I'm really looking forward to this project and working with you guys.

During this bonding period I want to work on the GUI skeleton and get it ready. I'll also be spending time to get more familiar with the mrpt libraries and the coding style guides. Is there anything else that you guys want me to get started on? I also wanted to know about when and how the existing calibration codebases will be made available, so that I can start reading them.

Thank you again!

@EduFdez
Copy link
Contributor Author

EduFdez commented Apr 25, 2018

Hi @karnikram ,
Welcome to MRPT and to GSoC, and congratulations for being selected for this project! I hope it will be very motivating for all of us! Together with @jlblancoc and @jolting we will help you succeed in this project.
I agree with you about starting with the coding style guide and the GUI skeleton.

I have been looking at my previous code that I wrote for the experiments that are presented in some of the papers related to this project. This code is divided in different projects, some in Matlab and some in C++, and in some projects it's not very well structured. So I will save you some pain by putting the main resources that you will need into the project. I forked the project from your git, I will add some structure and files and I'll do my pull request to your fork, giving you some indications on where to start, and where to download first datasets to work with. I will come to you soon :-)

Best regards,

@karnikram
Copy link

Thanks @EduFdez, looking forward to it!
Do let me know if I can help with that in anyway.

@EduFdez
Copy link
Contributor Author

EduFdez commented Apr 25, 2018

Hi @karnikram !
I did some updates in my fork of autocalib-sensor-extrinsics to set the project structure, which should help you to organize the code in the future. I also added some "empty" files to start separating different classes. The directory tree is explained in its commit msg:
the core classes for the calibration (calib_core), the GUI squeleton (autocalib-gui), testing individual examples (examples), program unit tests (test), build the doc with doxygen, and search for dependencies with cmake scripts (cmake_modules).
I did a pull request to your repository, and feel free to change this structure as you like the most.

You can see that I added some dependencies:

  • MRPT is a dependency because we'll set the autocalib-sensor-extrinsics as an external application by now
  • OpenCV will be usefull to process images and extract lines.
  • PCL can be used to extract planes from depth images or point clouds. This could be changed in the future to reduce the number of dependencies, but we should use it by now to obtain results more quickly.
  • Boost can be used for programming the unit tests, among other things.

You can download and compile these libraries to start using them in this project.

Then, you can have a look at my unfinished MRPT application for calibrating 2D LiDARs, if look down to the main function you can have an idea of the algorithm. I'll try to split this long file into the classes of autocalib-sensor-extrinsics so that we get soon a basic example to build on.

@karnikram
Copy link

Looks neat! I shall get started with it.

@karnikram
Copy link

karnikram commented Apr 30, 2018

Hi @EduFdez,

I've built and installed the latest mrpt libraries (v-1.9.9) from source but I'm not able to build our project since it includes mrpt-base which I believe is not included in mrpt 1.9.9. Shall I go back to the maintenance branch (v-1.5) or shall I just not include mrpt-base?

I've also been looking into your MRPT application for calibrating 2D LiDARs, it looks interesting, but calibrating 2D LiDARs wasn't actually included in my proposal! We'd only included calibrating 3D LiDARs, RGB-D cameras, RGB cameras, and any combination between them. And out of them I'd wanted to implement Extrinsic calibration of a set of range cameras in 5 seconds without pattern first. So what do you suggest we do here? :)

And also just wanted to update that I haven't been able to access my proposal or any of the other students' proposals on the issue tickets. I guess the links are broken now.

@jlblancoc
Copy link
Member

Hi @karnikram !

I've built and installed the latest mrpt libraries (v-1.9.9) from source but I'm not able to build our project since it includes mrpt-base which I believe is not included in mrpt 1.9.9. Shall I go back to the maintenance branch (v-1.5) or shall I just not include mrpt-base?

It's better to move forward to the new mrpt master branch (1.9.9). Please, remove the reference to mrpt-base to the list of libraries that the code really needs. Typically you can find it out by checking the namespaces used by your code.
See the full list of libs here: http://mrpt.ual.es/reference/master/

Make sure of reading the guide on porting old code to mrpt-2:
http://mrpt.ual.es/reference/master/porting_mrpt2.html

since you'll have to apply it. Let us know if you find further incidences.

@karnikram
Copy link

Hi @jlblancoc!

I shall move forward with the latest branch. Until now there has been only one reference to mrpt-base, I shall read the documents you linked for any future conflicts.

One more minor issue, earlier when I ran cmake while building mrpt I got the following warning even though I have vtk6, libvtk6-dev, and python-vtk6 properly installed. Is this expected?

The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
but not all the files it references.

@jlblancoc
Copy link
Member

jlblancoc commented Apr 30, 2018 via email

@EduFdez
Copy link
Contributor Author

EduFdez commented May 2, 2018

Hi @karnikram !

I've also been looking into your MRPT application for calibrating 2D LiDARs, it looks interesting, but calibrating 2D LiDARs wasn't actually included in my proposal! We'd only included calibrating 3D LiDARs, RGB-D cameras, RGB cameras, and any combination between them. And out of them I'd wanted to implement Extrinsic calibration of a set of range cameras in 5 seconds without pattern first. So what do you suggest we do here? :)

I forgot that 2D LiDAR calibration was finally not included in the proposal. Maybe it could be addressed at the end of this GSoC if there is time for it.

I agree about starting with the calibration of 3D LiDAR / range images. You can have a look at the method PbMapMaker::detectPlanesCloud which contains a wrapper of PCL to extract planes by region growing. Have a look also to the class CFeatureLines that I was using to segment lines from images. I have just done a pull request to include this class in MRPT.

I just set you through "WeTransfer" a rawlog of an RGB-D video from 2 sensors to start working on 3D range calibration (Extrinsic calibration of a set of range cameras in 5 seconds without pattern) and RGB to Depth calibration. The first thing that you could try to do is to extract the 3D planes in this dataset, and then perform data association and display it.

And also just wanted to update that I haven't been able to access my proposal or any of the other students' proposals on the issue tickets. I guess the links are broken now.

The links to the student proposals work for me, can you check again and tell me if there is any broken link? Please.

@karnikram
Copy link

Hi @EduFdez!

Thanks for the code files and the dataset, they are interesting.

The first thing that you could try to do is to extract the 3D planes in this dataset, and then perform data association and display it.

Sounds good!

The links to the student proposals work for me, can you check again and tell me if there is any broken link? Please.

I'm still not able to access any of the proposals linked here. I think only the mentors have access to them!

@EduFdez
Copy link
Contributor Author

EduFdez commented May 2, 2018

I'm still not able to access any of the proposals linked here. I think only the mentors have access to them!

You were right. I have updated the link of your proposal, and we'll update those of other students too.

@karnikram
Copy link

@EduFdez, @jlblancoc
I've been getting comfortable with the mrpt-libs and the coding style, and have started to code some changes. I shall start pushing my changes in a couple of days.

But I'm having difficulty with one part. After loading the input .rawlog file, I believe the user should be able to inspect the observations and visualize the images, point clouds within the app just like how RawLogViewer does it. Could you give me some pointers about how to go about bringing RawLogViewer's functionality (tree-view of observations, visual preview) into our app? Or is this even the right thing to do?

@jlblancoc
Copy link
Member

jlblancoc commented May 4, 2018 via email

@karnikram
Copy link

Hi @jlblancoc,
I've been reading the robot-maps-gui, it's very well designed! Since I already have a start with Qt, I'll continue with it with this as an example. I'm looking to complete the observation tree and the viewer before the coding period starts.

@jlblancoc
Copy link
Member

jlblancoc commented May 4, 2018 via email

@karnikram
Copy link

Sure :)
I'm working on my fork of autocalib-sensor-extrinsics.

@karnikram
Copy link

Hi,

I'm having difficulty in de-serializing the observation objects from the rawlog file.

When I run,

CFileGZInputStream rawlog(file_name);
CSerializable::Ptr obj;

archiveFrom(rawlog) >> obj;

I get the following exception

 =============== MRPT EXCEPTION =============
typename T::Ptr mrpt::serialization::CArchive::ReadObject() [with T = mrpt::serialization::CSerializable; typename T::Ptr = std::shared_ptr<mrpt::serialization::CSerializable>], line 191:
Stored object has class 'CObservation3DRangeScan' which is not registered!:

Aren't all the mrpt classes already registered automatically?
Even when I run

mrpt::rtti::getAllRegisteredClasses()

I get no output.

Am I missing something?

@EduFdez
Copy link
Contributor Author

EduFdez commented May 19, 2018

Hi,
I think you need to use a CObservation instead of a CSerializable. You may have a look at the method loadFrame in DifOdometry_Datasets.cpp to see an example of loading observations from a rawlog. There are many more examples that load rawlog within mrpt.

@karnikram
Copy link

Hi @EduFdez!

In the example that you've mentioned the rawlog is being loaded in one step. But for our use case I'm actually trying to load the observations one by one and insert them into a tree structure, so that they can be presented easily as a tree view.

I was following this example for loading but it doesn't seem to work..

@jlblancoc
Copy link
Member

Your code to deserialize seems correct.

Make sure of adding to cmake's FIND_PACKAGE(MRPT ...), the list of all libraries whose objects you are deserializing, e.g. slam, obs, maps,...

Also: are you compiling mrpt from sources, right? Make sure of not building as static libraries

@karnikram
Copy link

karnikram commented May 19, 2018

Hi @jlblancoc!

I've included most of the modules in my cmake script
find_package(MRPT COMPONENTS hwdrivers obs serialization rtti slam maps graphslam pbmap QUIET)

I have also built mrpt from source. I have pushed the code to my fork

@jlblancoc
Copy link
Member

Hi,

I've built your code. First thing first: it builds cleanly, which is a really good thing to start!

The list of mrpt libs is correctly set via cmake and it makes its way to the linker:

VERBOSE=1 make 
...
/usr/bin/c++    -std=c++1y  -std=c++17  -O3 -DNDEBUG    CMakeFiles/autocalib_sensor_extrinsics.dir/main.cpp.o CMakeFiles/autocalib_sensor_extrinsics.dir/CMainWindow.cpp.o CMakeFiles/autocalib_sensor_extrinsics.dir/autocalib_sensor_extrinsics_automoc.cpp.o  -o autocalib_sensor_extrinsics  -L/home/jlblanco/code/mrpt/build/lib -rdynamic /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.5.1 -lmrpt-hwdrivers -lmrpt-comms -lmrpt-maps -lmrpt-gui -lmrpt-vision -lmrpt-obs -lmrpt-opengl -lmrpt-poses -lmrpt-db -lmrpt-tfest -lmrpt-serialization -lmrpt-rtti -lmrpt-core -lmrpt-slam -lmrpt-graphs -lmrpt-graphslam -lmrpt-pbmap -lmrpt-io -lmrpt-img -lmrpt-bayes -lmrpt-system -lmrpt-math -lmrpt-config -lmrpt-containers -lmrpt-random -lmrpt-expr /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.5.1 /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.5.1 -Wl,-rpath,/home/jlblanco/code/mrpt/build/lib 

But the executable does NOT actually depend (so it neither load) any of the "important" mrpt libs, the ones in which the deserialized objects live:

ldd autocalib-gui/autocalib_sensor_extrinsics | grep mrpt
	libmrpt-serialization.so.1.9 => /home/jlblanco/code/mrpt/build/lib/libmrpt-serialization.so.1.9 (0x00007fa7b4c67000)
	libmrpt-io.so.1.9 => /home/jlblanco/code/mrpt/build/lib/libmrpt-io.so.1.9 (0x00007fa7b4a4b000)
	libmrpt-rtti.so.1.9 => /home/jlblanco/code/mrpt/build/lib/libmrpt-rtti.so.1.9 (0x00007fa7b26ef000)
	libmrpt-core.so.1.9 => /home/jlblanco/code/mrpt/build/lib/libmrpt-core.so.1.9 (0x00007fa7b24ec000)
	libmrpt-system.so.1.9 => /home/jlblanco/code/mrpt/build/lib/libmrpt-system.so.1.9 (0x00007fa7b225d000)
	libmrpt-containers.so.1.9 => /home/jlblanco/code/mrpt/build/lib/libmrpt-containers.so.1.9 (0x00007fa7b0248000)

@jlblancoc
Copy link
Member

I can't find an obvious reason for this, apart of the usual optimizations of the linker.

For now, just adding one variable like this:

mrpt::obs::CObservation3DRangeScan o;

Anywhere (e.g. at the global scope of the GUI app) just fixes the problem. Give it a try, run ldd again (it worked for me and should for you as well) and try the serialization again. I think it will work now.

@karnikram
Copy link

Hi @jlblancoc,

Thank you so much, it works now!

@karnikram
Copy link

Update:
I'm more or less done with all the GUI elements. The app can now load a rawlog file and display all its entries as a tree. I've added two pcl visualizers for each of the two input sensors and one for the result.

status

Hope it's okay. The changes are in my fork.

I'm now re-reading your paper on fast extrinsic calibration of rgbd sensors using planes, and PbMap to implement plane extraction and association.

@EduFdez
Copy link
Contributor Author

EduFdez commented May 28, 2018

Hi, I'm glad that you solved the compilation problems and the GUI is in a good track. I am taking some holidays now and I cannot get internet all the time, but I am online at least once every 2 days.
I will have a look at your code soon to give you some feedback.

@karnikram
Copy link

Hi @EduFdez @jlblancoc
I've been trying to implement plane segmentation using pcl::OrganizedMultiPlaneSegmentation like in PbMap. But this method requires an organized pointcloud which I'm not able to get after converting CObservation3DRangeScan using mrpt::maps::CPointsMap::getPCLPointCloud.

Shall I do this conversion by myself or is there any other existing method that I can use?

@EduFdez
Copy link
Contributor Author

EduFdez commented Jul 2, 2018

@karnikram
Did you test already if the crash also happens if you link against a compiled version of PCL?

@karnikram
Copy link

Not yet @EduFdez, compiling the latest version of PCL is taking forever and it is also exceeding my 4GB physical memory. Even while compiling with just make, in one thread.

@EduFdez
Copy link
Contributor Author

EduFdez commented Jul 2, 2018

OK, I will test it and I will tell you if that solves the problem, otherwise I think we should better go back to PCL 1.7 since this kind of error is very difficult to track.

@EduFdez
Copy link
Contributor Author

EduFdez commented Jul 2, 2018

I compiled PCL 1.8 from sources, but I am not able to use it in "autocalib-sensor-extrinsics" since CMake complains about Eigen, and I do not know how to solve this properly. The CMake msg is:

The imported target "vtkRenderingPythonTkWidgets" references the file
"/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist. Possible reasons include:

  • The file was deleted, renamed, or moved to another location.
  • An install or uninstall procedure did not complete successfully.
  • The installation package was faulty and contained
    "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
    but not all the files it references.

The imported target "vtk" references the file
"/usr/bin/vtk"
but this file does not exist. Possible reasons include:

  • The file was deleted, renamed, or moved to another location.
  • An install or uninstall procedure did not complete successfully.
  • The installation package was faulty and contained
    "/usr/lib/cmake/vtk-6.3/VTKTargets.cmake"
    but not all the files it references.

CMake Warning at /home/efernand/libraries/pcl-build/PCLConfig.cmake:143 (find_package):
By not providing "FindEigen.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Eigen", but
CMake did not find one.

Could not find a package configuration file provided by "Eigen" with any of
the following names:

EigenConfig.cmake
eigen-config.cmake

Add the installation prefix of "Eigen" to CMAKE_PREFIX_PATH or set
"Eigen_DIR" to a directory containing one of the above files. If "Eigen"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
/home/efernand/libraries/pcl-build/PCLConfig.cmake:297 (find_eigen)
/home/efernand/libraries/pcl-build/PCLConfig.cmake:507 (find_external_library)
CMakeLists.txt:64 (FIND_PACKAGE)

CMake Error at /home/efernand/libraries/pcl-build/PCLConfig.cmake:46 (message):
common is required but eigen was not found
Call Stack (most recent call first):
/home/efernand/libraries/pcl-build/PCLConfig.cmake:346 (pcl_report_not_found)
/home/efernand/libraries/pcl-build/PCLConfig.cmake:507 (find_external_library)
CMakeLists.txt:64 (FIND_PACKAGE)

Configuring incomplete, errors occurred!
See also "/home/efernand/libraries/autocalib-sensor-extrinsics-build/CMakeFiles/CMakeOutput.log".
See also "/home/efernand/libraries/autocalib-sensor-extrinsics-build/CMakeFiles/CMakeError.log".

@jlblancoc do you have any idea on how to solve this?

@karnikram
Copy link

@EduFdez, are you sure Eigen is installed properly? And where is it placed?

@EduFdez
Copy link
Contributor Author

EduFdez commented Jul 2, 2018

@karnikram yes, it is installed but it is not found correctly by PCLConfig.cmake and I'm not sure on how to modify this file. Probably the best thing to do is to come back to the version 1.7 to avoid losing time on this.

@EduFdez
Copy link
Contributor Author

EduFdez commented Jul 3, 2018

Hi @karnikram , I fixed some small errors in order to compile the PCL version 1.7.2. (I sent you an email with the patch to fix these errors). I compiled your project against this version of PCL, but unluckily the Segmentation Fault is not solved.
You can post your problem on the PCL users mailing list, and I think you should also open an issue in PCL's github.

In the meanwhile, you may comment out the code for the plane segmentation and start working on line segmentation, and also the adaptation of the solver from the code I gave you.

@karnikram
Copy link

karnikram commented Jul 3, 2018

Hi @EduFdez,

I've already raised an issue on the PCL issues page.

But now since it's not working for you on 1.7.2 either (on 18.04) I think the problem is with the eigen libraries (version 3.3.4-4) in 18.04. Because it worked for me (no segmentation faults) with PCL 1.7.2 on 16.04 that has Eigen version 3.3~beta.

Some people had a similar issue like here and they solved it by using an older version of Eigen. I wanted to try this but I do not know how to make PCL 1.8 binaries to use an older version of Eigen without compiling pcl by myself (which is not possible on my system due to memory constraints).

Let me know what you think.

@jlblancoc
Copy link
Member

jlblancoc commented Jul 3, 2018 via email

@EduFdez
Copy link
Contributor Author

EduFdez commented Jul 3, 2018

Also, the Segmentation Fault could be caused by using package binaries that have been compiled with different c++ standards, as explained here or here.

@karnikram
Copy link

Thanks @jlblancoc,
I downloaded eigen-3.2.10 and created an EIGEN3_DIR cmake variable pointing to the headers. But the crash still happens. Is there any way to check which version of Eigen is being used by the pcl binaries?

@jlblancoc
Copy link
Member

jlblancoc commented Jul 3, 2018 via email

@EduFdez
Copy link
Contributor Author

EduFdez commented Jul 3, 2018

I tested it by compiling PCL1.8 (master branch) with the -std=c++11 flag and it worked out. I just added the following line to PCL's CMakelists.txt:
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
I guess it also must work with: set(CMAKE_CXX_STANDARD 17).

@karnikram you will need then to compile it like this, because the option of coming back to ubuntu16 seems a much worse choice. What memory constraints do you have?

@karnikram
Copy link

I installed Eigen 3.2.10 headers in /usr/local/include and my example segmentation program listed here works now (with PCL 1.8 binaries). The program is able to use the 3.2.10 headers.

But our project is still crashing.
Even though cmake reports using 3.2.10,

-- Checking for module 'eigen3'
--   Found eigen3, version 3.2.10
-- Found eigen: /usr/local/include/eigen3 

gdb backtrace suggests it's still using the headers in /usr/include/eigen3 (version 3.3.4-4)

Thread 1 "autocalib_senso" received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0xb1) at malloc.c:3103
3103	malloc.c: No such file or directory.
(gdb) bt
#0  __GI___libc_free (mem=0xb1) at malloc.c:3103
#1  0x0000555555581d58 in Eigen::internal::handmade_aligned_free (ptr=0x555556be54f0)
    at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:98
#2  0x0000555555581db4 in Eigen::internal::aligned_free (ptr=0x555556be54f0)
    at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:179
#3  0x00005555555bc31a in Eigen::aligned_allocator<pcl::PlanarRegion<pcl::PointXYZRGBA> >::deallocate (
    this=0x7fffffffcf10, p=0x555556be54f0) at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:747
#4  0x00005555555b9b3c in std::allocator_traits<Eigen::aligned_allocator<pcl::PlanarRegion<pcl::PointXYZRGBA> > >::deallocate (__a=..., __p=0x555556be54f0, __n=1) at /usr/include/c++/7/bits/alloc_traits.h:328
#5  0x00005555555b6510 in std::_Vector_base<pcl::PlanarRegion<pcl::PointXYZRGBA>, Eigen::aligned_allocator<pcl::PlanarRegion<pcl::PointXYZRGBA> > >::_M_deallocate (this=0x7fffffffcf10, __p=0x555556be54f0, __n=1)
    at /usr/include/c++/7/bits/stl_vector.h:180

I am not pointing to any Eigen3 directory in either of the CMake scripts.

@EduFdez
Copy link
Contributor Author

EduFdez commented Jul 3, 2018

@karnikram the calibration project does not crash anymore if you compile PCL with -std=c++11 as I said in my previous post.

@karnikram
Copy link

But unfortunately I'm not able to compile PCL 1.8 on my system :/
The process takes up all of my 4gb RAM and keeps getting killed. So I'm trying to find a fix with the binaries itself.

I got another solution, that was posted here just now.

But removing add_definitions(${PCL_DEFINITIONS}) causes a new segmentation fault. This time it's related to the mrpt libraries? I get this when I load the rawlog file:

Thread 1 "autocalib_senso" received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0x21) at malloc.c:3103
3103	malloc.c: No such file or directory.
(gdb) bt
#0  __GI___libc_free (mem=0x21) at malloc.c:3103
#1  0x00007ffff7af5a01 in Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 1, -1, -1> >::setSize(unsigned long, unsigned long) () from /home/karnik/tools/mrpt/build/lib/libmrpt-obs.so.1.9
#2  0x00007ffff7ae3db2 in mrpt::obs::CObservation3DRangeScan::serializeFrom(mrpt::serialization::CArchive&, unsigned char) () from /home/karnik/tools/mrpt/build/lib/libmrpt-obs.so.1.9
#3  0x00007ffff7499aa9 in mrpt::serialization::CArchive::internal_ReadObject(mrpt::serialization::CSerializable*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, signed char) () from /home/karnik/tools/mrpt/build/lib/libmrpt-serialization.so.1.9
#4  0x00007ffff7499ef6 in mrpt::serialization::CArchive::operator>>(std::shared_ptr<mrpt::serialization::CSerializable>&) () from /home/karnik/tools/mrpt/build/lib/libmrpt-serialization.so.1.9
#5  0x000055555559040e in CObservationTreeModel::CObservationTreeModel (this=0x55555739abb0, 
    rawlog_filename="/home/karnik/dataset/rgbd_1_2_2016-11-29_15h53m21s.rawlog", parent=0x5555568d49b0)
    at /home/karnik/code/autocalib-sensor-extrinsics/gui/observation_tree/CObservationTreeModel.cpp:32
#6  0x000055555557f736 in CMainWindow::loadRawlog (this=0x7fffffffe610)
    at /home/karnik/code/autocalib-sensor-extrinsics/gui/CMainWindow.cpp:107
#7  0x00005555555a3f46 in CMainWindow::qt_static_metacall (_o=0x7fffffffe610, 
    _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fffffffd920)
    at /home/karnik/code/autocalib-sensor-extrinsics/build/gui/moc_CMainWindow.cpp:89

Contents of ${PCL_DEFINITIONS} : -march=native -msse4.2 -mfpmath=sse -DDISABLE_ENSENSO-DDISABLE_DAVIDSDK-DDISABLE_DSSDK-DDISABLE_PCAP-DDISABLE_PNG-DDISABLE_LIBUSB_1_0-DFLANN_STATIC-DDISABLE_RSSDK-Dqh_QHpointer

@EduFdez
Copy link
Contributor Author

EduFdez commented Jul 3, 2018

I think that the main problem that causes the SegFault is that the binaries of PCL (and its dependencies) are compiled with a c++ standard previous to c++11. Compiling PCL with c++11 seems to solve the problem. But another option may be to remove SET(CMAKE_CXX_STANDARD 17) from your project.

@jlblancoc
Copy link
Member

jlblancoc commented Jul 3, 2018 via email

@jolting
Copy link
Member

jolting commented Jul 3, 2018

Are you using 16.04 or 18.04? I think 18.04 should work.

I backported 1.8 to 16.04. Maybe that will work.

https://launchpad.net/~jolting/+archive/ubuntu/backport-mrpt

FYI, the Ubuntu build farm is free for open source. I've never seen PCL fail to build on their farm.

https://opensourcehacker.com/2013/03/20/how-to-backport-packages-on-ubuntu-linux/

@karnikram
Copy link

@EduFdez, @jlblancoc, @jolting

I rebuilt mrpt in Debug mode, with debugging symbols turned on, and now somehow everything's working fine.

Earlier, removing ${PCL_DEFINITIONS} (-march=native option) stopped causing the PCL SegFault but it was causing a different SegFault in mrpt::obs::CObservation3DRangeScan::serializeFrom(mrpt::serialization::CArchive&, unsigned char) () from /home/karnik/tools/mrpt/build/lib/libmrpt-obs.so.1.9

Now after rebuilding mrpt in Debug mode, this SegFault too doesn't occur anymore, and I can run everything properly.

(I'm using PCL 1.8 binaries on 18.04)

@EduFdez
Copy link
Contributor Author

EduFdez commented Jul 4, 2018

That's great! Now you can continue working on the project, and we may try later to solve the problem to build in Release mode.

@EduFdez
Copy link
Contributor Author

EduFdez commented Jul 12, 2018

Hi @karnikram
When you call a function that is time consuming, like CPlaneMatchingConfig::startCalib() you should call it in another thread, so that you do not lock the GUI, and the user can still visualize the rawlog content and the progress of the calibration.
Check out the method mrpt::system::createThreadFromObjectMethod

@karnikram
Copy link

I believe mrpt::system::createThreadFromObjectMethod and threads.h have been removed from master.
Shall I do it with std::thread?

@jlblancoc
Copy link
Member

jlblancoc commented Jul 12, 2018 via email

@EduFdez
Copy link
Contributor Author

EduFdez commented Jul 25, 2018

Hi @karnikram
There is a bit less than 3 weeks for the GSoC conclusion. To sum up about the progress so far:

  • The GUI has a good shape and it's operational.
  • Segmentation and visualization of features works only for planes (implementation for lines required)
  • The back-end calibration methods have not yet been implemented (plane-matching, line matching, sensor ego-motion. All required)
  • Tests should be demonstrated with the datasets: "moving_checkerboard.rawlog" and "livingroom.rawlog"
  • Code documentation is quite advanced (doxygen).

You almost have it @karnikram , just a final push is needed!

@karnikram
Copy link

karnikram commented Jul 25, 2018

Hi @EduFdez,

Calibration by plane-matching will be implemented fully and tested on the datasets by this week.
I will then work on line matching, which could take a week. But I'm not confident of implementing calibration by trajectory matching, since like we discussed, there are also some important changes to be done to the gui (visualizing datasets with more than two sensors, fixing the threads issue, config file re-loading/writing), and writing tutorials on how to use the app.

@EduFdez
Copy link
Contributor Author

EduFdez commented Jul 25, 2018

Calibration from ego-motion is one of the most important requirements of the project. You should try to speed up in the calibration from planes/lines and try to finish it this week in order to address the ego-motion method next week.

@karnikram
Copy link

Update:

Plane extraction and matching for the first algorithm, line extraction and matching for the second algorithm are done along with their visualizations. I've now started testing them and am integrating the rotation and translation solvers for both. I hope to finish it in a couple of days, with @EduFdez 's help!

After that I will start to gather the documentation and write unit tests for the algorithms and fix some gui issues.

@EduFdez
Copy link
Contributor Author

EduFdez commented Aug 6, 2018

Cool! I will start testing them this evening. And I will include the translation solver and global solver functions for plane-based calibration, then you can adapt it to line-based calibration.

Regarding the creation of unit-tests you need to follow the guidelines of MRPT. What I normally do is to create unit tests whenever I find I recurrent bug or failure that is likely to happen again upon some code modifications. So, my advice is that you take the 2 datasets that I gave you and you make a good downsampling of them with rawlog-edit to extract 6-10 observations (separated away along the original dataset) into a new dataset. You will use these 2 new datasets for the tests, so that you can load them, do the different calibrations, and tests that the results are around some given values (for different initializations).

@karnikram
Copy link

Final Work Product Link - MRPT/autocalib-sensor-extrinsics#1

Will continue to fix other issues now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants