ROS1 Remote Stream Status

I would like to know whether it is possible to check the status of the RTP stream. I’m using the start_remote_stream service to start the streams of multible cameras at the same time and I would like to be able to check which of the streams is currently running. I tried to send a rtp packet and check for a response but this I do not receive any even though the camera is streaming on the defined port.

import socket

camera_ip = '192.168.1.1'
camera_port = 30000

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

sock.settimeout(2)

# Send an RTP packet to the camera
rtp_packet = b"\x80" + b"\x60" + b"\x00\x00\x00\x00" + b"\x00\x00\x00\x00" + b"\x00\x00\x00\x00"
sock.sendto(rtp_packet, (camera_ip, camera_port))

try:
    # Receive a response from the camera
    data, addr = sock.recvfrom(1024)
    print("Camera is streaming over RTP")
except socket.timeout:
    print("Camera is not streaming or connection failed")

# Close the socket
sock.close()

Hi @nweg
the ZED SDK stream uses custom communication parameters so you cannot test it in this way.
It’s easier for example to add a service to the ROS Wrapper that calls the isStreamingEnabled function and returns the status: Camera Class Reference | API Reference | Stereolabs

1 Like