Announcement

Collapse
No announcement yet.

TeamCode detailed explanation?

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

  • TeamCode detailed explanation?

    I see mention in the release notes of TeamCode, as well as in the FTC_SDK_UserMan_v2_2_rel01.pdf (which, by the way, is _not_ in the github docs folder, as far as I can tell - I can't even figure out any more where I got it from).

    A) I'd like to request that FIRST update the github ... /docs/ folder with the current FTC SDK User Manual, and
    B) That a somewhat more extensive note be provided on best practices for using the TeamCode folder, etc, in Android Studio ...

    I can probably figure it out, but it would be easier for me and others if more detail could be provided.

    Thanks,

    Martin Haeberli
    (de-)Mentor, FTC 7593, TigerBots

  • #2
    The TeamCode folder is where you will store your opmodes. No more changing FtcOpModeRegister.java every time you pick up a new version of the SDK - you can just copy the op modes from the old SDK's TeamCode folder to the new SDK's TeamCode folder (you might be able to just overwrite your old SDK with your new one, but I haven't tried that). The sample opmodes have moved to a different folder; if you want to borrow from a sample op mode, open Android Studio and do these steps:
    1. If the “1: Project” panel isn’t open, open it using the button on the left side of the screen. Expand the FtcRobotController node, then browse to the src -- java -- org.firstinspires.ftc.robotcontroller -- external.samples folder. This has the sample opmodes which you can customize to your needs. Select an op mode (e.g., “SensorMRColor”), right-click and choose Copy.
    2. Expand the TeamCode node, then browse to and select the src – main – java – org.firstinspires.ftc.teamcode node. Right click and choose Paste. In the CopyClass dialog, enter a new name (e.g., Team1234SensorTest) and press OK.
    3. In the Team1234SensorTest.java file, find the three lines which look like:

      @TeleOp(name = "Sensor: MR Color", group = "Sensor")
      @Disabled
      public class Team1234SensorTest extends LinearOpMode {
    4. Remove the middle line (“@Disabled”). You can also change the "Sensor: MR Color" to a better name such as “Sensor Test”; whatever you type between the quotes will show up in the list of op modes on the Driver Station device.
    5. Make any other code changes required.
    6. Plug in your device to your computer's USB port. In Android Studio's Run menu, select Run 'TeamCode'.


    Hope this helps,
    John McDonnell
    Co-Mentor, Team 5873
    https://www.facebook.com/Team5873

    Comment


    • #3
      John,
      Thanks!
      Martin Haeberli
      (de-)Mentor, FTC 7593, TigerBots

      Comment


      • #4
        I based my previous comment on the readme here. Also, the readme for the sample code guidelines are worth reading, but there is some duplication with the other readme.
        John McDonnell
        Co-Mentor, Team 5873
        https://www.facebook.com/Team5873

        Comment


        • #5
          Originally posted by mhaeberli View Post
          I see mention in the release notes of TeamCode, as well as in the FTC_SDK_UserMan_v2_2_rel01.pdf (which, by the way, is _not_ in the github docs folder, as far as I can tell - I can't even figure out any more where I got it from).

          I can probably figure it out, but it would be easier for me and others if more detail could be provided.
          (de-)Mentor, FTC 7593, TigerBots
          Check out my tutorial videos: Starting with MyFirstOpmode

          https://www.youtube.com/watch?v=TKPscPqsz8s

          The were created when the 2.0 Beta came out, so there are some small changes for 2.2, but they explain how to use the teamcode folder and sample opmodes.

          Phil.

          Comment

          Working...
          X