Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.10.0
DRIVE OS 6.0.8.1
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other
Target Operating System
Linux
QNX
other
Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-300)
DRIVE AGX Orin Developer Kit (940-63710-0010-200)
DRIVE AGX Orin Developer Kit (940-63710-0010-100)
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other
SDK Manager Version
2.1.0
other
Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other
Issue Description
I’ve setup a dwRectifier to transform wide angle cameras calibrated using the FTheta model into Pinhole models. Now I want to get the distortion map and publish it to ROS so I can perform the same “rectification” in opencv on raw camera images.
The trouble is dwRectifier_getDistortionMap returns a dwImageCUDA and I’m not sure how to turn this into a dwImageHandle_t so I can use an image streamer to get the dwImageCPU to then publish to ROS.
dwTime_t timeout = 5;
dwImageCUDA distortionMap;
CHECK_DW_ERROR(dwRectifier_getDistortionMap(&distortionMap, m_imageRectifier));
CHECK_DW_ERROR(dwImageStreamer_initialize(&m_imageStreamer, &distortionMap.prop, DW_IMAGE_CPU, context));
dwImageHandle_t image;
CHECK_DW_ERROR(dwImage_createAndBindCUDAArray(&image, distortionMap.prop, distortionMap.array, 1, context));
CHECK_DW_ERROR(dwImageStreamer_producerSend(image, m_imageStreamer));
dwImageHandle_t frameCPU;
CHECK_DW_ERROR(dwImageStreamer_consumerReceive(&frameCPU, timeout, m_imageStreamer));
dwImageCPU* imgCPU;
CHECK_DW_ERROR(dwImage_getCPU(&imgCPU, frameCPU));
sensor_msgs::ImagePtr distMap;
distMap = dwUtils_createDistortionMapMessage(0, sensor_name, imgCPU);
CHECK_DW_ERROR(dwImageStreamer_consumerReturn(&frameCPU, m_imageStreamer));
CHECK_DW_ERROR(dwImageStreamer_producerReturn(nullptr, timeout, m_imageStreamer));
map_pub.publish(distMap);
Error String
[ INFO] [1744049780.803233085]: [2025-04-07 18:16:20] DW Error DW_INVALID_ARGUMENT executing DW function: dwImage_createAndBindCUDAArray(&image, distortionMap.prop, distortionMap.array, 1, context) at /home/nuport/catkin_ws/src/nuport_dwros/src/extensions/CameraRectificationExtension.cpp:148
Logs
[ INFO] [1744049779.204114447]: [07-04-2025 18:16:19] Platform: Detected Generic x86 Platform
[ INFO] [1744049780.638410758]: [07-04-2025 18:16:20] Platform: currently selected GPU device discrete ID 0
[ WARN] [1744049780.639275203]: [07-04-2025 18:16:20] Context::findResourcesPackageInPathWalk: Could not find ./resources/resources.pak in upto 7 parent directories from /usr/local/driveworks-5.14/targets/x86_64-Linux/lib/libdw_base.so.5.14????????
[ WARN] [1744049780.639324500]: [07-04-2025 18:16:20] Context::findResourcesPackageInPathWalk: Could not find ./resources/resources.pak in upto 7 parent directories from /usr/local/driveworks-5.14/targets/x86_64-Linux/lib/libdw_base.so.5.14????????
[ INFO] [1744049780.749266632]: [07-04-2025 18:16:20] [07-04-2025 18:16:20] Initialize DriveWorks SDK v5.14.74
[ INFO] [1744049780.749321428]: [07-04-2025 18:16:20] [07-04-2025 18:16:20] Release build with GNU 9.3.0 from buildbrain-branch-0-g30b7ba5bb0c
[ INFO] [1744049780.752039713]: Using rigfile -- /home/nuport/catkin_ws/src/nuport_dwros/rig/demos/rig.stereo-bar-mp4.json
[ INFO] [1744049780.752181134]: [07-04-2025 18:16:20] rig::DatabaseOverlayer: Failed to open a file '/tmp/car_vin' - file likely does not exist - skipping overlay
[ INFO] [1744049780.756711210]: [07-04-2025 18:16:20] rig::DatabaseOverlayer: Failed to open a file '/tmp/car_vin' - file likely does not exist - skipping overlay
[ INFO] [1744049780.761214225]: Loading cameras : camera:front:left:120fov camera:front:right:120fov
[ INFO] [1744049780.761252884]: Setup camera:front:left:120fov
[ INFO] [1744049780.762213487]: - Pipeline for camera camera:front:left:120fov
[ INFO] [1744049780.762233337]: -- nuport_dwros::VideoPublisherExtension
[ INFO] [1744049780.762242605]: -- nuport_dwros::CameraRectificationExtension
[ INFO] [1744049780.765363386]: Setup camera:front:right:120fov
[ INFO] [1744049780.765787559]: - Pipeline for camera camera:front:right:120fov
[ INFO] [1744049780.765805001]: -- nuport_dwros::VideoPublisherExtension
[ WARN] [1744049780.770675237]: [07-04-2025 18:16:20] CameraVirtual: cannot retrieve framerate from video file, assume 30FPS??dj
[ERROR] [1744049780.781123008]: [07-04-2025 18:16:20] Unsupported camera module vendor HZKJ_IMX728_ES2_V2_120FOV
[ INFO] [1744049780.781167564]: [07-04-2025 18:16:20] CameraClient:getEepromDataForCamera, unsupported eeprom decode for camera module
[ WARN] [1744049780.784864988]: [07-04-2025 18:16:20] CameraVirtual: cannot retrieve framerate from video file, assume 30FPS??dj
[ERROR] [1744049780.793104224]: [07-04-2025 18:16:20] Unsupported camera module vendor HZKJ_IMX728_ES2_V2_120FOV
[ INFO] [1744049780.793154192]: [07-04-2025 18:16:20] CameraClient:getEepromDataForCamera, unsupported eeprom decode for camera module
[ERROR] [1744049780.803094472]: [07-04-2025 18:16:20] Driveworks exception thrown: DW_INVALID_ARGUMENT: dwImage_createAndBindCUDAArray: cannot create image with a pitch type layout, use dwImage_setFromMemory
[ERROR] [1744049780.803152163]: [07-04-2025 18:16:20] Driveworks exception thrown: DW_INVALID_ARGUMENT: dwImage_createAndBindCUDAArray: cannot create image with a pitch type layout, use dwImage_setFromMemory
[ INFO] [1744049780.803233085]: [2025-04-07 18:16:20] DW Error DW_INVALID_ARGUMENT executing DW function:
dwImage_createAndBindCUDAArray(&image, distortionMap.prop, distortionMap.array, 1, context)
at /home/nuport/catkin_ws/src/nuport_dwros/src/extensions/CameraRectificationExtension.cpp:148
[ERROR] [1744049780.817527118]: [07-04-2025 18:16:20] ObjectPool is realeased, before all items have been released!
[ERROR] [1744049780.817741893]: [07-04-2025 18:16:20] Object should to be released before Context. There are 3 Objects not released at the end of Context destructor. If you are seeing this message, it means that there may be memory use after free issues or memory leaks.
[ERROR] [1744049782.825549350]: [07-04-2025 18:16:22] BufferPool: Cannot find returned pointer in hash m_slotsTaken.?