lg_ros_nodes
lg_ros_nodes copied to clipboard
lg_sv: Preserve single Map() instance
Overview:
Today's lg_sv
implementation creates and destroys Chrome browser windows every time Street View is opened and closed on Roscoe Liquid Galaxies. Now that Maps API usage is metered, it would be very valuable to maintain Map()
instances for as long as feasible. We can modify lg_sv
to send Street View browser windows to the background instead of destroying them.
Requirements:
- Significant reduction in Google Maps API usage during common LG utilization, specifically fewer
Map()
instantiations - Change
lg_sv
ROS node to "hide" Chrome browser windows instead of destroying them when closing Street View. And reveal them when Street View opens. - When the Street View browsers are not visible, suspend SpaceNav input coming into
server.py
. Resume once the browsers are visible. -
lg_sv
Browser launcher nodes must begin in the "STOPPED" state so it never loads the Maps API until we open Street View for the first time (after relaunching).
Development notes
In most places where we set the state to STOPPED
we should instead set to state HIDDEN
. Example:
https://github.com/EndPointCorp/lg_ros_nodes/blob/master/lg_sv/scripts/server.py#L106
Every time we set a state other than VISIBLE
, that's the time to suspend SpaceNav input to the PanoViewerServer
class.
Contact @mvollrath for help with this codebase.
Testing scenario On a system with heavy Street View usage, see if its Maps API key has greatly reduced utilization. We expect at most one API request per display per relaunch (plus 1-3 from the touchscreen.) There should be zero API requests generated entering and exiting Street View after the first time after a relaunch.
Watch the ROS topic /streetview/state
for state changes.