Introduction
Build a mobile telepresence robot with bidirectional HD video, audio, and remote navigation via web browser. This comprehensive guide covers everything from design through implementation, testing, and deployment.
Build a mobile telepresence robot with bidirectional HD video, audio, and remote navigation via web browser.
Build a mobile telepresence robot with bidirectional HD video, audio, and remote navigation via web browser. This comprehensive guide covers everything from design through implementation, testing, and deployment.
WebRTC (Web Real-Time Communication) enables browser-to-browser video calls without plugins. Use Janus WebRTC gateway on server. On Raspberry Pi: stream camera via GStreamer pipeline → RTSP → Janus → WebRTC. Operator opens web interface in Chrome → sees HD video feed with < 200ms latency. Latency breakdown: camera capture (33ms at 30fps), encoding (10ms H.264 hardware encoder on Pi 4), network (30–100ms on WiFi), decoding (5ms). Total: 80–140ms — acceptable for teleoperation.
10 components required for this project.
| # | Component | Purpose | Qty |
|---|---|---|---|
| 1 | Raspberry Pi 4 (4GB) | Main computing and WebRTC streaming | x1 |
| 2 | USB HD Webcam (1080p) | Remote attendee video stream | x1 |
| 3 | Pan-Tilt Servo Mechanism | Camera direction control | x1 |
| 4 | Speaker (3W) + Microphone | Bidirectional audio | x1 |
| 5 | Differential Drive Base | Mobile platform | x1 |
| 6 | 7" Touchscreen LCD | Remote operator face display | x1 |
| 7 | Arduino Nano (motor control) | Serial motor interface | x1 |
| 8 | WiFi Router (Hotspot) | Reliable network for video | x1 |
| 9 | 12V 10Ah Battery | Extended runtime (4+ hours) | x1 |
| 10 | 4G Dongle (backup) | Internet connectivity outside office WiFi | x1 |
Follow these 3 steps carefully.
WebRTC (Web Real-Time Communication) enables browser-to-browser video calls without plugins. Use Janus WebRTC gateway on server. On Raspberry Pi: stream camera via GStreamer pipeline → RTSP → Janus → WebRTC. Operator opens web interface in Chrome → sees HD video feed with < 200ms latency. Latency breakdown: camera capture (33ms at 30fps), encoding (10ms H.264 hardware encoder on Pi 4), network (30–100ms on WiFi), decoding (5ms). Total: 80–140ms — acceptable for teleoperation.
Web control panel (joystick or WASD keys) sends movement commands via WebSocket to Pi. Pi serializes commands and sends to Arduino: 'F150' = forward at 150 PWM. Arduino parses commands and drives motors. Implement command timeout: if no command received for 500ms → stop (network drop safety). Acceleration ramping on Arduino: don't jump from 0 to 150 PWM instantly — ramp at 10 PWM per 50ms for smooth motion.
The local 7" screen should show the remote operator's face when they're calling. Receive remote video stream and display full-screen. Add face detection (OpenCV Haarcascade) to crop and zoom face region — makes the displayed face larger and more impactful. At correct height (eye level of local person), the telepresence experience feels more natural — the remote person appears to be looking at you.
Core code for telepresence_server.py:
import asyncio, websockets, json, serial
ser = serial.Serial('/dev/ttyUSB0', 9600)
async def handle_client(websocket, path):
async for message in websocket:
cmd = json.loads(message)
if cmd['type'] == 'move':
left = int(cmd['left'] * 255)
right = int(cmd['right'] * 255)
ser.write(f"M{left:+04d}{right:+04d}\n".encode())
elif cmd['type'] == 'camera':
pan = cmd.get('pan', 90)
tilt = cmd.get('tilt', 90)
ser.write(f"C{pan:03d}{tilt:03d}\n".encode())
elif cmd['type'] == 'ping':
await websocket.send(json.dumps({'type': 'pong', 'time': cmd['time']}))
asyncio.get_event_loop().run_until_complete(
websockets.serve(handle_client, '0.0.0.0', 8765))
asyncio.get_event_loop().run_forever()
Test Telepresence Robot by verifying each subsystem individually before full integration.
Verify power voltages, check ground connections, use serial monitor for debug.
An interactive simulator will be available here — simulate circuits and run code in-browser without hardware.