Examples

The SLAMcore C++ API provides some examples to illustrate different use cases and best practices, in addition to a minimal CMakeLists.txt to show how to include the library in a project.

Once the SLAMcore package is installed, this example source code should be available at /usr/src/slamcore/examples by default.

A user can build them as follows:

mkdir /tmp/slamcore_examples
cd /tmp/slamcore_examples
cmake /usr/src/slamcore/examples
make

Find below a list of the included examples.

  • Example hello_world_all_streams.cpp:

    Shows how to create and interact with the SLAM system. How to enable and use data streams, read properties and receive and display data in a loop.

  • Example multisession.cpp:

    Demonstrates how to set up and run a SLAM system in multisession mode, which means how to perform SLAM with an already saved session file from another execution of the software.

  • Example reset.cpp:

    One restriction is that only one SLAM system can exist at any given time. If the user wishes to reset it to start processing a data source cleanly, the common practice is to delete the current system and create a new one.

  • Example save_load_session.cpp:

    Demonstrates how to save a session using an async task and how to load it back.

The source code can be visited as part of this documentation.