laxnpander / OpenREALM

OpenREALM is a pipeline for real-time aerial mapping utilizing visual SLAM and 3D reconstruction frameworks.
GNU Lesser General Public License v2.1
453 stars 117 forks source link

How to debug OpenREALM by launching *.launch file #91

Closed howz-chen closed 1 year ago

howz-chen commented 1 year ago

Hi, laxnpander , I am new to C++, and I install the environment and run the demo successfully before. And now I want to add some function into it , but I am confused about how to debug info OpenREALM code, such as ~/OpenREALM/modules/realm_stages/src/pose_estimation.cpp, and now I can only launch alexa_gnss.launch with vscode and debug code which about ROS node. So, I want to ask you that when you develop this great project, how do you debug it? And I hope you can help me with more details, such as

  1. How to start the whole process and debug into source code(such as *.cpp mentioned above)
  2. "OpenREALM main library", and if I want to do something different(such add functions), what need I do?

Looking forward to your reply, thanks in advance. @laxnpander

Kt-Janice commented 1 year ago

Hi!Did you solve it? I wanted to call OpenREALM to do something else, but I couldn't just replace the dataset with my own photos.

howz-chen commented 1 year ago

Hi!Did you solve it? I wanted to call OpenREALM to do something else, but I couldn't just replace the dataset with my own photos.

Hi, I try to add some simple function to whole project and did it successful. Step as below:

  1. Try to debug OpenREALM_ROS1_Bridge, and find corresponding function(maybe exist in OpenREALM project), and familiar with flowchart.
  2. Edit the source code (*.cpp in OpenREALM). This process is a bit tedious and requires patience to find the calling relationship and process flow. You can add some log info to help debug code. Especially attention the declaration of a function or variable.
  3. When you finish your code, then compile OpenREALM first, and then compile OpenREALM_ROS1_Bridge(just as steps of installation in this position and this position), and you can launch the *.launch file to test your new function.

Finally, if you just want to replace your own dataset, just change the path as the author said

laxnpander commented 1 year ago

@howz-chen explained it quite well. I think you will understand I can not teach you how to code c++ here or use cmake and ROS. The important part is knowing when to change the ROS1 bridge and when to change the main library. I guess in 95% of the cases you are interested in changing the main lib to do something it can't. Just follow the quick start as a starting point on how to build the main lib.

Reopen if questions persist.