This thought experiment shows why robot localization, the task of maintaining a location position as robots move around, and obstacle avoidance, is so critical to the success of all non-stationary robots.
From Alexander Shtuchkin:
Code & schematics for position tracking sensor using HTC Vive's Lighthouse system and a Teensy board.
General purpose indoor positioning sensor, good for robots, drones, etc.
3d position accuracy: currently ~10mm; less than 2mm possible with additional work.
Update frequency: 30 Hz
Output formats: Text; Mavlink ATT_POS_MOCAP via serial; Ublox GPS emulation (in works)
HTC Vive Station visibility requirements: full top hemisphere from sensor. Both stations need to be visible.
Positioning volume: same as HTC Vive, approx up to 4x4x3 meters.
Cost: ~$10 + Teensy 3.2 ($20) (+ Lighthouse stations (2x $135))
Skills to build: Low complexity soldering; Embedded C++ recommended for integration to your project.
Midwest Motion Products, Inc. (MMP), is a well-established, healthy, & growing Family Owned Business, founded in 2001. MMP specializes in cost-effective standard DC Gearmotors, Motors, Controls, and ancillary equipment. Known world-wide for our "Lightning Fast" delivery capabilities, you can have a Standard Planetary or Right Angled DC Gearmotor BUILT and SHIPPED, often on the very same day you call. Offering Brushed and Brushless designs, with winding voltages ranging from 12 VDC to 120 VDC, we can deliver your "Robust & Reliable" samples within HOURS, instead of weeks, or even months.