sim2bot.CameraStream.read¶
read(timeout: float = 5.0) -> Optional[CameraFrame]
¶
Wait for a frame newer than the previous read.
Parameters:
-
timeout(float, default:5.0) –Maximum blocking time in seconds.
Returns:
-
Optional[CameraFrame]–The next
CameraFrame, orNonewhen -
Optional[CameraFrame]–the timeout expires.
Notes
read() returns the next fresh slot value even if it is older than
max_age. Iterator mode performs the age filter automatically.
Source code in sim2bot/client.py
Practical examples¶
Examples use objects discovered from the current scene rather than hard-coded robot metadata.
Discard old frames explicitly
Guidance¶
Common error
A None result means the read timed out; it does not automatically close the subscription.