how to config IDE for debugging rtabmap application

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

how to config IDE for debugging rtabmap application

m.omar82
Dear friends
what is the IDE used for development rtabmap? and how can I make debugging application example rtabmap-console application?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: how to config IDE for debugging rtabmap application

matlabbe
Administrator

Hello,

I use Eclipse C++ for development. There is already an Eclipse project in the rtabmap and rtabmap_ros git repositories. Just open Eclipse, File->Import... -> "Existing project...". You should call cmake in a console to setup the makefiles before building with Eclipse. However, I don't use a debugger to debug, only output logs because of the ROS development and that rtabmap has some threads (camera, core and gui). You may see many UDEBUG() in the code. They are shown when the logger level is set to Debug (in the Preferences menu -> General Settings -> Logging -> Logger level).

In C++:
#include <rtabmap/utilite/ULogger.h>
...
ULogger::setType(ULogger::kTypeConsole);
ULogger::setLevel(ULogger::kDebug); // (can be called anywhere)
...
 

There are also UINFO, UWARN, UERROR, UFATAL, UASSERT... working like a printf(), they have the same purpose as ROS_INFO, ROS_WARN... for ROS developpers.


If you build rtabmap in Debug, you could run it in gdb.
$ cd rtabmap/build
$ cmake -DCMAKE_BUILD_TYPE=Debug ..
$ make
$ cd ../bin
$ gdb rtabmap-console myImages
(gdb) run

Regards,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: how to config IDE for debugging rtabmap application

m.omar82
Thanks for your replay it is very helpful

and to work in good debugging environment I suggest to update gcc and gdb:


sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9



 reboot the PC


wget http://ftp.gnu.org/gnu/gdb/gdb-7.8.tar.xz
tar -xf gdb-7.8.tar.xz    
cd gdb-7.8/    
./configure
make
sudo make install

 reboot the PC
Reply | Threaded
Open this post in threaded view
|

Re: how to config IDE for debugging rtabmap application

GrainLee
In reply to this post by matlabbe
I don't know how to call cmake in console , can you describe more detailed