slightech / MYNT-EYE-D-SDK

MYNT EYE D SDK (MYNT® EYE Depth Camera)
http://www.myntai.com/mynteye/depth
Other
99 stars 88 forks source link

No serial number is ROS wrapper #47

Open sergioramosjubierre opened 5 years ago

sergioramosjubierre commented 5 years ago

I am trying to read the serial number of a D-1000-120 camera from the ROS wrapper. I have an Ubuntu 18.04 with ROS Melodic

When I execute roslaunch mynteye_wrapper_d mynteye.launch I can see that the serial is read:

Device descriptors:
  name: MYNT-EYE-D1000
  serial_number: 20373347344D500400570045
  firmware_version: 1.4
  hardware_version: 2.0
  spec_version: 1.0
  lens_type: 0000
  imu_type: 0000
  nominal_baseline: 120

But in ROS wrapper the information that arrives has the serial number empty:

------------------------------ 
Device Information
------------------------------
 0 | index: 0, name: /dev/video0, type: 2, pid: 0x120, vid: 0x1e4e, chip_id: 0x15, fw_version: SICI-B12-B0135P-016-006-Beta4-ISO_Plugout2M(Interleave), serial_number: 

I have been looking in the code of the SDK and I have seen that the serial number is not asked: https://github.com/slightech/MYNT-EYE-D-SDK/blob/master/src/mynteyed/device/device.cc#L170

It asks the firmware version, but not the serial number. I have tried to add the call to the function EtronDI_GetSerialNumber https://github.com/slightech/MYNT-EYE-D-SDK/blob/master/3rdparty/eSPDI/linux/include/eSPDI.h#L49

But this returns: 2,\0,0,\0,3,\0.... That is the correct serial number but with \0 between each character.

Could you please update the library so it doesn't add this '\0' between characters.

Also, it could be nice if you add the call to get the serial number in device.cc

Thank you

sergioramosjubierre commented 5 years ago

Hello,

Any feedback about this?

Thanks

KalmanXiong commented 5 years ago

I'm sorry for this bug, we'll fix it in the next version. You can refer to the code to remove '\0'. device.cc 1208 GetSerialNumber()

sergioramosjubierre commented 4 years ago

Hello,

We managed to solve this and now we can indicate the serial number when launching the camera. This works ok. If you are interested we could make a merge request in order to participate in the SDK development.

But the problem we have is that we can't open 2 cameras at the same time. When it tries to open the second camera there is an error coming from this function: https://github.com/slightech/MYNT-EYE-D-SDK/blob/master/3rdparty/eSPDI/linux/include/eSPDI.h#L80

This comes from the libeSPDI that we can't debug. I see I am not the only one trying to do this, like for example here: #55

When do you think you will able to update this library in order to allow multiple cameras? We are now selecting the cameras for our robots.

Thanks