## Using Multiple Cameras with the Orbbec ROS 2 Package
This section describes how to configure and use multiple Orbbec cameras simultaneously in a ROS 2 environment.
### Identifying Camera USB Ports
#### Script to List Connected Cameras
To determine which USB ports the cameras are connected to, you can use the following bash script. This script lists all Orbbec devices attached to the system along with their USB port and serial number.
```bash
#!/bin/bash
VID="2bc5"
for dev in /sys/bus/usb/devices/*;do
if[ -e "$dev/idVendor"];then
vid=$(cat "$dev/idVendor")
if["$vid"=="${VID}"];then
port=$(basename $dev)
product=$(cat "$dev/product" 2>/dev/null)# product name
serial=$(cat "$dev/serial" 2>/dev/null)# serial number
echo"Found Orbbec device $product, usb port $port, serial number $serial"
fi
fi
done
```
Save this script to a file and execute it in your terminal to output a list of connected cameras.
### Launching Multiple Cameras
#### Setup for Multiple Camera Launch
You can launch multiple cameras by specifying different USB ports for each camera. Below is an example Python script that uses the ROS 2 launch system to start two cameras with individual configurations.
To execute the launch configuration for multiple cameras, use the command:
```bash
ros2 launch orbbec_camera multi_camera.launch.py
```
### Configuring the TF Tree for Multiple Cameras
#### Example TF Configuration for Two Cameras
When using multiple cameras, it's essential to calibrate them and publish a static TF tree for each camera. The following Python script configures the TF tree based on your calibration results: