How to use MRPT libraries from a ROS node?

1. In short:

Install the mrpt_common stack.

Simply declare mrpt_libs as a ROS dependency of your node in the manifest.xml. When creating a new package, just append mrpt_libs to the list of dependencies, for example:
No further modifications are needed: you don’t have to touch your CMakeLists.txt file.

2. Ready-to-use examples

Refer to the   directory within the MRPT source tree.
To build and test the sample ROS (C++) nodes which use MRPT classes, follow the step-by-step instructions (also in the README file):

2.1. Preparation:

Set-up your ROS environment to find the tutorial packages:

2.2. Build example nodes:

2.3. Execute and test them:

In a console, launch “roscore“. In another one:

Optionally, in another console run: