Announcement

Collapse
No announcement yet.

Where can I find out how to add an op mode or rename one?

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

  • Where can I find out how to add an op mode or rename one?

    I looked through the posts and really didn't see anything about this. I hope that it's not a dumb question, but I was wondering where to look for instructions on adding an op mode or renaming one?

    Specifically, I was interested in:

    1) How would I add a new op mode - create one from scratch?

    2) How would I add a new op mode from a file that someone else made? Philbot made one for blinking the flash LED. I downloaded and looked at it, but how would I add it to the op modes on my copy of the FTC SDK project?

    3) What if I wanted to modify one of the existing op modes, but I wanted to keep the original. How would I make a copy of it, rename it and add it as a new op mode?

    I think in one of the FTC YouTube videos, Tom (?) says something about doing the last one, but that video is over an hour long.

  • #2
    Originally posted by matrixguy View Post
    3) What if I wanted to modify one of the existing op modes, but I wanted to keep the original. How would I make a copy of it, rename it and add it as a new op mode?
    In the list of opmodes, right click on the opmode that's most similar to the one you want, then select Copy. Right click again and select Paste. Give it a new name and press OK. Add the new opmode to the list in FtcOpModeRegister.

    For 1 and 2, do the same steps starting with the NullOp opmode, because it has almost no code. For #2, paste in Philbot's code at the end.
    John McDonnell
    Co-Mentor, Team 5873
    https://www.facebook.com/Team5873

    Comment


    • #3
      Its explained on page 93 of the FTC Training Manual available here: https://drive.google.com/file/d/0B7u...tSG9CTWFF/view

      The doc is also in the FTC SDK under ftc_app/doc/tutorial

      Enjoy!

      Comment


      • #4
        Originally posted by FTC4250 View Post
        Its explained on page 93 of the FTC Training Manual available here: https://drive.google.com/file/d/0B7u...tSG9CTWFF/view

        The doc is also in the FTC SDK under ftc_app/doc/tutorial

        Enjoy!
        This isn't necessarily the most logical behavior from the standpoint of developing the FTC SDK. Far more logical would be an @OpMode annotation that is scanned for by OpModeRegister. We shouldn't need to touch built-in templates as that breaks OO somewhat, but rather stick to simply subclassing and annotating to make the library aware of our classes.
        FTC6460 mentor (software+computer vision+electronics), FPGA enthusiast. In favor of allowing custom electronics on FTC bots.
        Co-founder of ##ftc live chat for FTC programming--currently you may need to join and wait some time for help--volunteer basis only.

        Comment


        • #5
          Thanks for the help!

          I thought about looking in the training manual before I posted, but I couldn't remember if it had said anything about this or not. If so, I figured that it probably only covered 3 and not 1 and 2. I figured that you might have to do something different for those - like maybe "import" the file for 2.

          I'm sorry I didn't check there first. I usually only get to use the computer for an hour or so each night during the week and maybe a couple of hours on Saturday so I don't always have a lot of time to search for things.

          BTW - I have a question I wanted to ask about motors, motor controllers, and drive trains, but I figured that it should probably be posted on a general forum.

          Comment

          Working...
          X