[ROS2 Foxy] ros2 run learning_node node_object_webcam 报错, 启动摄像头失败

zyd@zyd-pc:$ ros2 run learning node node object webcam[INF0][1709553617.755758190][node_object_webcam]: Ros2节点示例:检测图像中的萃果(python3:104026):Gstreamer-CRITICAL **:20:00:39.108:Trying to dispose element pipelineo, but it is in PAusED instead of the Null state.You need to explicitly set elements to the NuLL state beforedropping the final reference, to allow them to clean up.This problem may also be caused by a refcounting bug in theapplication or some element.
WARN:0] global ./modules/videoio/src/cap_gstreamer.cpp (1053) open opencv | Gstreamer warning: unable to start pipeline
(python3:104026):GStreamer-CRITICAL**:20:00:39.108:Trying to dispose element videoconverto, but it is in PLAYING instead of the NuLL state.You need to explicitly set elements to the NuLL state beforedropping the final reference, to allow them to clean up.This problem may also be caused by a refcounting bug in theapplication or some element.
WARN:0] global ./modules/videoio/src/cap gstreamer.cpp (616) i

ros2 run learning_topic interface_object_pub [INFO] [1752137883.928313175] [topic_webcam_sub]: Receiving video frame Traceback (most recent call last): File "/opt/ros/galactic/lib/python3.8/site-packages/cv_bridge/core.py", line 99, in encoding_to_cvtype2 return getCvType(encoding) RuntimeError: Unrecognized image encoding [yuv422_yuy2] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/wheeltec/dev_ws1/install/learning_topic/lib/learning_topic/interface_object_pub", line 33, in <module> sys.exit(load_entry_point('learning-topic==0.0.0', 'console_scripts', 'interface_object_pub')()) File "/home/wheeltec/dev_ws1/install/learning_topic/lib/python3.8/site-packages/learning_topic/interface_object_pub.py", line 68, in main rclpy.spin(node) # 循环等待ROS2退出 File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/__init__.py", line 196, in spin executor.spin_once() File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/executors.py", line 712, in spin_once raise handler.exception() File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/task.py", line 239, in __call__ self._handler.send(None) File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/executors.py", line 418, in handler await call_coroutine(entity, arg) File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/executors.py", line 343, in _execute_subscription await await_or_execute(sub.callback, msg) File "/opt/ros/galactic/lib/python3.8/site-packages/rclpy/executors.py", line 107, in await_or_execute return callback(*args) File "/home/wheeltec/dev_ws1/install/learning_topic/lib/python3.8/site-packages/learning_topic/interface_object_pub.py", line 59, in listener_callback image = self.cv_bridge.imgmsg_to_cv2(data, 'bgr8') # 将ROS的图像消息转化成OpenCV图像 File "/opt/ros/galactic/lib/python3.8/site-packages/cv_bridge/core.py", line 169, in imgmsg_to_cv2 dtype, n_channels = self.encoding_to_dtype_with_channels(img_msg.encoding) File "/opt/ros/galactic/lib/python3.8/site-packages/cv_bridge/core.py", line 104, in encoding_to_dtype_with_channels return self.cvtype2_to_dtype_with_channels(self.encoding_to_cvtype2(encoding)) File "/opt/ros/galactic/lib/python3.8/site-packages/cv_bridge/core.py", line 101, in encoding_to_cvtype2 raise CvBridgeError(e) cv_bridge.core.CvBridgeError: Unrecognized image encoding [yuv422_yuy2]
07-11
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值