• DepthAI-v2
  • PointCloud Demo: OakCamera has no create_pointcloud method

Following the docs at https://docs.luxonis.com/projects/sdk/en/latest/samples/PointcloudComponent/SDK_pointcloud/#pointcloud-demo

The depthai-sdk example pointcloud.py does not run - two errors:

  • AttributeError: 'OakCamera' object has no attribute 'camera'

        color = oak.camera('color')
                ^^^^^^^^^^
    AttributeError: 'OakCamera' object has no attribute 'camera'

    Changing this to:

    color = oak.create_camera('color') 

    appears to fix that error, but

  • 'OakCamera' object has no attribute 'create_pointcloud'

pcl = oak.create_pointcloud(stereo=stereo, colorize=color)
          ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'OakCamera' object has no attribute 'create_pointcloud'

This same errors occur with either install from sources or install from pypi.

UPDATE:
In my environment the installed oak_camera.py
lib/python3.11/site-packages/depthai_sdk/oak_camera.py
does not include the create_pointcloud class method.

This file does: depthai/depthai_sdk/src/depthai_sdk/oak_camera.py
but that file expects ahrs.filters in xout_imu.py which also is missing in the installed site-packages.

Seeing this leads me to believe that even if the create_pointcloud() method existed, the lack of an IMU in my particular Oak-D-Lite would prevent me from using the method.

  • jakaskerl replied to this.
    • Best Answerset by cycob

    jakaskerl From the ROS thread; depthai_sdk==1.9.4 does not have pointcloud methods. Update the library.

    I don't kniow how to update, I installed from humble binaries to Ubuntu 22.04 yesterday, and also from depthai main to PiOS Bookworm.

    I used:

    python3 -m pip install --upgrade depthai-sdk

    and now I have

            "depthai==2.22.0.0",
            "depthai-pipeline-graph==0.0.5",
            "depthai-ros-driver==2.8.2",
            "depthai-ros-msgs==2.8.2",
            "depthai-sdk==1.13.1",

    The pointcloud.py no longer complains about no create_pointcloud()

    Hi cycob
    From the ROS thread; depthai_sdk==1.9.4 does not have pointcloud methods. Update the library.

    Thanks,
    Jaka

      jakaskerl From the ROS thread; depthai_sdk==1.9.4 does not have pointcloud methods. Update the library.

      I don't kniow how to update, I installed from humble binaries to Ubuntu 22.04 yesterday, and also from depthai main to PiOS Bookworm.

      I used:

      python3 -m pip install --upgrade depthai-sdk

      and now I have

              "depthai==2.22.0.0",
              "depthai-pipeline-graph==0.0.5",
              "depthai-ros-driver==2.8.2",
              "depthai-ros-msgs==2.8.2",
              "depthai-sdk==1.13.1",

      The pointcloud.py no longer complains about no create_pointcloud()