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

Announce Remote Device does not work with Blaze #768

Open
Srijal97 opened this issue Aug 5, 2024 · 1 comment
Open

Announce Remote Device does not work with Blaze #768

Srijal97 opened this issue Aug 5, 2024 · 1 comment

Comments

@Srijal97
Copy link

Srijal97 commented Aug 5, 2024

Describe what you want to implement and what the issue & the steps to reproduce it are:

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.

It is suggested that we use the AnnounceRemoteDevice() method as part of the GigE Transport Layer:

This applies to all Basler GigE Vision devices, including the Basler blaze, which isn't usually considered by the GigE transport layer.

I was also told the following by Basler Support:

There are two ways to access the camera. Directly per GigE, or by using the Basler GenTL producer. Pylon supports both approaches, whereas the first one is hidden by default, as we expect the user to use the GenTL producer. When using the pylon GigE transport layer, blaze cameras are ignored by the device enumeration unless the EnumerateAllDevices or AnnounceRemoteDevice functions are used. Our GenTL producer doesn’t provide any functionality which is equivalent to AnnounceRemoteDevice, so in your network setup the GigE transport layer is the only option.

But trying to access images from the camera fails when using GigE, even though the camera is discovered by the announce method:

from pypylon import pylon

ip_address = '192.168.60.7'
factory = pylon.TlFactory.GetInstance()
ptl = factory.CreateTl('BaslerGigE')  

ok, info = ptl.AnnounceRemoteDevice(ip_address)
print("announce %s: %s" % (ip_address, "ok" if ok else "failed"))
if ok:
    print("found:", info.GetFullName())

camera_device = factory.CreateDevice(info)
# camera_device = pylon.TlFactory.GetInstance().CreateFirstDevice()

camera = pylon.InstantCamera(camera_device)

camera.Open()

# camera.StreamGrabber.DestinationPort.Value = 55555 # tried setting different port values but did not help
# print(camera.StreamGrabber.DestinationPort.Value)

# demonstrate some feature access
new_width = camera.Width.Value - camera.Width.Inc
if new_width >= camera.Width.Min:
    camera.Width.Value = new_width

numberOfImagesToGrab = 5
camera.StartGrabbingMax(numberOfImagesToGrab)

while camera.IsGrabbing():
    # This next line times out when connected through the robot
    grabResult = camera.RetrieveResult(5000, pylon.TimeoutHandling_ThrowException)

    if grabResult.GrabSucceeded():
        # Access the image data.
        print("SizeX: ", grabResult.Width)
        print("SizeY: ", grabResult.Height)
        img = grabResult.Array
        print("Gray value of first pixel: ", img[0, 0])

    grabResult.Release()
camera.Close()

The code results in the output:

announce 192.168.60.7: ok
found: Basler blaze-101-GEV#0030534475FF#192.168.60.7:3956
Traceback (most recent call last):
  File "/home/srijal/blaze_grab.py", line 32, in <module>
    grabResult = camera.RetrieveResult(5000, pylon.TimeoutHandling_ThrowException)
  File "/home/srijal/.local/lib/python3.10/site-packages/pypylon/pylon.py", line 3639, in RetrieveResult
    return _pylon.InstantCamera_RetrieveResult(self, *args)
_genicam.TimeoutException: Grab timed out. Possible reasons are: The image transport from the camera device is not working properly, e.g., all GigE network packets for streaming are dropped; The camera uses explicit triggering (see TriggerSelector for more information) and has not been triggered; Single frame acquisition mode is used and one frame has already been acquired; The acquisition has not been started or has been stopped. : TimeoutException thrown (file 'InstantCameraImpl.h', line 1036)

Is there another way for retrieving images from Blaze over GigE?

Is your camera operational in Basler pylon viewer on your platform

Yes

Hardware setup & camera model(s) used

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:

i9 13900K CPU (x86)
RTX A2000 GPU
32GB DDR5 RAM
Ubuntu 22.04

Runtime information:

python: 3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0]
pypylon: 4.0.0 / 8.0.0.10
pylon software suite: 7.5.0
supplementary package for Blaze: 1.6.0
camera firmware: 5.1.0
@SMA2016a
Copy link
Collaborator

SMA2016a commented Aug 5, 2024

Try to use the standard device object to open the camera instead of using GigE TL to announce.

However test this code:

ip_address = '192.168.60.7'
tlf = pylon.TlFactory.GetInstance()
empty_camera_info = pylon.DeviceInfo()
empty_camera_info.SetPropertyValue('IpAddress', ip_address)
camera_device = tlf.CreateDevice(empty_camera_info)
camera = pylon.InstantCamera(camera_device)

your statement seems to be wrong:

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)

blaze is on 192.168.60.7/24

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

2 participants