Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cameras on different subnets cannot be launched #525

Open
jbarry-bdai opened this issue Apr 18, 2024 · 2 comments
Open

[BUG] Cameras on different subnets cannot be launched #525

jbarry-bdai opened this issue Apr 18, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jbarry-bdai
Copy link

jbarry-bdai commented Apr 18, 2024

Cameras on different subnets/LANs cannot be launched even when the IP is specified. I believe this is because on lines 199-202 of Camera.cpp, a call is made to getAllAvailableDevices and an error is thrown if that doesn't return devices before it checks whether there's a camera on the specified IP:

                std::vector<dai::DeviceInfo> availableDevices = dai::Device::getAllAvailableDevices();
                if(availableDevices.size() == 0) {
                    throw std::runtime_error("No devices detected!");
                }

According to the documentation, this is expected behavior when the camera is on a different LAN. Therefore, I think the code needs to check if the user-provided IP works even if devices are not returned from getAllAvailableDevices.

Minimal Reproducible Example

  1. Connect to an OAK-D camera over Ethernet but set your netmask to 255.255.0.0 (instead of 255.255.255.0).
  2. Confirm you can still ping the camera's IP address
  3. Set camera/i_ip in the config file to the camera's IP address
  4. Try to launch ros2 launch depthai_ros_driver camera.launch.py - it will not find the device even though it's pingable

However, if we use the depthai SDK directly, we can use the camera:

from depthai_sdk import OakCamera
# oak = OakCamera() <- This will fail because it's not on the same subnet
oak = OakCamera(device="<IP address>")  # This will succeed
color = oak.create_camera('color')
# Visualize the color camera to prove we're really connected
oak.visualize([color])
oak.start(blocking=True)

Expected behavior
When the camera IP is set, the launch file should be able to find the camera and launch successfully even when not on the same subnet.

@jbarry-bdai jbarry-bdai added the bug Something isn't working label Apr 18, 2024
@Serafadam
Copy link
Collaborator

Hi, thanks for the report, a bugfix will be available for testing this week.

@Serafadam Serafadam self-assigned this Apr 22, 2024
@Serafadam
Copy link
Collaborator

Hi, sorry for the delay, could you test if this branch works for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants