Skip to content

Latest commit

 

History

History
102 lines (73 loc) · 5.33 KB

INSTALL.md

File metadata and controls

102 lines (73 loc) · 5.33 KB

Step-by-Step Installation Guide (Android Studio)

  1. In Android Studio, click on the "FtcRobotController" Module, then right-click on the FtcRobotController folder and click New > Module Step-1

  2. On the left part of this window, select "Java or Kotlin Library" Step-2

  3. From here, remove the :ftcrobotcontroller:lib in the "Library Name" section, and rename it to MeepMeepTesting. You may use whatever name you wish but the rest of the instructions will assume you have chosen the name MeepMeepTesting. Ensure that you also change the "class name" section to match Step-3

  4. Hit "Finish" at the bottom right of the Module Create window Step-4

  5. Open up the build.gradle file for the MeepMeepTesting module (or whatever you chose to name it prior). In the java section of this file, make sure all uses of JavaVersions are set to JavaVersion.VERSION_17 Step-5

  6. At the bottom of the file add the following gradle snippet:

repositories {
    maven { url = 'https://jitpack.io' }
    maven { url = 'https://maven.brott.dev/' }
}

dependencies {
    implementation 'com.github.rh-robotics:MeepMeep:v1.1.0'
}
  1. When android studio prompts you to make a gradle sync, click "Sync Now" Step-7

  2. Paste the following sample into your main class for the MeepMeepTesting module. Feel free to change this later

package com.example.meepmeeptesting;

import com.acmerobotics.roadrunner.geometry.Pose2d;

import org.rowlandhall.meepmeep.MeepMeep;
import org.rowlandhall.meepmeep.roadrunner.DefaultBotBuilder;
import org.rowlandhall.meepmeep.roadrunner.entity.RoadRunnerBotEntity;

public class MeepMeepTesting {
    public static void main(String[] args) {
        MeepMeep meepMeep = new MeepMeep(800);

        RoadRunnerBotEntity myBot = new DefaultBotBuilder(meepMeep)
                // Set bot constraints: maxVel, maxAccel, maxAngVel, maxAngAccel, track width
                .setConstraints(60, 60, Math.toRadians(180), Math.toRadians(180), 15)
                .followTrajectorySequence(drive -> drive.trajectorySequenceBuilder(new Pose2d(0, 0, 0))
                        .forward(30)
                        .turn(Math.toRadians(90))
                        .forward(30)
                        .turn(Math.toRadians(90))
                        .forward(30)
                        .turn(Math.toRadians(90))
                        .forward(30)
                        .turn(Math.toRadians(90))
                        .build());


        meepMeep.setBackground(MeepMeep.Background.FIELD_INTOTHEDEEP_JUICE_DARK)
                .setDarkMode(true)
                .setBackgroundAlpha(0.95f)
                .addEntity(myBot)
                .start();
    }
}
  1. Create a run configuration for Android Studio.

    1. First, click on the drop down menu on the top bar of Android Studio, where it says "TeamCode" with a little Android logo next to it Step-9 1

    2. Click Edit Configurations

      Step-9 2
    3. Click on the "+" symbol in the top left of the window Step-9 3

    4. Click Application Step-9 4

    5. Change the name to your liking (eg. "MeepMeep") Step-9 5

    6. Where it says "cp " click it to open the dropdown, and then select FtcRobotController.MeepMeepTesting.main Step-9 6

    7. Where it says "Main Class", click the little "file" icon to the right of the text and then select the name of the main class for your MeepMeepTesting module Step-9 7

    8. From here, in the bottom right of the window, press "Apply" then "Ok" Step-9 8

    9. It will now automatically switch to that Run/Debug Configuration profile

  2. If at any point you would like to build code onto your Control Hub or Phone, then click the Run/Debug configuration profile at the top to open the dropdown menu and select TeamCode. Perform the same steps to switch back to "MeepMeep"