Running in a Tomcat Server
Building
The bag database is a Spring-based web application that requires Java 11 or later and has been tested in Tomcat 9.
To compile it, you need JDK 11.0 or later and Maven 3.0.5 or later. To build a WAR package, run:
mvn package
This will produce a WAR file that is suitable for deploying to a Tomcat 9 application server.
Tomcat Configuration
- Start up a PostgreSQL server; create an empty database and a user with access to it.
- Start up your application server and deploy the WAR file to it. The easiest way to do this is to copy the WAR file into Tomcat’s
webapps
directory. - The bag database will automatically create a directory at
${HOME}/.ros-bag-database
and place its configuration inside there, where${HOME}
is the home directory of the user that thetomcat
service is running as. -
Edit
${HOME}/.ros-bag-database/settings.yml
and set your configuration, then restart the application. Here’s an example of a valid config file; keys you don’t want to set can be omitted.!com.github.swrirobotics.support.web.Configuration bingKey: PKnOQDvUxRJ0bEZdBH7m dockerHost: http://localhost:2375 driver: org.postgresql.Driver googleApiKey: PKnOQDvUxRJ0bEZdBH7m gpsTopics: - /localization/gps - /gps - /vehicle/gps/fix jdbcPassword: letmein jdbcUrl: jdbc:postgresql://bagdb-postgres/bag_database jdbcUsername: bag_database useBing: true useMapQuest: false vehicleNameTopics: - /vms/vehicle_name
- Look inside the log file at
${TOMCAT_HOME}/logs/bag_database.log
to find the automatically-generated administrator password. - Log in through the GUI and use the Maintenance panel to change the password.
- Note that in order for video streaming to work,
ffmpeg
version 3 or higher must be available on the system path.