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

Blaze Camera not being found by ROS2 node #191

Open
jitaxis opened this issue Nov 30, 2023 · 11 comments
Open

Blaze Camera not being found by ROS2 node #191

jitaxis opened this issue Nov 30, 2023 · 11 comments
Assignees

Comments

@jitaxis
Copy link

jitaxis commented Nov 30, 2023

Hi,
When I run the following:
ros2 launch pylon_ros2_camera_wrapper my_blaze.launch.py

I get the following output:
[pylon_ros2_camera_wrapper-2] 1701379794.563725715 [basler.pylon.ros2.pylon_ros2_camera_parameter] [WARN] Autoflash: 0, line2: 1, line3: 1
[pylon_ros2_camera_wrapper-2] 1701379794.563768247 [basler.pylon.ros2.pylon_ros2_camera_parameter] [INFO] Trying to connect the camera device with the following device user id: BrassicaBlaze-1
[pylon_ros2_camera_wrapper-2] 1701379794.874346895 [basler.pylon.ros2.pylon_ros2_camera] [ERROR] No available camera device
[pylon_ros2_camera_wrapper-2] 1701379794.874450538 [basler.pylon.ros2.pylon_ros2_camera_node] [DEBUG] Pylon camera instance created with the following user id: BrassicaBlaze-1
[pylon_ros2_camera_wrapper-2] 1701379794.874664489 [basler.pylon.ros2.pylon_ros2_camera_node] [WARN] Failed to connect camera device with device user id: BrassicaBlaze-1. Wait and retry to connect until the specified camera is available...

Setup/Overview:
I have set up my blaze with a static IP and the user_ID BrassicaBlaze-1, using the ip-configure tool. I set the user_id parameter in the .yaml file to BrassicaBlaze-1 as well.
The camera is operational through the pylon UI, which shows the user_id, and means the ethernet connection is correct.

I have a Blaze-101.
I am running the pylon_7.4.0.14900-deb0_amd64.deb suite, with the blaze pylon-supplementary-package-for-blaze-1.5.0.def07388_amd64.deb

The Linux system is ubuntu 22.04.
ROS: Humble

Any ideas on what I could be missing?
Any help is appreciated, thank you.

@jitaxis
Copy link
Author

jitaxis commented Dec 7, 2023

Update:
When I got the above error I was running it in a docker image.
When I run it on my host PC the ROS node can find the camera.
This doesn't solve the problem due to it still not working in the docker environment. I can run the pylon viewer in the docker image.
Does anyone have thoughts on what I can look into?
@FrancoisPicardDTI Do you have any thoughts on my situation?

@FrancoisPicardDTI
Copy link
Collaborator

Hello @jitaxis
It is then surely due to your network and docker configuration with respect to it.
I cna't help you much about the docker image but do you use a static ip address for the blaze?

@jitaxis
Copy link
Author

jitaxis commented Dec 8, 2023

Hello @jitaxis It is then surely due to your network and docker configuration with respect to it. I cna't help you much about the docker image but do you use a static ip address for the blaze?

Hi @FrancoisPicardDTI ,
Yeah i have setup a static ip for the camera. I covered most of my setup in the first post on this issue, if you need other info.
I have also got the pylon viewer working in my docker container which i thought would mean the network setup was fine?
Any thoughts on what could be the difference between the pylon viewer and the ROS2 node when running in the docker container?

@FrancoisPicardDTI
Copy link
Collaborator

Hi @jitaxis
No sorry, nothing comes to my mind. I am not a huge user of docker but someone from the community may be able to solve this problem. Try not specifying the user_id. The drive will try to connect to the first available camera.

@jitaxis
Copy link
Author

jitaxis commented Dec 8, 2023

I have tried that, sadly still didn't work.
Thank you for the help anyway. I'll look into it a bit more.

@FrancoisPicardDTI
Copy link
Collaborator

Hi @jitaxis
Maybe you can send me your docker files, or at least a sub part of them, so that I can test on my side?

@jitaxis
Copy link
Author

jitaxis commented Jan 8, 2024

Hi @FrancoisPicardDTI,
I have cut down the version of the dockerfile, I tested it and the same issue is happening so it should be good for you to test on.
I use a compose file to build and run my dockerfile.
I have also mounted the pylon SDK instead of copying it to save room for the zip file. The same thing happens whether it is mounted or copied into the image.

You will need to build using:
docker compose build
In another terminal run:
docker exec -it cutdwn_image-base-1 /bin/bash

You will need to source and build the ros2 environment in the terminal.

test_ws.zip

Let me know if you can find anything.
Thank you for the help.

@timonehr
Copy link

timonehr commented Feb 6, 2024

Hi jitaxis,

Have you tried to set the environment variable GENICAM_GENTL64_PATH within the container?

For example, for the Dockerfile:
ENV GENICAM_GENTL64_PATH=/opt/pylon/lib/gentlproducer/gtl:$GENICAM_GENTL64_PATH
or within the container:
export GENICAM_GENTL64_PATH=/opt/pylon/lib/gentlproducer/gtl

@Srijal97
Copy link

Srijal97 commented May 3, 2024

Hey! I'm facing the same issue running my_blaze.launch on an Ubuntu-22.04 Docker container with ROS2 Humble. I am able to ping the camera through docker so I am not sure where the issue lies. Is it possible to tell the ROS2 node to look for a specific IP?

@timonehr
Copy link

timonehr commented May 8, 2024

Hi Srijal97,

Is the blaze camera also accessible as a camera (via GEV) in the container?

The installation package pylon Supplementary Package for blaze offers two programs for functional testing, one is blazeLister to test if the camera is enumerated and the other is blazeTest to test the streaming functionality.

You should also check the environment variables in the container. The GENICAM_GENTL64_PATH must be set, as written two posts above (#191 (comment)), so that the producer can be found from the system.

@Srijal97
Copy link

Srijal97 commented May 9, 2024

Thank you @timonehr,

Setting export GENICAM_GENTL64_PATH=/opt/pylon/lib/gentlproducer/gtl did indeed make the cameras work within a docker container, thank you for this!

Our problem goes deeper than this unfortunately, please bear with me as I explain this. We are using the Blaze 101 camera on a Boston Dynamics Spot robot, and the camera has to be connected through the robot's internal network, and not directly to the computer. Basically, the robot acts as a router and the camera and our computer are clients on the network. They are all configured to be in the same IP and subnet, and I am able to ping the camera from the computer through the robot. However, we are not able to connect to the camera both through the SDK and also the Blaze Viewer App.

I have tried making changes that would have the app look for a specific camera in the function PylonROS2Camera::create on line 180 in file pylon_ros2_camera.cpp:

Pylon::PylonInitialize();
Pylon::CTlFactory& tl_factory = Pylon::CTlFactory::GetInstance();

Pylon::ITransportLayer* ptl =  tl_factory.CreateTl(Pylon::BaslerGenTlBlazeDeviceClass);

// create a device info object with specified IP
Pylon::CDeviceInfo required_device_info = ptl->CreateDeviceInfo();
const Pylon::String_t CAMERA_IP = "192.168.50.7";
const Pylon::String_t CAMERA_SUBNET = "255.255.255.0";
const Pylon::String_t SERIAL = "24486655";
required_device_info.SetIpAddress(CAMERA_IP);
// required_device_info.SetSubnetAddress(CAMERA_SUBNET);
required_device_info.SetSubnetMask(CAMERA_SUBNET);  
// required_device_info.SetSerialNumber(SERIAL);

RCLCPP_INFO_STREAM(LOGGER, "Trying to create camera_device object...");
Pylon::IPylonDevice* camera_device = tl_factory.CreateDevice(required_device_info);
RCLCPP_INFO_STREAM(LOGGER, "camera_device object created!");

PylonROS2Camera* new_cam_ptr = createFromDevice(BLAZE, camera_device);
return new_cam_ptr;

With this change, I am able to connect to the camera when it is connected directly to the computer but not when connected through the robot.

We are also working with another similar ToF camera called the Helios 2 Ray. This camera uses a similar Ethernet interface for connection, and we initially had the same issue connecting to this camera as well. What eventually worked for us using Unicast Device Discovery.

Sorry for the long explanation, but my question is: is there a similar unicast discovery method for the Blaze ToF camera as well? I believe that this would solve our connection troubles.

Thank you for reading!

EDIT: I have made some progress and continued this in Issue #217

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants