GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||
GeezerVison is showing github.com — fix: Bumped eocv to 1.5.0 and fixed openCameraDeviceAsync Impls by Lunerwalker2 · Pull Request #193 · FTCLib/FTCLib Conversation
|
|
This is also a breaking change in that it requires a new OpenCV native library to be placed on the RC. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I believe that someone was going to add that to the docs, although I'll edit it into the PR text to be concise about it, thanks. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Can you update the README with the new document information and update the FTCLib version in the gradle file to 2.0.0? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Can you also make a note in the readme about no longer needing to upgrade to java version 1.8. Something like, Since SDK 7.0, there is no longer a need to upgrade the java version since it is 1.8 by default. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Different PR 😊 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @Override | ||
| public void onError(int errorCode){ | ||
|
|
||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Are we going to do nothing here? Same for the one in the pipeline example.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We can deal with it if we want. From what I can find, there's only two possible errors.

Assuming we want to tell the user about the error, how should we go about it? That detector class doesn't currently take in any telemetry object, only the hardware map. Should we make the init() method return something?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
*That particular detector class doesn't have a telemetry; the contour ring one does take a telemetry, but it's not a required argument in that either.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Are these hardfault errors? Like, if they fail, there's no recovery? If there's no possible recovery for these errors, I would throw a runtime exception with the error code. If not, log it using Log.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I don't think they will crash the program, but the camera opening will definitely fail. The two errors shown in the image don't look to me like they will go away if we just try again, like in the CAMERA_OPEN_ERROR_POSTMORTEM_OPMODE, which I assume is thrown if the opening is called during stop() in an opmode.
The other error could be anything, but I would also think that it would just persist if another opening was attempted. Either way, the program is unlikely to be able move on as both of the errors would seem to suggest a failure to start the stream, so we might want to throw a runtime exception.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Returning a boolean is a great idea. I'm a fan of allowing user code to react to errors.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
That sounds great. @Lunerwalker2 can you whip up an implementation of that in these detectors? In future detectors as well we'll need to include this style of implementation for error handling.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sure, I was about to do it. In the UGContourRingDetector, the user passes in an optional telemetry instance. For that class, should I use telemetry.log(); in addition to the global warning?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The warning will show up at the top of the telemetry area, so that seems redundant.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll leave it out then
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
If you see anything wrong here, please do say so because some of it is new territory for me. Thanks @Windwoes for all the help. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
To clarify on the changes I made, instead of returning a boolean, there is now an internal state enum that represents the detector. The init() function will now only run if the state is NOT_CONFIGURED. Once ran, the state is INITIALIZED. Upon successful onOpened(), the state is changed to RUNNING. Upon an error that calls onError, the state is INIT_FAILURE_NOT_RUNNING. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Isn't this a massive race condition? The return values of these functions can change at any time (whenever a new frame comes in). I think you want to grab a snapshot of these at one moment in time and then run the logic chain. public Stack getStack() { if (Math.abs(ftclibPipeline.getTopAverage() - ftclibPipeline.getBottomAverage()) < ftclibPipeline.getThreshold() && (ftclibPipeline.getTopAverage() <= 100 && ftclibPipeline.getBottomAverage() <= 100)) { return Stack.FOUR; } else if (Math.abs(ftclibPipeline.getTopAverage() - ftclibPipeline.getBottomAverage()) < ftclibPipeline.getThreshold() && (ftclibPipeline.getTopAverage() >= 100 && ftclibPipeline.getBottomAverage() >= 100)) { return Stack.ZERO; } else { return Stack.ONE; } } Also why is the camera hardcoded to BACK? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
That is a race condition. I do not think we ever ran into an issue because the frames do not change much after randomization. We will keep that in mind for the new pipelines. I could be misinterpreting the issue, but it is set to back by default and the user can set the input to a webcam if they chose. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Approved for EOCV update. Open a new PR for fixing the race condition.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* fix readme * fix: contributing guidelines outdated errors * update PR template * Add Upgraded Motor Groups (#164) * feat: upgraded motor groups * fix: add stop motor when button is released * fix: missing follower logic in set() * change x on L106 to motor to be more descriptive Co-authored-by: dansman805 <[email protected]> * change x on L113 to motor to be more descriptive Co-authored-by: dansman805 <[email protected]> * feat: verbose comments on flywheel sample * fix: change NotNull JB annotation to NonNull from androidx * fix: missing comment for clearing the bulk cache in sample Co-authored-by: Purav Datta <[email protected]> Co-authored-by: dansman805 <[email protected]> * add: new method to directly power mecanum drive wheels (#186) * Update Mecanum Sample (#187) * fix: mecanum sample to be readable and useful * add: drawings and descriptions throughout sample * fix: model of robot frame * feat: update SDK dependencies * fix: Bumped eocv to 1.5.0 and fixed openCameraDeviceAsync Impls (#193) * fix: Bumped eocv to 1.5.0 and fixed breaking changes * fix: Changed the vision release version to 2.0.0 * fix: Better error handling of camera opening * fix: Surrounded the callback with the lock * fix: issues with reset in RevIMU (#195) * fix: issues with ramsete controller ending before command runs (#194) * Min and Max flipped. Clarify AngleUnit type in parameter name (#201) min and max arguments flipped on call to constructor. Consider renaming parameter to minDegree and maxDegree to clarify to caller that AngleUnit.DEGREES is assumed. * Introduce Rate Feature to Motor Encoders (#196) * feat: clean up motor group inversion and add encoder rate * fix: typo in javadoc comment * fix: set last state before current state (#204) * Capstone Vision for 2021 Season (#200) * Added capstone detector and pipeline * Updated values on lines 119 and 117 of Capstone Detector * Added setters to tune area of detection * Released hierarchy Mat and now gives definition of contour * Released all matrices and fully tested pipeline Should be ready for release * Vector2d Normalization (#205) * fix: updated issue templates (#203) * feat: modify README and dependencies for v2.0 release (#206) Co-authored-by: Purav Datta <[email protected]> Co-authored-by: dansman805 <[email protected]> Co-authored-by: Lunerwalker2 <[email protected]> Co-authored-by: Kevin Sheck <[email protected]> Co-authored-by: Dolphin2Point1 <[email protected]> Co-authored-by: Ethan Leitner <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.