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

Fix/Roundup Testing #1505

Merged
merged 5 commits into from Dec 23, 2022
Merged

Fix/Roundup Testing #1505

merged 5 commits into from Dec 23, 2022

Conversation

markmaker
Copy link
Collaborator

@markmaker markmaker commented Dec 23, 2022

Description

This is a roundup of small fixes/adjustments in the testing round.

Primary / Secondary Fiducial Diameter Null Pointer

In case a primary/secondary fiducial location X, Y was set manually, but the diameter was not (still null), it resulted in a NullPointerException (see user report in the Justification).

Note, this never happens when these are setup through Issues & Solutions (as is recommended).

Add Fast Baud-Rates for Serial Connections

Adds missing (high) baud-rates for serial connections (drivers). The missing baud-rates were taken from the jSerial "posix" implementation.

Fast Baud-rates

Note: some baud-rates were already in there that are not in the "posix" list, i.e. those will (still) not work on *ix OSes, but may work on Windows, these are:

  • 14400
  • 56000
  • 128000
  • 250000
  • 256000

SwitcherCameras Revisited

Due to problems still reported after #1500 and #1503, a new approach to the SwitcherCamera was implemented:

  • SwitcherCameras may now have Preview FPS > 0, i.e., they can show a live image.
  • However, they will no longer switch due to FPS or other frame notifications, i.e., the currently switched-to camera will remain live, the other frozen.
  • Only explicit capture through user action or machine tasks will now switch a camera.
  • Issues & Solutions issues for Preview FPS have been removed, accordingly.
  • Locking in the SwitcherCamera is now very defensive, i.e. instead of using synchronized on the switcher map, which will always at least potentially be prone to deadlocks, we use a ReentrantLock and defensive tryLock().
  • Preview FPS or other frame notifications will always tryLock() and back down immediately (preview frames may be dropped, but deadlocks prevented).
  • Explicit capture will tryLock() with a timeout, so deadlock should be excluded even there. The timeout is four times the Actuator Delay, so any normal congestion should be covered, but the deadlock then resolved. The capture will then fail and deliver a "red x" frame.

Camera Exposure Device Settings

It seems that ELP cameras have difficulty reporting the exposure setting right on Linux. Consequently, OpenPnpCaptureCamera reports a 1 to 5000 range. The range behaves non-linear, exposure is all over the place. When the Issues & Solutions static exposure calibration is run, it therefore "never" finishes. This fixes it by just spacing out a maximum of 32 probes. Tests show it still finds a reasonable value.

Static Exposure Calibration by Issues & Solutions

Justification

Related user group discussions:

Instructions for Use

A SwitcherCamera may now have a Preview FPS > 0 so it can remain live when switched-to.

Conversely, it is recommended to set the Preview FPS of the capture device to a very low value or 0, as those preview frames are snatched away from the SwitcherCamera.

Implementation Details

  1. Test with real camera and GcodeServer simulated switcher actuator. Edit: also tested under Windows.
  2. Did follow the coding style.
  3. No changes in the org.openpnp.spi or org.openpnp.model packages.
  4. Successful mvn test before submitting the Pull Request.

@markmaker markmaker merged commit c9b8eda into openpnp:test Dec 23, 2022
@markmaker markmaker deleted the fix/roundup-testing branch December 23, 2022 17:37
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

Successfully merging this pull request may close these issues.

None yet

1 participant