Get Id of Device to work with multiple cameras

I’m working in Ubuntu (w/ROS) with multiple Astra S. To launch each camera correctly I would use the ID of device but i’m not getting that info.

Are you using OpenNI?

openni::Device dev;"");
char serialNumber[1024];
dev.getProperty(ONI_DEVICE_PROPERTY_SERIAL_NUMBER, &serialNumber);

worked for me

I’m using openni2_launch.

Something like this:

  <include file="$(find openni2_launch)/launch/openni2.launch">
        <arg name="device_id" value="$(arg camera1_id)" />

Not too familiar with ROS’s openNI interface, sorry about that. But if you want to do it in code, this is how you would do it.