HemalathaNingappaKondakundi

  • 7 days ago
  • Joined 19 Jan
  • 0 best answers
  • Hi everyone,

    I'm encountering an issue while running a simple DepthAI example (rgb_preview.py from depthai-python/examples/ColorCamera). When I restart my computer, the script sometimes runs fine the first time. However, if I try to run it again, I get the following error:

    After this, the device becomes unresponsive until I restart my computer, and even then, it only sometimes works.

    Has anyone else experienced this? What could be causing the issue, and how can I resolve it without needing to reboot each time?

    Thanks in advance for your help!

    • i am trying to connect to the "/oak/points" topic i am not receiving any data following is my code:

      Copyright 2016 Open Source Robotics Foundation, Inc.

      #

      # Licensed under the Apache License, Version 2.0 (the "License");

      # you may not use this file except in compliance with the License.

      # You may obtain a copy of the License at

      #

      # http://www.apache.org/licenses/LICENSE-2.0

      #

      # Unless required by applicable law or agreed to in writing, software

      # distributed under the License is distributed on an "AS IS" BASIS,

      # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

      # See the License for the specific language governing permissions and

      # limitations under the License.

      import rclpy

      from rclpy.node import Node

      from rclpy.qos import QoSProfile, ReliabilityPolicy

      # from std_msgs.msg import CameraInfo

      from sensor_msgs.msg import CameraInfo, Image, PointCloud2

      class MinimalSubscriber(Node):

      def __init__(self):
      
          super().__init__('minimal_subscriber')
      
         # qos_profile = QoSProfile(reliability=ReliabilityPolicy.BEST_EFFORT, depth=10)
      
          qos_policy = rclpy.qos.QoSProfile(reliability=rclpy.qos.ReliabilityPolicy.BEST_EFFORT,
      
                                            history=rclpy.qos.HistoryPolicy.KEEP_LAST,
      
                                            depth=1)
      
          self.subscription = self.create_subscription(
      
              PointCloud2,
      
              '/oak/points',
      
              self.listener_callback,
      
               qos_profile=qos_policy)
      
          self.subscription  # prevent unused variable warning
      
      def listener_callback(self, msg):
      
          self.get_logger().info('I heard: "%s"' % msg)

      def main(args=None):

      rclpy.init(args=args)
      
      minimal_subscriber = MinimalSubscriber()
      
      rclpy.spin(minimal_subscriber)
      
      # Destroy the node explicitly
      
      # (optional - otherwise it will be done automatically
      
      # when the garbage collector destroys the node object)
      
      minimal_subscriber.destroy_node()
      
      rclpy.shutdown()

      if name == 'main':

      main()