Download examples/hf-operator/stream.py from TomPei/csg-robomaster: direct link, hf CLI and curl.
- Browser
- Download file 680 Bytes
-
https://huggingface.co/datasets/TomPei/csg-robomaster/resolve/main/examples/hf-operator/stream.py
- Command line
-
hf download hf://datasets/TomPei/csg-robomaster/examples/hf-operator/stream.py
-
curl -L -o stream.py https://huggingface.co/datasets/TomPei/csg-robomaster/resolve/main/examples/hf-operator/stream.py
680 Bytes
| from robomaster import camera,robot | |
| import time | |
| import robomaster | |
| import cv2 | |
| CONN = "ap" | |
| ep_robot = robot.Robot() | |
| print("Initializing robot...", flush=True) | |
| ep_robot.initialize(conn_type=CONN) | |
| # ep_robot.camera.start_video_stream(display=False) | |
| ep_camera = ep_robot.camera | |
| # ep_camera.start_video_stream(display=False) | |
| ep_camera.start_video_stream(display=True, resolution=camera.STREAM_360P) | |
| time.sleep(1000) | |
| # ep_camera. | |
| print(ep_robot.get_sn) | |
| print(ep_robot.camera.video_stream_addr) | |
| CAMERA_WIDTH = 960 | |
| CAMERA_HEIGHT = 540 | |
| STREAM_URL = "tcp://192.168.2.1:40921" | |
| cap = cv2.VideoCapture(STREAM_URL) | |
| print(cap.isOpened()) | |
| cap.release() | |
| ep_robot.camera.stop_video_stream() | |