Advertisement
Intermediate Time: 3–4 weeks Robotics

Telepresence Robot

Build a mobile telepresence robot with bidirectional HD video, audio, and remote navigation via web browser.

TelepresenceWebRTCROSRaspberry PiPan-Tilt CameraRemote Control
DifficultyIntermediate
Duration3–4 weeks
Components10 items
Steps3 steps

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.

Theory & Background

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.

Advertisement

Components & Requirements

10 components required for this project.

#ComponentPurposeQty
1Raspberry Pi 4 (4GB)Main computing and WebRTC streamingx1
2USB HD Webcam (1080p)Remote attendee video streamx1
3Pan-Tilt Servo MechanismCamera direction controlx1
4Speaker (3W) + MicrophoneBidirectional audiox1
5Differential Drive BaseMobile platformx1
67" Touchscreen LCDRemote operator face displayx1
7Arduino Nano (motor control)Serial motor interfacex1
8WiFi Router (Hotspot)Reliable network for videox1
912V 10Ah BatteryExtended runtime (4+ hours)x1
104G Dongle (backup)Internet connectivity outside office WiFix1

Step-by-Step Implementation

Follow these 3 steps carefully.

1
WebRTC Video Streaming Setup

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.

2
Motor Control via WebSocket

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.

3
Face Detection for Local Display

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.

Code & Implementation

Core code for telepresence_server.py:

telepresence_server.py Python
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()

Testing & Troubleshooting

Test Telepresence Robot by verifying each subsystem individually before full integration.

!
Troubleshooting Tips

Verify power voltages, check ground connections, use serial monitor for debug.

Real-World Applications

*Remote office attendance during remote work
*Medical specialist consultation (teleconsultation)
*Security and facility monitoring
*Elderly relative presence at family events
*Remote education classroom participation
*Construction site remote inspection
*Customer service presence in retail
*Scientific expedition remote participation

Extensions & Next Steps

  • Add autonomous navigation between pre-mapped locations
  • Implement privacy mode (auto-stop video in specified rooms)
  • Add multi-user control with priority queue
  • Build a follow-me feature using person tracking
  • Integrate with VR headset for immersive operator experience

Interactive Playground

Coming Soon

An interactive simulator will be available here — simulate circuits and run code in-browser without hardware.

Frequently Asked Questions

What internet speed is required for reliable telepresence?
For smooth 720p HD video + audio telepresence: minimum 3 Mbps upload (robot → operator) and 1 Mbps download (operator → robot display). 1080p: 6 Mbps upload recommended. WebRTC automatically adapts video quality to available bandwidth — on congested network it reduces resolution rather than dropping frames. For office WiFi telepresence: standard 802.11ac WiFi (20+ Mbps) is more than sufficient. Critical: minimize packet latency, not just bandwidth — use 5GHz WiFi band to reduce interference.
Advertisement