Announcement

Collapse
No announcement yet.

OpmodeRegister error message

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • OpmodeRegister error message

    I have been trying to create testcode by adapting the sample code. I first tried to run "TestDriveLinear" after adding it to the FtcOpmodeRegister file, under manual class registrations. AS produced an error message about the class symbol, which turned red. I fixed this by pressing Alt-Enter and accepting the suggestion. The class symbol then turned black. The opmode then compiled and installed. The robot moved back and forth, as per the program.

    I then thought I'd try to create my own version called "MyTestDriveLinear" . No luck. In the OpmodeRegister the symbol turned red, (as in manager.register("MyTestDriveLinear", MyTestDriveLinear.class)) and when run Gradle produced the following:

    C:\Users\Student\Documents\ftc_app-master 10-1-16\ftc_app-master\FtcRobotController\src\main\java\org\firsti nspires\ftc\robotcontroller\internal\FtcOpModeRegi ster.java:87: error: cannot find symbol
    manager.register("MyTestDriveLinear", MyTestDriveLinear.class);
    ^
    symbol: class MyTestDriveLinear
    location: class FtcOpModeRegister
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    1 error

    Why does AS not find the symbol? I followed all the steps in the training manual but it's very short on help if there's a problem. It seems to me that I need to define or declare something, somewhere, but I have no idea what, where or how.

    Can anyone help this befuddled newbie?

  • #2
    I'm not sure which training manual you are referring to, so excuse my questions.

    Any reason why you went the route of doing a manual registration?
    Normally you would just copy the opmode from Samples to TeamCode (modify it if you want), and just delete the @Disabled line at the beginning of the opmode.

    This eliminates the need to do a manual registration.
    The system automatically picks up the name and group that is assigned on the @TeleOp or @Autonomous lines and registers the opmode for you.
    The KEY is to delete (or comment out ) the @Disabled line.

    In fact, you should NOT be adding anything to the FtcOpmodeRegister file. I think this is your problem.

    Phil.

    Comment


    • #3
      I commented out the @disabled line and the lines registering the opmode in the FtcOpmodeRegister file. I had already copied the file to Teamcode. Gradle now builds sucessfully but no opmodes show up on the Driver Station.

      Comment


      • #4
        Not only do no opmodes show up, but I've noticed that for some reason the Robot Controller network status is: "active, disconnected". Any ideas as to why the two ZTE speeds are no longer communicating?

        Comment


        • #5
          If your phones are not communicating, you need to resolve that issue first. There are quite a few existing threads here discussing connection issues, you may want to review those, do some troubleshooting then come back and let us know the results.

          Comment


          • #6
            Originally posted by Stattz View Post
            Not only do no opmodes show up, but I've noticed that for some reason the Robot Controller network status is: "active, disconnected". Any ideas as to why the two ZTE speeds are no longer communicating?
            Yes, the opmodes aren't showing up BECAUSE your two phones aren't connecting.
            Start with the basic stuff.. since you have downloaded brand new versions, they may have "forgotten" who they are meant to be talking to...

            Go to your DS phone and use the three-dots menu to pair with your robot controller. Make sure the RC is on, so it can give to popup to accept the connection.

            After that, just restart each of the apps.

            Comment


            • #7
              Thanks for the help. I've resolved that issue and now have yet another to deal with...

              Comment


              • #8
                Originally posted by Stattz View Post
                Thanks for the help. I've resolved that issue and now have yet another to deal with...
                Whoa there....

                You were asking for help, and suggestions were made.

                It might help others to know what the ultimate resolution to your original problem was, and what mistakes were made (if any) that others could avoid.

                Information is much more useful than mere thanks

                Comment

                Working...
                X