acmerobotics / ftc-dashboard

React-based web dashboard designed for FTC
https://acmerobotics.github.io/ftc-dashboard
Other
166 stars 124 forks source link

Having trouble with FTC SDK 6.1 #45

Closed alan412 closed 3 years ago

alan412 commented 3 years ago

Version FTC-Dashboard: 0.4.0 Version FTC SDK: 6.1

The dashboard comes up and says "Op mode controls have not initialized"

This is using Control Hub.

Our code is here if you want to try directly: https://github.com/ftc16072/UltimateGoal20-21/tree/openCV

rbrott commented 3 years ago

Looks like you have the proper call. I suspect it's just a weird hardware attachment start that messes up the normal activity lifecycle. Does the issue persist after you restart?

alan412 commented 3 years ago

Yes, it persists after a restart. Our electronics this year are pretty vanilla. CH -> EH, a Logitech C270 off of USB, all standard motors and encoder wires. some of the servos go through a servo power module, others are directly connected. The only sensor connected is a 2M REV Distance sensor. A REV Blinkin is on one of the servo ports. We have a REV grounding strap and power is going through an XT30 expansion module.

I can try to go get our spare CH today and try it with nothing attached. In the meantime, If you build our code and put it on your hardware, does it give you the list of opmodes? (The configuration xml file is out of date so you won't be able to init an opmode, but if you get the list of opmodes then you are getting farther.)

I know this worked for us a while back on the CH ( we were using it to tune where our OpenCV is looking). Unfortunately a TON of changes (both hardware and software including upgrading the SDK since then). It looks like we rebased our commits on that branch so I am not sure I can find exact code that works. (That was with 0.3.1. We were getting a problem about opmode not attaching (sorry I don't have the exact wording) so we upgraded to 0.4.0)

rbrott commented 3 years ago

If you build our code and put it on your hardware, does it give you the list of opmodes?

Unfortunately I don't have any hardware at the moment.

(That was with 0.3.1. We were getting a problem about opmode not attaching (sorry I don't have the exact wording) so we upgraded to 0.4.0)

Makes sense. The 0.3.x "Event loop detached" error message was replaced by "Op mode controls have not initialized" in 0.4.0.

NoahAndrews commented 3 years ago

Is your Expansion Hub connected to the Control Hub via USB or RS-485?

alan412 commented 3 years ago

RS-485.

On Wed, Jan 27, 2021 at 3:26 PM Noah Andrews notifications@github.com wrote:

Is your Expansion Hub connected to the Control Hub via USB or RS-485?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/acmerobotics/ftc-dashboard/issues/45#issuecomment-768555124, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAF3Y74YU4FFTMX6L4U2BE3S4BZIPANCNFSM4WUPUCCQ .

alan412 commented 3 years ago

A few things I discovered last night (all on a Control Hub with nothing connected to it except power)

My current guess is that it is something in EasyOpenCV newer versions that requires FTC SDK 6.1 that breaks but I haven't been able to prove that yet.

alan412 commented 3 years ago

Ok. I found the issue after a bunch of dead ends and it is in our code. A student made a static variable inside a class that was annotated with @Config and was writing to it inside a class method. Even though this class method was never called, this made FtcDashboard very upset and refuse to register OpModes. (While we can quibble that the error message could be clearer, it is clearly a bug in our code.)

rbrott commented 3 years ago

Huh I think might qualify as a bug. Could you link the offending variable in context?