pieye / nimbus-python

nimbus python bindings
GNU General Public License v3.0
3 stars 3 forks source link

Error on cli.getImage() #10

Open 9and3 opened 2 years ago

9and3 commented 2 years ago

Hello!

I am sorry for posting again.. I just would like to understand every small wrinkle of the nimbus 3d software in order to use at its best. I really do think this is a wonderful piece of sensor. It is really allowing us to push our researches far, so thanks for the Nimbus 3d once again!

Having said that, I got often a rather boring error when I try to fetch the image data from the client with

header, (ampl, radial, x, y, z, conf) = cli.getImage(invalidAsNan=True)

The terminal says this:

The coroutine raised an exception:
Traceback (most recent call last):
  File "/home/as/.local/lib/python3.8/site-packages/nimbusPython/NimbusClient.py", line 223, in _pollQueue
    image = await asyncio.wait_for(self._imageQueue.get(), timeout=self._rcvTimeout)
  File "/usr/lib/python3.8/asyncio/tasks.py", line 501, in wait_for
    raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError

It never occurs once the raspberrypi andd nimbus are freshly started after a reboot. But if I stop the camera and start again, either I got this message, either the point cloud is of much poorer quality than the one after a fresh reboot of the raspberrypi. See the images down below to understand what I mean:

Poor-quality point cloud:

Screenshot from 2021-09-25 22-58-40

High-quality point cloud (firsst launch after reaspberrypi reboot):

Screenshot from 2021-09-25 23-04-03

Once again (hope for the last time:) ), many thanks for the help!

bjajoh commented 2 years ago

Does restarting the driver help? sudo systemctl stop nimbusServer.service sudo systemctl start nimbusServer.service

9and3 commented 2 years ago

Nope, unfortunately it doesn't help much. it really needs a full reboot of the image to work properly again, only the first time..

bjajoh commented 2 years ago

Very interesting, I'll try to reproduce this. In the mean time, I assume the error occurs because you're trying to reading images too fast?

9and3 commented 2 years ago

Hello @bjajoh , I missed this conversation notification. I tried to put some sleeping time when I connect to the Nimbus Client like so:

# Get SSH data from Nimbus3d
    cli = NimbusClient.NimbusClient(IP)
    time.sleep(2) #<-- there might be still some 3D images in the pipeline

But the inconsistency among point clouds quality persists. As said before, the only solution is to reboot the entire RaspberryPi (which is quite a limitation for now).

Also, when first sudo systemctl stop nimbusServer.service is called, and later sudo systemctl start nimbusServer.service, this reproduces the same error.

The same error is reproduced when I got this error from the cli.getImage() :

Traceback (most recent call last):
  File "/home/as/IBOIS-local/AR-depth/nimbus3D/pcd_grabber.py", line 435, in main
    header, (ampl, radial, x, y, z, conf) = cli.getImage(invalidAsNan=True)
TypeError: cannot unpack non-iterable NoneType object

In this case the Nimbus3D stops, and it needs first a sudo systemctl stop nimbusServer.service and later a sudo systemctl restart nimbusServer.service . The problem is that when it streams again, the issue of my first post (see above) appears.

Any chance on your side? Thanks in advance

9and3 commented 2 years ago

Hello @bjajoh ! We have being digging a bit more on our side but we could not solve the problem mentioned here. Do you have any update from your side? Thank you in advance for your time!

bjajoh commented 2 years ago

I'll check it today, can you give me a a bit more information on your network setup? (wifi? ethernet?) Also which Rapberry Pi are you using exactly? :)

9and3 commented 2 years ago

thank you @bjajoh for taking the time! Here's the info about the raspberry:

Model                : Raspberry Pi 4 Model B Rev 1.4
Os                      : Raspbian GNU/Linux 10 (buster)
model name      : ARMv7 Processor rev 3 (v7l)
BogoMIPS         : 108.00

For what concerns the network setup it's pretty straightforward, just wifi and connection on the local domain. I am connecting to the raspberry via the local IP address.

Please do not hesitate to ask for further information, much appreciated!

theijink commented 2 years ago

Dear @9and3 and @bjajoh,

Since last weekend a similar problem occurs with my Nimbus3D sensor (on RPi4B). The nimbusServer service seems to be running fine, and a connection can be established (using NimbusClient.NimbusClient(IP)). However, the getImage() command results in a TimeoutError (equal to the error @9and3 reported). When I try to change settings, e.g. setExposureMode, this results in a message {'details': '', 'success':, 0}. Restarting nimbusServer.service did not help.

Did you find a solution to the problem in your case?

theijink commented 2 years ago

Ok, the problem is solved in the mean time. After re-installing Raspbian OS and reconfiguring but after rpi-update, the errors started to occur. I've also tried installing the latest prebuilt release at https://github.com/pieye/nimbus-images/releases but that didn't solve the problem either. After installing the 64bit tensorflow image, downloaded from https://cloud.pieye.org/index.php/s/nimbus3D, the problem was solved :)

bjajoh commented 2 years ago

Thank you very much for your input, that sounds very interesting. Indeed I was not able to easily reproduce the issue. The 64bit image also brings a nice performance boost for some applications. Please contact me if you have any issues or questions.