3232from lerobot .common .cameras .opencv .configuration_opencv import OpenCVCameraConfig
3333
3434logger = logging .getLogger (__name__ )
35- logging .basicConfig (level = logging .INFO , format = "%(asctime)s - %(levelname)s - %(module)s - %(message)s" )
35+ # logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(module)s - %(message)s")
3636
3737
3838def find_all_opencv_cameras () -> List [Dict [str , Any ]]:
@@ -160,10 +160,9 @@ def create_camera_instance(cam_meta: Dict[str, Any]) -> Optional[Dict[str, Any]]
160160 default_profile = cam_meta .get ("default_stream_profile" )
161161 width = default_profile .get ("width" )
162162 height = default_profile .get ("height" )
163- fps = default_profile .get ("fps" )
164163 instance = None
165164
166- logger .info (f"Preparing { cam_type } ID { cam_id } with profile: Width={ width } , Height={ height } , FPS= { fps } " )
165+ logger .info (f"Preparing { cam_type } ID { cam_id } with profile: Width={ width } , Height={ height } " )
167166
168167 try :
169168 if cam_type == "OpenCV" :
@@ -172,7 +171,6 @@ def create_camera_instance(cam_meta: Dict[str, Any]) -> Optional[Dict[str, Any]]
172171 color_mode = ColorMode .RGB ,
173172 width = width ,
174173 height = height ,
175- fps = fps ,
176174 )
177175 instance = OpenCVCamera (cv_config )
178176 elif cam_type == "RealSense" :
@@ -181,7 +179,6 @@ def create_camera_instance(cam_meta: Dict[str, Any]) -> Optional[Dict[str, Any]]
181179 color_mode = ColorMode .RGB ,
182180 width = width ,
183181 height = height ,
184- fps = fps ,
185182 )
186183 instance = RealSenseCamera (rs_config )
187184 else :
@@ -191,7 +188,6 @@ def create_camera_instance(cam_meta: Dict[str, Any]) -> Optional[Dict[str, Any]]
191188 if instance :
192189 logger .info (f"Connecting to { cam_type } camera: { cam_id } ..." )
193190 instance .connect ()
194- time .sleep (0.1 )
195191 return {"instance" : instance , "meta" : cam_meta }
196192 except Exception as e :
197193 logger .error (f"Failed to connect or configure { cam_type } camera { cam_id } : { e } " )
@@ -211,11 +207,6 @@ def process_camera_image(
211207
212208 try :
213209 image_data = cam .read ()
214- if image_data is None :
215- logger .warning (
216- f"No frame received from { cam_type_str } camera { cam_id_str } at time { current_time :.2f} s."
217- )
218- return None
219210
220211 return save_image (
221212 image_data ,
@@ -293,8 +284,6 @@ def save_images_from_all_cameras(
293284 if futures :
294285 concurrent .futures .wait (futures )
295286
296- time .sleep (0.05 )
297-
298287 except KeyboardInterrupt :
299288 logger .info ("Capture interrupted by user." )
300289 finally :
@@ -360,7 +349,6 @@ def save_images_from_all_cameras(
360349 args = parser .parse_args ()
361350
362351 if args .command is None :
363-
364352 default_output_dir = capture_parser .get_default ("output_dir" )
365353 default_record_time_s = capture_parser .get_default ("record_time_s" )
366354
@@ -370,4 +358,4 @@ def save_images_from_all_cameras(
370358 camera_type_filter = None ,
371359 )
372360 else :
373- args .func (args )
361+ args .func (args )
0 commit comments