Skip to content

Perception Algorithm Development Example

This example demonstrates how to obtain camera video data from the DR02 via ROS2 topics and the RTSP protocol.

Camera TypeRTSP Address
Wide-Angle Camerartsp://10.21.31.103:8554/video1

Developers can pull RTSP video streams from the front and rear wide-angle cameras using the above addresses.

import cv2
# Acquire camera feed via RTSP
cap = cv2.VideoCapture("rtsp://10.21.31.103:8554/video1")
if not cap.isOpened():
print("Unable to open video stream")
exit()
while True:
ret, frame = cap.read()
if not ret:
print("Unable to read frame")
break
# Add perception algorithm processing here
# process_frame(frame)
cv2.imshow("Camera Feed", frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()

The DR02 publishes sensor data via ROS2. Developers can subscribe to the following topics to obtain data:

Topic NameDescriptionMessage Type
/IMU_DATA_BODYBody IMU datasensor_msgs/msg/Imu
/IMU_DATA_LEGLeg IMU datasensor_msgs/msg/Imu