Connect
SUMMARY
Connect opens a connection to the camera hardware so frames can be acquired. It initializes the underlying vendor SDK (IDS Peak, OpenCV VideoCapture, or librealsense), opens the device, allocates buffers or starts the pipeline, and registers any BabyROS nodes the camera class exposes.
All subsequent operations on the camera require an active connection.
Available on: IDS, Webcam, Intel RealSense.
The Skill
python
camera.connect()For RealSense, optional stream parameters can be passed to connect:
python
camera.connect(width=640, height=480, fps=30)The Code
python
from telekinesis.medulla.cameras import ids
camera = ids.IDS(
name="my_ids_camera",
serial_number="4108909352",
load_factory_defaults=False,
)
camera.connect()python
from telekinesis.medulla.cameras import webcam
camera = webcam.Webcam(name="my_webcam", camera_id=0)
camera.connect()python
from telekinesis.medulla.cameras import realsense
camera = realsense.RealSense(name="my_realsense")
camera.connect()The Explanation of the Code
connect performs the vendor-specific initialization needed before any frame can be acquired:
- IDS — opens the device by
serial_numberthrough the IDS Peak library and allocates the acquisition buffers needed to receive frames from the sensor. Withload_factory_defaults=False, parameters previously configured in IDS Peak Cockpit are preserved. - Webcam — opens the device via OpenCV's
VideoCaptureusing the integercamera_idreported by the OS (0for the first camera) and verifies that frames can be read. - RealSense — initializes the RealSense pipeline with default stream settings, enabling the depth and colour streams. No serial number is required; the class connects to the first available device automatically. Optional
width,height, andfpsparameters configure both the colour and depth streams simultaneously.
Where to Use the Skill
Connect is the first call against any Medulla camera. Pair it with Disconnect inside a try / finally block so resources are released regardless of how the script exits.

