LVPS Rest Service

This rest service enables robots using the LVPS system to download maps, vision models, and assignments. It also allows the Bot Captain App to have visibility of all robots within LVPS and assign tasks. The source code for this rest service is available here. The service uses a Postgres database. The database contains all maps, models, logs, and other data needed by LVPS.

The LVPS Pilot system, which runs on robots, needs intermittent access to this service. When the pilot starts up, it checks this service for assignments. If there any, the pilot checks its local cache to determine if it already has the maps and models needed to complete the assignment. If necessary, the artifacts will be downloaded so the pilot can complete its assignments. In order to keep a log of positions and views (for later viewing via the Bot Captain app), the pilot will be constantly logging position and images to this service.

Within my reference implementation, I am running this service on a Raspberry Pi CM4 that is also running the pilot software. If you look closely at the finished images of , you will notice it has a white Wifi router mounted to it. That router is its own network, to which any LVPS-powered robots can connect, and then become part of the LVPS network. So that Pi CM4 on MecCar is running the pilot software, postgres, and the rest service. Ideally, the LVPS service would more likely be running on its own hardware, but for me it's more convenient have one of the robots doing double-duty.

The Api

URL Method Name Description
nav_maps GET Nav Maps
Retrieve map meta data for all currently active maps within LVPS
nav_map/
{map_id}
GET Nav Map Retrieve a single map for the given map ID
recognition_model/
{model_id}/
{model_type}/
{model_format}
GET Recognition Model Gets the selected vision model in the selected format (tflite or tf)
vehicles GET Vehicles Returns the list of vehicles/robots currently enabled in the system
recent_sessions/
{vehicle_id}
GET Recent Sessions Returns 10 most recent sessions for the given vehicle
assignments/
{vehicle_id}
GET Assignments Gets sequence of outstanding assignments for the given vehicle
assignment/
{vehicle_id}/
{entry_num}
POST Complete Assignment Marks the specified assignment as complete
assignment_create/
{vehicle_id}
POST Create Assignment Creates a new assignment for the given vehicle. The Bot Captain app uses this, and vehicles can also self-assign.
position_log/
{vehicle_id}/
{session_id}
POST Append Position Log Adds a new position to the given vehicle session log. The vehicle uses this to report its information for tracking
position_log/
{vehicle_id}/
{session_id}
GET Fetch Position Log Returns the latest log of positions for the given robot session
position_views/
{vehicle_id}/
{session_id}
GET Position Views Returns the metadata for all views (images) relating to positioning that were captured during a session
position_view/
{vehicle_id}/
{entry_num}/
{camera_id}
GET Position View Returns base64 encoded image of the specified position view
position_view/
{vehicle_id}/
{entry_num}/
{camera_id}
POST Position Records the given position view image
search_hits/
{vehicle_id}/
{session_id}
GET Position Views Returns the metadata for all views (images) relating to a search that were captured during a session
search_hit/
{object_type}/
{map_id}/
{entry_num}
GET Search Hit Returns base64 encoded image of the specified search view, when a search hit occurred
new_search_hit/
{object_type}/
{vehicle_id}/
{session_id}
POST Search Hit View Records the given search hit view image
lidar_entries/
{vehicle_id}/
{session_id}
GET Lidar Entries Returns the metadata for all LIDAR captures during the session
lidar/
{vehicle_id}/
{session_id}/
{entry_num}
GET Lidar Log Returns the full LIDAR (360°) capture from the given session/entry
lidar/
{vehicle_id}/
{session_id}
POST Lidar Log Records the LIDAR capture to the given session
shutdown POST Shutdown Safely powers down the OS hosting this service

Security

There is no security layer within the service at this point. I am currently just relying on the fact that you'd have to be within distance and need the WiFi password of the LVPS network in order to gain access to the service. I may change this later on, as it wouldn't be difficult, but it's just not a priority right now.