Remote Debugging Car Navigation Software with Thrift and a PC Simulator
This article explains how to overcome the limitations of PC‑based simulators for in‑vehicle navigation development by using a Thrift‑based proxy (Sandwich) to forward car‑side signals to a PC, enable bidirectional debugging, and project map rendering back to the vehicle display.
Background
In automotive software development, debugging is essential, but embedded systems lack the rich visual debugging tools available on desktop operating systems. Navigation applications, which involve complex interactions between the vehicle’s HMI and various modules, benefit greatly from a visual debugging environment.
Challenges with Existing PC Simulators
Developers built a PC‑based simulator that renders maps and a command‑sending tool to interact with the navigation service. However, this approach has several drawbacks:
Only simple business scenarios can be simulated; complex multi‑module interactions cannot.
The tool cannot manipulate the map HMI or view its feedback.
Map scrolling is implemented with Win32 mouse events, which differ from the vehicle’s scrolling logic.
PC cannot access vehicle hardware such as audio output, USB, or vehicle data (e.g., chassis information, GPS signals).
Optimized Debugging Solution
To address these issues, a proxy program called Sandwich was introduced inside the vehicle. Sandwich starts a placeholder navigation service that allows other vehicle modules to connect, while acting as a client to the PC simulator’s navigation service. This enables the PC simulator to receive real vehicle signals and send processed results back via Thrift.
1. PC Simulator Receives Signals from the Vehicle
When a vehicle module sends a request to the navigation service, Sandwich forwards the request to the PC simulator, which processes it and returns the response through Thrift. This creates a bidirectional communication channel between the vehicle and the PC.
2. PC Simulator Sends Signals to the Vehicle
The navigation software on the PC also needs to call vehicle services (e.g., retrieve chassis data, GPS, or send audio data). Sandwich acts as a client to these vehicle services, forwarding the PC’s requests and responses, allowing the navigation audio to be played through the vehicle’s sound module.
3. Projecting PC‑Rendered Maps to the Vehicle Display
To visualize the navigation map on the vehicle screen, each rendered frame on the PC is transmitted as pixel data to Sandwich, which then renders it on the vehicle display. This approach keeps the navigation logic on the PC while the vehicle only forwards the visual output, avoiding synchronization issues that arise when both sides run full navigation logic.
Performance considerations include reducing image size (e.g., using 16‑bit or 8‑bit BMP, compressing data) to keep transmission bandwidth around 30‑50 KB per 1920×720 frame, mitigating latency in high‑frequency rendering scenarios.
Conclusion
The Thrift‑based remote debugging framework, centered on the Sandwich proxy, enables developers to use real vehicle signals for debugging navigation software on a PC. This setup allows on‑vehicle road testing with immediate debugging feedback, dramatically improving development efficiency. Future enhancements could add multi‑client support, letting multiple engineers debug different modules simultaneously on the same vehicle.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Amap Tech
Official Amap technology account showcasing all of Amap's technical innovations.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
