-
Notifications
You must be signed in to change notification settings - Fork 226
Issue running two kinect cameras on a same machine through ROS driver #97
Comments
Having a similar issue myself, I modified my driver.launch file:
I'm getting this error:
But after that the camera somehow starts:
Then I'm getting this error while the camera is still up and running, I'm getting topics only from one of two cameras even though they are both "running"
|
I had similar issues connecting to multiple devices, I am not sure if this is the actual problem but in my code I closed the device when the serial number does not match and then I could use multiple devices.
If the serial numbers do not match, the device is not closed? |
@wirthual The device should be closed by the destructor when it goes out of scope: |
I see, thank you for pointing out. I use a variable with a scope that's not only the for loop, probably this was the reason I needed to close it explicit in my code. |
I had the same issue in running two KAs at the same time, By default, Linux limits image capturing to a Max_value, in my desktop it was limited to 16 MB. To extend the USBFS limit, I manually moddified the grub Update the grup ( sudo update-grub ) and restart your PC ( sudo reboot ). check if buffer size has successfully changed ( cat /sys/module/usbcore/parameters/usbfs_memory_mb ) All the Best :) |
@GabrielQuik Did you manage to solve your problem? I am also using two kinects in the same computer and get the same error and after it, both cameras work fine.
I believe it could be the way the two cameras are brought up. Every time the driver is launch, it will try to open all the devices connected to the PC no matter whether they have been already opened or not. This error does not limit the functionality but it would be nice if it did not happen. |
To prevent this error we would need to remove the option to choose a kinect via serial number because you can only query the serial number of the device if you have opened it via the API. |
@RoseFlunder Thanks for your fast response. |
@carcormir can u run two kinects using K4aviewer ? do u get the same error . |
@Tarekbouamer I open two instances of k4aviewer and I am able to run both kinects simultaneously without any errors. The problem comes when trying to launch two cameras using the ROS driver |
Well the error just means that the device that is opened by the first instances of the driver node can't be opened by the second instance, which is not a problem to worry about.
|
That is what I already did, but I was not sure if there was another way. |
Hi @Michae1Park @carcormir , did you solve it? I have same problem when I try to open second Kinect camera? |
Duplicating to the feature request - #126 |
it seems like that i could not fix the problem with your proposal. i turly get 1000 after your instruction, but i still could open 2 device. Could you give me more advice? |
I seem to have found a workaround solution to launching two kinect camera nodes on the same computer, as mentioned here or in #236 and #210 Here is an example driver.launch for two Azure Kinect cameras:
|
Hi, @leoneversberg , I wonder after launching two cameras, did they have the same timestamps for the data. |
I didn't notice any differences in the timestamps or sync issues. I followed the instructions from https://learn.microsoft.com/en-us/azure/kinect-dk/multi-camera-sync and connected both cameras with a 3.5mm cable. |
We are running two Kinects through the ROS driver, and it seems like there is an issue connecting them through the USB. The weird part is that sometimes the cameras connect without an issue, or restarting the cameras multiple times "fixes" the problem.
We have already made usbfs adjustments following microsoft/Azure-Kinect-Sensor-SDK#485.
We are on ROS melodic and Ubuntu 18.04.
Below is the error message.
[ INFO] [1572984480.118636104]: K4A Parameters:
[ INFO] [1572984480.119257532]: sensor_sn - std::string : 000032293712
[ INFO] [1572984480.119309027]: depth_enabled - bool : 1
[ INFO] [1572984480.119326127]: depth_mode - std::string : NFOV_UNBINNED
[ INFO] [1572984480.119345351]: color_enabled - bool : 1
[ INFO] [1572984480.119364867]: color_format - std::string : bgra
[ INFO] [1572984480.119378943]: color_resolution - std::string : 1440P
[ INFO] [1572984480.119390089]: fps - int : 30
[ INFO] [1572984480.119400281]: point_cloud - bool : 0
[ INFO] [1572984480.119410932]: rgb_point_cloud - bool : 0
[ INFO] [1572984480.119421161]: point_cloud_in_depth_frame - bool : 1
[ INFO] [1572984480.119431340]: tf_prefix - std::string : camera1_
[ INFO] [1572984480.119441309]: recording_file - std::string :
[ INFO] [1572984480.119451336]: recording_loop_enabled - bool : 0
[ INFO] [1572984480.119461344]: body_tracking_enabled - bool : 0
[ INFO] [1572984480.119484974]: body_tracking_smoothing_factor - float : 0
[ INFO] [1572984480.119495871]: imu_rate_target - int : 0
[ INFO] [1572984480.119506017]: rescale_ir_to_mono8 - bool : 0
[ INFO] [1572984480.119517051]: ir_mono8_scaling_factor - float : 1
[ INFO] [1572984480.119527413]: wired_sync_mode - int : 1
[ INFO] [1572984480.124689331]: Found 2 sensors
[ INFO] [1572984480.124728091]: Searching for sensor with serial number: 000032293712
[ INFO] [1572984480.147432833]: K4A Parameters:
[ INFO] [1572984480.147880693]: sensor_sn - std::string : 000269493712
[ INFO] [1572984480.147898463]: depth_enabled - bool : 1
[ INFO] [1572984480.147913883]: depth_mode - std::string : NFOV_UNBINNED
[ INFO] [1572984480.147930725]: color_enabled - bool : 1
[ INFO] [1572984480.147955945]: color_format - std::string : bgra
[ INFO] [1572984480.147981587]: color_resolution - std::string : 1440P
[ INFO] [1572984480.147993070]: fps - int : 30
[ INFO] [1572984480.148007800]: point_cloud - bool : 0
[ INFO] [1572984480.148062133]: rgb_point_cloud - bool : 0
[ INFO] [1572984480.148076705]: point_cloud_in_depth_frame - bool : 1
[ INFO] [1572984480.148090036]: tf_prefix - std::string : camera2_
[ INFO] [1572984480.148103613]: recording_file - std::string :
[ INFO] [1572984480.148117913]: recording_loop_enabled - bool : 0
[ INFO] [1572984480.148131730]: body_tracking_enabled - bool : 0
[ INFO] [1572984480.148163465]: body_tracking_smoothing_factor - float : 0
[ INFO] [1572984480.148178002]: imu_rate_target - int : 0
[ INFO] [1572984480.148192588]: rescale_ir_to_mono8 - bool : 0
[ INFO] [1572984480.148207981]: ir_mono8_scaling_factor - float : 1
[ INFO] [15729844
[2019-11-05 15:08:00.156] [error] [t=13559] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/usbcommand/us
bcommand.c (30): TraceLibUsbError(). /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/usbcommand/usbcomman
d.c (447): libusb_claim_interface(usbcmd->libusb, usbcmd->interface) returned LIBUSB_ERROR_BUSY in us
b_cmd_create
[2019-11-05 15:08:00.156] [error] [t=13559] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/usbcommand/us
bcommand.c (30): TraceLibUsbError(). /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/usbcommand/usbcomman
d.c (489): libusb_release_interface(usbcmd->libusb, usbcmd->interface) returned LIBUSB_ERROR_NOT_FOUN
D in usb_cmd_destroy
[2019-11-05 15:08:00.156] [error] [t=13559] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/depth_mcu/depth_mcu.c (68): usb_cmd_create(USB_DEVICE_DEPTH_PROCESSOR, device_index, NULL, &depthmcu->usb_cmd) returned failure in depthmcu_create()
[2019-11-05 15:08:00.157] [error] [t=13559] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/sdk/k4a.c (133): depthmcu_create(index, &device->depthmcu) returned failure in k4a_device_open()
[ERROR] [1572984480.157068584]: Failed to open K4A device at index 0
[ INFO] [1572984480.382604587]: K4A[0] : 000269493712
[ INFO] [1572984480.444531693]: K4A[1] : 000032293712
[2019-11-05 15:08:00.495] [error] [t=13551] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/usbcommand/usbcommand.c (30): TraceLibUsbError(). /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/usbcommand/usbcommand.c (447): libusb_claim_interface(usbcmd->libusb, usbcmd->interface) returned LIBUSB_ERROR_BUSY in usb_cmd_create
[2019-11-05 15:08:00.495] [error] [t=13551] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/usbcommand/usbcommand.c (30): TraceLibUsbError(). /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/usbcommand/usbcommand.c (489): libusb_release_interface(usbcmd->libusb, usbcmd->interface) returned LIBUSB_ERROR_NOT_FOUND in usb_cmd_destroy
[2019-11-05 15:08:00.495] [error] [t=13551] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/depth_mcu/depth_mcu.c (68): usb_cmd_create(USB_DEVICE_DEPTH_PROCESSOR, device_index, NULL, &depthmcu->usb_cmd) returned failure in depthmcu_create()
[2019-11-05 15:08:00.495] [error] [t=13551] /__w/1/s/extern/Azure-Kinect-Sensor-SDK/src/sdk/k4a.c (133): depthmcu_create(index, &device->depthmcu) returned failure in k4a_device_open()
[ERROR] [1572984480.495722995]: Failed to open K4A device at index 1
[ERROR] [1572984480.495788941]: Failed to open a K4A device. Cannot continue.
[ INFO] [1572984480.495818889]: Setting wired sync mode: 1
[ INFO] [1572984480.495837643]: Setting RGB Camera Format: bgra
[ INFO] [1572984480.495859076]: Setting RGB Camera Resolution: 1440P
[ INFO] [1572984480.495881217]: Setting Depth Camera Mode: NFOV_UNBINNED
[ INFO] [1572984480.495898688]: Setting Camera FPS: 30
[ INFO] [1572984480.495918625]: Using default IMU rate. Setting to maximum: 1600 Hz.
[ INFO] [1572984480.495946535]: Setting Target IMU rate to 1600 (desired: 1600)
[ INFO] [1572984480.496042274]: K4A Started
[ERROR] [1572984480.500203295]: Failed to open a K4A device. Cannot continue.
[ INFO] [1572984480.500265224]: Setting wired sync mode: 2
[ INFO] [1572984480.500347781]: Setting RGB Camera Format: bgra
[ INFO] [1572984480.500394846]: Setting RGB Camera Resolution: 1440P
[ INFO] [1572984480.500436188]: Setting Depth Camera Mode: NFOV_UNBINNED
[ INFO] [1572984480.500478589]: Setting Camera FPS: 30
[ INFO] [1572984480.500527819]: Using default IMU rate. Setting to maximum: 1600 Hz.
[ INFO] [1572984480.500578731]: Setting Target IMU rate to 1600 (desired: 1600)
[ INFO] [1572984480.500701062]: K4A Started
^C[camera2/node-6] killing on exit
The text was updated successfully, but these errors were encountered: