File size: 680 Bytes
b98ffbb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
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()
|