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

v0.10.2: Calibration process was not able to estimate laser planes. #149

Open
schuderer opened this issue May 7, 2022 · 2 comments
Open

Comments

@schuderer
Copy link

schuderer commented May 7, 2022

Using a newly flashed image (0.10.2, image_2022-03-23-FabScanPi-lite.zip), calibration fails every time (brief yellow message "calibration failed, please try again", followed by green message "calibration finished").

When using an SD card that has an older version (v.0.5.0), calibration works on the same FabScanPi machine (RasPi 3B+, 1 Laser, same physical calibration pattern).

Edit 1: I watched the camera preview for the complete process, but the laser did not come on during calibration at all. Is this normal (particularly after it complaining about laser planes)? The laser works fine and comes on when I enter the Scan tab.

Edit 2: after seeing #144 mentioning two lasers being the default, I looked into default.config.json and changed number: 2 into number: 1, but to no avail.

I have taken care that the camera image and the laser line are centered as advised in the book + web docs. The calibration pattern is printed in the correct scale (I measured). I'm attaching a few screenshots for good measure (maybe there is something blatantly wrong with my setup that is visible in them).
scanning
error_and_success_message

According to the timestamp of the config files, something seems to have changed in default.config.json on calibration:

pi@fabscanpi:/etc/fabscanpi $ ls -l
total 12
-rw-r--r-- 1 fabscan nogroup 1782 Mar 23 06:20 ciclop.config.json
-rwxr-xr-x 1 fabscan nogroup 2362 May  7 16:39 default.config.json
-rwxr-xr-x 1 fabscan nogroup  368 Mar 23 06:20 default.settings.json

But when I try to scan, it says that I need to calibrate. I attached the config file here: default.config.json.txt

End of of /var/log/fabscanpi/fabscanpi.log:

2022-05-07 16:39:14,485 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Current Angle is: -64.35482664424775
2022-05-07 16:39:14,592 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Step 98 of 102 in MODE_SCANNER_CALIBRATION.
2022-05-07 16:39:16,328 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Trying to detect calibration pattern pose and plane.
2022-05-07 16:39:16,810 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Detected Plane: True, Detected Pose: True.
2022-05-07 16:39:16,811 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Calibration Pattern plane detected.
2022-05-07 16:39:16,812 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Current Angle is: -65.32674466546223
2022-05-07 16:39:16,918 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Step 99 of 102 in MODE_SCANNER_CALIBRATION.
2022-05-07 16:39:18,665 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Trying to detect calibration pattern pose and plane.
2022-05-07 16:39:19,089 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Detected Plane: True, Detected Pose: True.
2022-05-07 16:39:19,090 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Calibration Pattern plane detected.
2022-05-07 16:39:19,091 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Current Angle is: -66.34481236293578
2022-05-07 16:39:19,198 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Step 100 of 102 in MODE_SCANNER_CALIBRATION.
2022-05-07 16:39:20,999 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Trying to detect calibration pattern pose and plane.
2022-05-07 16:39:21,654 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Detected Plane: True, Detected Pose: True.
2022-05-07 16:39:21,656 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Calibration Pattern plane detected.
2022-05-07 16:39:21,657 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Current Angle is: -67.35213459037192
2022-05-07 16:39:23,434 [623:1537209408] INFO - fabscan.scanner.laserscanner.FSCalibrationActor: Platform calibration 
2022-05-07 16:39:23,436 [623:1537209408] INFO - fabscan.scanner.laserscanner.FSCalibrationActor:  Center Point: [  9.67001567  37.98319149 244.23853745]
2022-05-07 16:39:23,439 [623:1537209408] INFO - fabscan.scanner.laserscanner.FSCalibrationActor:  Translation: [  6.48971301  74.80991051 240.0530337 ]
2022-05-07 16:39:23,441 [623:1537209408] INFO - fabscan.scanner.laserscanner.FSCalibrationActor:  Rotation: [[ 0.          0.99633886  0.08549201] [-0.11292698  0.08494514 -0.98996556] [-0.99360329 -0.00965435  0.11251354]]
2022-05-07 16:39:23,443 [623:1537209408] INFO - fabscan.scanner.laserscanner.FSCalibrationActor:  Normal: [ 0.08549201 -0.98996556  0.11251354]
2022-05-07 16:39:23,444 [623:1537209408] ERROR - fabscan.scanner.laserscanner.FSCalibrationActor: Calibration process was not able to estimate laser planes.
NoneType: None
2022-05-07 16:39:23,448 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.FSCalibrationActor: Calibration finished.
2022-05-07 16:39:25,655 [623:1557791808] DEBUG - fabscan.server.services.api.FSStreamHandler: Stream Handler Finished.
2022-05-07 16:39:26,484 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.driver.FSSerial: Serial read timeout occured, skipping current and waiting for next command.
2022-05-07 16:39:26,485 [623:1537209408] DEBUG - fabscan.scanner.laserscanner.driver.FSSerial: Send/Receive Error: 'NoneType' object has no attribute 'decode'
2022-05-07 16:39:27,661 [623:1557791808] DEBUG - fabscan.server.services.api.FSStreamHandler: Stream Handler Finished.
2022-05-07 16:39:37,867 [623:1440392256] DEBUG - fabscan.FSScanner: CPU Temperature: 51.54 C

Any help is appreciated. Thank you in advance for your time (and for FabScanPi of course! 💯).

(P.S.: I missed the error message a couple of times -- repeating calibration some 5-6 times, thinking it's successful and just not "sticking", before I saw that there actually was an error -- making errors not disappear automatically would be a neat little UI improvement.)

@schuderer
Copy link
Author

Update: I had to paste the old working config's laser plane config fragment into the new one (having one empty laser plane json fragment did result in the error). Somehow, calibration went through after "seeding" with the old, outdated laser plane settings. They even have been updated now. For reference, the working fragment is:

        "laser_planes": [
            {
                "distance": 61.994716840208476,
                "normal": [
                    0.8589525022472666,
                    -0.01706558684961087,
                    0.5117708125993878
                ],
                "deviation": 0.07225449219249558
            }
        ],

@schuderer
Copy link
Author

Another update: I still got point clouds that looked like they were half-inverted (like the vertical/z axis was shifted). This was solved by changing the turntable steps from 3200 to 6400 (as suggested in the docs). This solved it. I'm not sure whether this could also have been the original issue behind the inability to calibrate in the first place. That's why I'm leaving this issue open for contributors to have a glance to judge whether it's just a config error or there's more behind it. From my perspective, this issue can be closed.

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

1 participant