ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to build rtabmap_ros?

asked 2017-07-10 11:01:17 -0500

Mikhail gravatar image

I'm trying to change rtabmap functionality a bit (just for start, maybe will develop a separate module later). So I installed ROS kinetic, rtabmap and sources in accordance with . I'm trying to insert printfs into CoreWrapper::onInit() and ObstaclesDetection::onInit() in ~/catkin_ws/src/rtabmap_ros/src/CoreWrapper.cpp and ~/catkin_ws/src/rtabmap_ros/src/nodelets/obstacles_detection.cpp. But when I run

~/RTAB-Map/rtabmap/build$ sudo make install


~/catkin_ws$ catkin_make -j1

nothing interesting happen. Make install did something before — rebuilt much more, but now — only

[  5%] Built target rtabmap_utilite
[  6%] Built target res_tool
[ 37%] Built target rtabmap_core
[ 80%] Built target rtabmap_gui
[ 82%] Built target rtabmap
[ 93%] Built target bow_mapping
[ 95%] Built target rgbd_mapping
[ 98%] Built target wifi_mapping
[100%] Built target noEventsExample
Install the project...
-- Install configuration: "Release"

And that everything is up-to-date.

How should I make my code replacing installed rtabmap_ros and run?

Sorry if a lame question, I am not well versed in ROS, Linux and build systems. Mainly work on Windows in Visual Studio. Fresh Ubuntu 16.04. I run rtabmap_ros by running



rosbag play --clock stereo_outdoorA.bag
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-07-10 13:58:08 -0500

matlabbe gravatar image

If you modify code in rtabmap_ros package, you don't have to rebuild rtabmap, just redo catkin_make. I think you are meaning:

$ roslaunch rtabmap_ros demo_stereo_outdoor.launch

Note also that obstacles_detection nodelet is not started with demo_stereo_outdoor.launch. However, you should see your printfs added in CoreWrapper. You can copy/paste the terminal output after launching the launch file in your question for more info, normally onInit() printfs would appear at start.


edit flag offensive delete link more


@matlabbe, yes, roslaunch, exactly. Please clarify what you mean by catkin_make? I re-read tutorial about it ( ) and started to suspect that catkin_make is only a first stage, generation of some scripts, and I need some

Mikhail gravatar image Mikhail  ( 2017-07-10 14:56:32 -0500 )edit

build and/or install command, but still not sure which exactly

Mikhail gravatar image Mikhail  ( 2017-07-10 14:57:30 -0500 )edit

"catkin_make -DCMAKE_BUILD_TYPE=Release This will build any packages in the source space (~/catkin_ws/src) to the build space (~/catkin_ws/build)." It doesn't look like it build something "Any source files, python libraries, scripts or any other static files will remain in the source space.

Mikhail gravatar image Mikhail  ( 2017-07-10 14:59:54 -0500 )edit

However, any generated files such as libraries, executables, or generated code will be placed in the devel space" Devel? Then for why to mention build?...

Mikhail gravatar image Mikhail  ( 2017-07-10 15:00:30 -0500 )edit

catkin_make is used at initialization to setup your workspace. It should be redone every time you change the code to rebuild your nodes. For basic usage, you would never use "catkin_make install", just "catkin_make".

matlabbe gravatar image matlabbe  ( 2017-07-11 10:23:07 -0500 )edit

See this for a description of the workspaces:

matlabbe gravatar image matlabbe  ( 2017-07-11 10:23:22 -0500 )edit

"src" contains your source code. "build" contains the compiled object files. "devel" contains the built binaries/libraries.

matlabbe gravatar image matlabbe  ( 2017-07-11 10:24:15 -0500 )edit

catkin_make is used at initialization to setup your workspace. It should be redone every time you change the code Such things are what I don't understand. Why only changing of one library (not its external interface, but something simple, say additional printf) requires remake of scripts?...

Mikhail gravatar image Mikhail  ( 2017-07-11 12:48:42 -0500 )edit

Question Tools

1 follower


Asked: 2017-07-10 11:00:55 -0500

Seen: 933 times

Last updated: Jul 10 '17