MCPcopy Create free account
hub / github.com/Improbable-AI/VisionProTeleop / VisionProStreamer

Class VisionProStreamer

avp_stream/streamer.py:848–5072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

846
847
848class VisionProStreamer:
849
850 def __init__(self, ip=None, record=True, ht_backend="grpc", benchmark_quiet=False, verbose=False, origin="avp", signaling_url=None, relay_only=False):
851 """Initialize the VisionProStreamer.
852
853 Parameters
854 ----------
855 ip : str
856 Connection identifier. The format determines the connection mode:
857 - IP address (e.g., "192.168.1.100"): Same-network mode via gRPC.
858 - Room code (e.g., "ABC-1234"): Cross-network mode via WebRTC signaling.
859 record : bool, default True
860 If True, every processed hand tracking sample is appended to an internal list retrievable via `get_recording()`.
861 ht_backend : {"grpc","webrtc"}, default "grpc"
862 Transport used for hand tracking. Use "webrtc" for lower latency after a WebRTC session is established.
863 Note: In cross-network mode (room code), hand tracking always uses WebRTC.
864 benchmark_quiet : bool, default False
865 Suppress benchmark printouts (see latency measurements in `latency_test.py`).
866 verbose : bool, default False
867 If True, print detailed status messages. If False (default), only critical messages are shown.
868 origin : {"avp", "sim"}, default "avp"
869 Coordinate frame origin for hand tracking data.
870 - "avp": Hand tracking in Vision Pro's native coordinate frame (default).
871 - "sim": Hand tracking relative to the simulation's attach_to position.
872 Useful when you want hand positions in the same frame as your MuJoCo scene.
873 signaling_url : str, optional
874 Custom signaling server URL for cross-network mode.
875 Default: "wss://visionpro-signaling.<your-subdomain>.workers.dev/ws"
876
877 Notes
878 -----
879 The connection mode is automatically inferred from the `ip` parameter:
880 - If it looks like an IP address (e.g., "192.168.1.100"): Local/same-network mode.
881 - If it looks like a room code (e.g., "ABC-1234"): Cross-network mode.
882
883 Examples
884 --------
885 Same-network (IP address)::
886
887 streamer = VisionProStreamer(ip="192.168.1.100")
888
889 Cross-network (room code)::
890
891 streamer = VisionProStreamer(ip="ABC-1234")
892 """
893
894 # Validate required parameter
895 if not ip:
896 raise ValueError("Must specify ip= parameter (IP address for local mode, or room code for cross-network mode)")
897
898 # Determine connection mode based on ip format
899 self._cross_network_mode = _is_room_code(ip)
900 self._room_code = ip if self._cross_network_mode else None
901 self._signaling_url = signaling_url or "wss://visionpro-signaling.parkyh9492.workers.dev/ws"
902 self._signaling_ws = None
903 self._signaling_connected = False
904 self._peer_ready = False # Track if VisionOS peer has joined
905

Callers 15

connect_avpFunction · 0.90
mainFunction · 0.90
run_frequency_sweepFunction · 0.90
run_body_count_sweepFunction · 0.90
run_continuous_testFunction · 0.90
run_roundtrip_testFunction · 0.90
run_benchmarkFunction · 0.90
run_sweepFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by 5

mainFunction · 0.72
run_frequency_sweepFunction · 0.72
run_body_count_sweepFunction · 0.72
run_continuous_testFunction · 0.72
run_roundtrip_testFunction · 0.72