fix: Bumped eocv to 1.5.0 and fixed openCameraDeviceAsync Impls#193
fix: Bumped eocv to 1.5.0 and fixed openCameraDeviceAsync Impls#193Lunerwalker2 merged 4 commits intoFTCLib:devfrom
Conversation
|
This is also a breaking change in that it requires a new OpenCV native library to be placed on the RC. |
|
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. |
|
Can you update the README with the new document information and update the FTCLib version in the gradle file to 2.0.0? |
|
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. |
Different PR 😊 |
| @Override | ||
| public void onError(int errorCode){ | ||
|
|
||
| } |
There was a problem hiding this comment.
Are we going to do nothing here? Same for the one in the pipeline example.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
*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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Returning a boolean is a great idea. I'm a fan of allowing user code to react to errors.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
The warning will show up at the top of the telemetry area, so that seems redundant.
There was a problem hiding this comment.
Good point, I'll leave it out then
|
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. |
|
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. |
|
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? |
|
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. |
JIceberg
left a comment
There was a problem hiding this comment.
Approved for EOCV update. Open a new PR for fixing the race condition.
* 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]>
Pull Requests
Please note that we accept pull requests from anyone, but that does not mean it will be merged.
What kind of change does this PR introduce?
Did this PR introduce a breaking change?
A breaking change includes anything that breaks backwards compatibility either at compile or run time.
The docs will need to be updated to include that the user must copy over the new libOpenCvAdndroid453.so from OpenCv-Repacked once this has been pushed out (thx Noah)
Please make sure your PR satisfies the requirements of the contributing page