Skip to content
 
 

Repository files navigation

Mini-SLAM

Authors: Juan J. Gómez Rodríguez, Víctor M. Batlle

Minimal implementation of a SLAM system for the practical assignment of the SLAM course.

Installation

1. Install Docker

Install Docker using your preferred method. If you are not sure where to start, below are some recommended options depending on your host operating system:

2. Install VS Code

Install Visual Studio Code on your host machine.

3. Install an X server (Windows/macOS only)

Windows (using VcXsrv)
  1. Install an X server like VcXsrv
  2. Start it with:
    • Set display number to :0;
    • Uncheck Native opengl;
    • Check Disable access control;
Windows (using WSL2)
  1. Open PowerShell as administrator (search for "PowerShell", right-click, and select Run as administrator).
  2. Run wsl --install.
  3. In Docker Desktop, go to Settings > Resources > WSL Integration and enable it.
  4. Replace .devcontainer/devcontainer.windows.json by .devcontainer/devcontainer.wsl2.json before opening VS Code.
macOS (using XQuartz)
  1. Open a Terminal on your macOS host.
  2. Run brew install --cask xquartz (if you do not have Homebrew installed, see instructions here).
  3. Run open -a XQuartz.
  4. Go to XQuartz > Settings... > Security and ensure Allow connections from network clients is enabled.
  5. Reboot your computer.

4. Open folder in VS Code

Clone this repository:

git clone https://github.com/universidad-zaragoza/Mini-SLAM.git

Launch VS Code and go to File > Open Folder..., then select your Mini-SLAM folder.

Click on Yes, I trust the authors when prompted.

VSCode Yes, I trust the authors

On start-up, VS Code will copy the corresponding devcontainer.[windows|linux|darwin].json to .devcontainer/devcontainer.json. You might need to do that manually if the automatic copy fails.

5. Install recommended extensions

Click Install to add the recommended VS Code extensions.

VSCode install recommended extensions

If you do not get this prompt, you may have already installed all the recommended extensions.

6. Reopen the workspace in a Docker container

Click Reopen in Container. The first time you do this, it may take up to an hour to set up the container, depending on your machine.

VSCode Reopen in Container

If you do not get this prompt, you can click the bottom-left corner Open a Remote Window (Open a Remote Window) and select Reopen in Container.

Running Mini-SLAM

From now on, every time you open your Mini-SLAM folder in VS Code, you can immediately choose Reopen in Container from the pop-up or via the connect menu in the bottom-left corner: Open a Remote Window

You can follow the steps provided in the SLAM course handout for each lab and run everything from the terminal. However, this section explains how to make full use of VS Code’s debugging capabilities for your applications (highly recommended).

1. Select the target

In the CMake menu, use Build All Projects and Set the Launch/Debug Target (right-click) for each lab. To define new targets in the future, edit CMakeLists.txt inside the Apps/ folder:

set(PROGRAM_NAME mono_tumrgbd)
add_executable(${PROGRAM_NAME} mono_tumrgbd.cc)
target_link_libraries(${PROGRAM_NAME} ${OpenCV_LIBS} mini_slam)

CMake menu

2. Launch / Debug

First, download the datasets required for each lab (example fr1_xyz) and place the uncompressed folders inside Datasets/. Then, run the app from VS Code Run > Start Debugging.

If you are unfamiliar with using VS Code for debugging, take a look at the guide Debug code with Visual Studio Code. Skip the video (it is too long) and just read how to start a debug session, set breakpoints, and perform data inspection.

We already provide two example launch configurations in .vscode/launch.json.

You should see two windows similar to the following:

Mini-SLAM Image and Map viewers

When you are done developing your application, go to the CMake menu and change the Configure setting from Debug to Release. Rebuild and run your target.

Troubleshooting

  • If you encounter an error while loading shared libraries, try running sudo ldconfig before executing your application.

  • To execute the SLAM system frame by frame, go to MiniSLAM.cc and uncomment the following lines:

    // Uncomment for step by step execution (pressing the Esc key)
    while ((cv::waitKey(10) & 0xEFFFFF) != 27) {
        mapVisualizer_->update();
    }

About

Minimal implementation of a SLAM system for the practical assignment of the SLAM course.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages