Skip to content

Basic Console Usage

Florian Tschopp edited this page Jun 28, 2019 · 1 revision

Install MapLab and make sure to compile the console:

cd ~/catkin_ws
catkin build maplab

Make sure that your development environment is correctly sourced:

source ~/catkin_ws/devel/setup.bash

You can now launch the MapLab console with

rosrun maplab_console maplab_console

This command requires a running roscore for visualization. If the program gets stuck looking for the roscore, you can abort the search with Ctrl-C. (You can start a roscore with roscore&.)

If you want to start MapLab in a ros-free environment, you can use the rosfree flag:

rosrun maplab maplab --ros_free

You should now be greeted with the MapLab console prompt:

Console Prompt

The console supports tab completion and a command history, which can be accessed with the arrow keys or Ctrl-P and Ctrl-N.

MapLab can have multiple maps loaded in its database at the same time. Each map has a unique name, called the map key. The command prompt indicates the currently selected map inside the orange brackets (if there's no content in the brackets, then no map is currently active). All commands operate on the selected map.

Creating and Loading a Map

You can create a new, empty map with the key my_empty_key using

create_new_map --map_key my_empty_key

Note that map keys can only contain alphanumeric characters as well as hyphen (-) and underscore (_) characters. Other characters are disallowed.

You can also load a map from the file system. To load the map included in the test data repository, you can use

load --map_folder ~/catkin_ws/src/maplab/tools/maplab_test_data/test_maps/vi_app_test/

Note: the folder vi_map, in which the actual map data is stored, doesn't need to be specified.

By default, the map key is automatically generated from the path, in this case the key will be vi_app_test. You can manually define the key under which the map should be stored in MapLab by using the map_key flag when using load.

After loading or creating a new map, MapLab automatically change the selected map to the new map.

After doing the two operations, your console output should look like this:

Creating and loading a map

Notice, how after the load operation, the loaded map (with the key vi_app_test) has automatically been selected.

Inspecting and Visualizing a Map

You can use the ms (map statistics) command to get information about the selected map. In the case of the vi_app_test map, the output of ms should look like this:

VI-Map:

Mission 0:              c7957efb9cf29d4874676106d6beb551  Viwls
  Vertices:             405
  Landmarks:            8359
  Landmarks by first observer backlink:
  Camera 0:             8359 (g:0 b:0 u:8359)
  Observations:         174464
  Distance travelled [m]:  23.406851
  Start to end time:    1970_01_01_03_13_13 to 1970_01_01_03_13_53
  T_G_M                 unknown

To visualize a map, use the v (visualize) command. You can then look at the map in rviz. Make sure you have a roscore running and start rviz in a new terminal with

rosrun rviz rviz

On the left side, click the Add button and select the data you want to visualize. Selecting Marker from vi_map_edges and PointCloud2 from vi_map_landmarks (both in the by topic tab), should give you a view similar to this:

RViz Visualization

Listing All Loaded Maps and Changing the Selected Map

Use ls to list all maps that are loaded in the current MapLab session. The selected map will be highlighted in green.

Listing Maps

ls lists all map keys and shows the map's respective map folder next to here. Check out TODO to learn more about the map folder.

To change the selected map, use the select command. E.g. you can do

select --map_key my_empty_map

Note that the map key in the orange brackets should change to show the newly selected map:

Select Map

Getting Help

To get information about the available commands, you can use the help command. When no argument is provided, help will list all installed plugins and tell you how to get more help.

Help

  • Use help --all to get a description of all available commands.

  • Use help --plugin <plugin_name> to get a description of the commands provided by the plugin plugin_name. E.g., type help --plugin console to see the commands provided by the console plugin:

    Help for Plugin

  • Use help --command_filter <search_term> to search all command names and descriptions for search_term. You can optionally add the plugin flag to limit the search to commands provied by a given plugin.

Exiting MapLab

To exit MapLab, you can type q or exit.

Clone this wiki locally