[Documentation] [TitleIndex] [WordIndex

The Bag Database

Server for indexing and searching bag files

Overview

The Bag Database is not a ROS package, but rather a standalone server that is designed to analyze bag files and provide an intuitive web-based user interface for searching through and downloading them. It is written in Java with Hibernate and Spring, and it uses a PostgreSQL database with PostGIS extensions for storing data.

TheBagDatabase/bag-database.png

Installation

Installing The Bag Database is most easily done by setting it up as a Docker container. If you are unfamiliar with it, Docker is a container-based virtualization system; I highly recommend going through the Get Started With Docker tutorials before proceeding.

The Bag Database requires a PostgreSQL database with PostGIS extensions installed, so first, start up a PostGIS container:

docker run -d \
    --name bagdb-postgres \
    -v /var/lib/bagdb-postgres:/var/lib/postgresql/data \
    -e POSTGRES_PASSWORD=letmein \
    -e POSTGRES_USER=bag_database \
    -e POSTGRES_DB=bag_database \
    mdillon/postgis:latest

Next, start up a container for The Bag Database:

docker run -d \
    -p 8080:8080 \
    -v /bag/location:/bags \
    --name bagdb \
    --link bagdb-postgres:bagdb-postgres \
    -e DB_DRIVER=org.postgresql.Driver \
    -e DB_PASS=letmein \
    -e DB_URL="jdbc:postgresql://bagdb-postgres/bag_database" \
    -e DB_USER=bag_database \
    -e VEHICLE_NAME_TOPICS="/vehicle_name" \
    -e GPS_TOPICS="/localization/gps, /gps, /imu/fix" \
    swrirobotics/bag-database:latest

After starting up, it will immediately begin scanning the bag files at /bag/location, and you can access it at port 8080 in your web browser (i.e., http://localhost:8080/).

Configuration

Configuration is done through a combination of setting Docker volumes and environment variables at the time the container is created.

Volumes

Several volumes within the Docker container may be useful to mount externally:

/bags

The location which will be monitored for bag files.

/usr/local/tomcat/logs

The location where Tomcat places its log files.

Environment Variables

Several environment variables can be set to configure the Docker container:

ADMIN_PASSWORD

The default password for administrative access. If this is not set, one will be randomly generated and printed to the log file on initial startup.

DB_DRIVER

The class name of the JDBC driver to use.

DB_PASS

The password to use when connecting to the database.

DB_URL

The JDBC URL for connecting to the database.

DB_USER

The username to use when connecting to the database.

GOOGLE_API_KEY

A Google API key that has permission to use the Google Maps GeoCoding API; this is necessary in order to resolve place names for GPS coordinates.

USE_BING

Set this to true to use Bing Maps for displaying map imagery; set it to false to disable Bing. The default is false.

BING_KEY

The API key to use when connecting to Bing Maps. You can get a Bing Maps Key from the Microsoft Developer Network.

VEHICLE_NAME_TOPICS

A comma-separated list of std_msg/String topics that will be searched for a vehicle name; the first one found will be used.

GPS_TOPICS

A comma-separated list of topics to search for GPS messages; the first one found will be used. Any message that has the following fields will work:

float64 latitude
float64 longitude
Header header

If there are no topics configured or none of them are found, it will try to use the first topic it can find that publishes the sensor_msgs/NavSatFix, gps_common/GPSFix, or marti_gps_common/GPSFix messages, in that order.

DEBUG_JAVASCRIPT

Set this to true to force the application to load non-minified versions of Javascript files. This will increase load times. The default is false.


2022-05-28 12:23