-
Notifications
You must be signed in to change notification settings - Fork 155
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
Cannot connect and get images from Blaze over a router #217
Comments
you are announcing on one transport layer and trying to find the camera object on another one. This will not work. What might work is: Pylon::CDeviceInfo device_info = pTL_blaze ->CreateDeviceInfo(); pass the this info object to createdevice. |
Thank you for your response @SMA2016a. Sorry I only just had the time to try out your suggestion. Based on your comment, I tried the following: PylonROS2Camera* PylonROS2Camera::create(const std::string& device_user_id_to_open)
{
try
{
// Before using any pylon methods, the pylon runtime must be initialized.
Pylon::PylonInitialize();
Pylon::CTlFactory& tl_factory = Pylon::CTlFactory::GetInstance();
Pylon::ITransportLayer* pTL = tl_factory.CreateTl(Pylon::BaslerGigEDeviceClass);
Pylon::ITransportLayer* pTL_blaze = tl_factory.CreateTl(Pylon::BaslerGenTlBlazeDeviceClass);
Pylon::IGigETransportLayer* gTL = dynamic_cast<Pylon::IGigETransportLayer*>(pTL);
// make sure the GigE transport layer was created
if (gTL == NULL) {
RCLCPP_ERROR_ONCE(LOGGER, "No GigE transport layer available.");
return nullptr;
}
// create a blank device info object
Pylon::CDeviceInfo device_info = pTL_blaze ->CreateDeviceInfo();
// Announce remote device connected to this IP
const Pylon::String_t CAMERA_IP = "192.168.50.7";
const Pylon::String_t SERIAL = "24486655";
gTL->AnnounceRemoteDevice(CAMERA_IP, &device_info);
// Make sure correct device is found
RCLCPP_INFO_STREAM(LOGGER, "Remote device found with IP: " << device_info.GetIpAddress());
RCLCPP_INFO_STREAM(LOGGER, "Remote device has serial: " << device_info.GetSerialNumber());
RCLCPP_INFO_STREAM(LOGGER, "Trying to create camera_device object...");
// Create a new device info object using the Blaze TL
Pylon::CDeviceInfo device_info_blaze = pTL_blaze->CreateDeviceInfo();
device_info_blaze.SetIpAddress(CAMERA_IP);
// device_info_blaze.SetSerialNumber(SERIAL); // also tried setting: Serial, IP and Serial, None
Pylon::IPylonDevice* camera_device = tl_factory.CreateDevice(device_info_blaze);
RCLCPP_INFO_STREAM(LOGGER, "camera_device object created!");
PylonROS2Camera* new_cam_ptr = createFromDevice(BLAZE, camera_device);
return new_cam_ptr;
}
... But the
Did I understand your suggestion correctly? |
I added some additional print statements to see what each of the device info objects actually contains. The variable
Meanwhile,
I understand that the Blaze uses a specific/exclusive Device Factory value, but what is interesting and concerning to me is that most IP, Subnet and Port specific details are not populated for Blaze. How would I ever be able to connect to Blaze through a router without these values? |
Describe what you want to implement and what the issue & the steps to reproduce it are:
I initially described this in Issue #191.
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 found that there exists this function
AnnounceRemoteDevice()
as part ofPylon::IGigETransportLayer
that can be be used in this situation. The documentation mentions that this should be applicable to the Blaze cameras as well:However, I am not sure how to use this correctly. Here's what I have tried:
I have made changes to function
PylonROS2Camera::create
on line 180 in filepylon_ros2_camera.cpp
to call theAnnounceRemoteDevice()
method:Note that I could not cast the
Pylon::BaslerGenTlBlazeDeviceClass
pTL_blaze
object toPylon::IGigETransportLayer* gTL
, and so I had to create a separatePylon::BaslerGigEDeviceClass
pTL
.When I run this I get the following output:
The
AnnounceRemoteDevice()
method works as it can now find the camera with the correct serial number on the network. But I just can't enumerate and connect to it.Next, I tried to directly
tl_factory.createDevice()
with the foundPylon::CDeviceInfo device_info
by doing:Here, the output is:
The camera device does get successfully created, but we are unable to
createFromDevice()
asBLAZE
.Finally, I tried changing the line
PylonROS2Camera* new_cam_ptr = createFromDevice(BLAZE, camera_device);
toPylonROS2Camera* new_cam_ptr = createFromDevice(GIGE, camera_device);
, and got the following output:Which makes me think that using
GIGE
we are able to connect to the camera, but it is not the correct way to get images from a Blaze camera.How would I be able to use the
AnnounceRemoteDevice()
method to successfully connect to a Blaze camera with this node? Any thoughts or guidance would be very helpful!Thank you for your time!
Hardware setup description
Hardware Connection:
Blaze 101 (192.168.50.7/24) <--eth--> Boston Dynamics Spot robot (192.168.50.3/24) <--eth--> HP Z2 mini G9 computer (192.168.50.5/24)
HP Z2 can ping and see the camera through the robot.
HP Z2 mini G9 Specs:
Runtime information
Is your camera operational with the Basler pylon Viewer on your platform?
Yes
The text was updated successfully, but these errors were encountered: