[Documentation] [TitleIndex] [WordIndex

The Bag Database

Server for indexing and searching bag files


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.



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 \

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" \

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 is done through a combination of setting Docker volumes and environment variables at the time the container is created.


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


The location which will be monitored for bag files.


The location where Tomcat places its log files.

Environment Variables

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


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.


The class name of the JDBC driver to use.


The password to use when connecting to the database.


The JDBC URL for connecting to the database.


The username to use when connecting to the database.


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.


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


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


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


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.


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.

2020-09-12 12:26