Fork of MeepMeep that supports Road Runner 1.0.
Video instructions found here: https://youtu.be/vdn1v404go8. Please note that it was recorded in 2021 and may be outdated at the time of viewing
-
In Android Studio, click on the "FtcRobotController" Module, then right click on the FtcRobotController folder and click
New > Module
-
On the left part of this window, select "Java or Kotlin Library"
-
From here, remove the
:ftcrobotcontroller:lib
in the "Library Name" section, and rename it toMeepMeepTesting
. You may use whatever name you wish but the rest of the instructions will assume you have chosen the nameMeepMeepTesting
. Ensure that you also change the "class name" section to match. -
Hit "Finish" at the bottom right of the Module Create window.
-
Open up the
build.gradle
file for the MeepMeepTesting module (or whatever you chose to name it prior). In this file, change all instancesJavaVersion.VERSION_1_7
toJavaVersion.VERSION_1_8
-
At the bottom of the file add the following gradle snippet:
repositories { maven { url = 'https://maven.brott.dev/' } maven { url = 'https://jitpack.io/' } } dependencies { implementation 'implementation 'com.github.fwprobotics:MeepMeep:v0.1.6' }
-
When android studio prompts you to make a gradle sync, click "Sync Now".
-
Create a class for your MeepMeepTesting java module if it does not yet exist. Paste the following sample in it. Feel free to change this later.
package com.example.meepmeeptesting;
import com.acmerobotics.roadrunner.Pose2d;
import com.noahbres.meepmeep.MeepMeep;
import com.noahbres.meepmeep.roadrunner.DefaultBotBuilder;
import com.noahbres.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)
.build();
myBot.runAction(myBot.getDrive().actionBuilder(new Pose2d(0, 0, 0))
.lineToX(30)
.turn(Math.toRadians(90))
.lineToY(30)
.turn(Math.toRadians(90))
.lineToX(0)
.turn(Math.toRadians(90))
.lineToY(0)
.turn(Math.toRadians(90))
.build());
meepMeep.setBackground(MeepMeep.Background.FIELD_POWERPLAY_OFFICIAL)
.setDarkMode(true)
.setBackgroundAlpha(0.95f)
.addEntity(myBot)
.start();
}
}
- Create a run configuration for Android Studio.
- 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.
- Click
Edit Configurations
- Click on the "+" symbol in the top left of the window, and when it prompts you, select "Application".
- Change the name to your liking (ex. meepmeep-run)
- Where it says "module not specified", click to open the dropdown, then select your JRE.
- Where it says "cp " click it to open the dropdown, and then select FtcRobotController.MeepMeepTesting.main
- 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.
- From here, in the bottom right of the window, press "Apply" then "Ok".
- It will now automatically switch to that Run/Debug Configuration profile.
- 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 MeepMeepRun.
- Open your MeepMeepTestsing java class file.
- Run one of your auto routes on
myBot
usingrunAction
:
myBot.runAction(myBot.getDrive().actionBuilder(new Pose2d(-30, 60, 0))
.strafeTo(new Vector2d(-30, 35))
.strafeTo(new Vector2d(-30, 12))
.strafeTo(new Vector2d(0, 12))
.strafeTo(new Vector2d(50, 18))
.strafeTo(new Vector2d(60, 60))
.build());
- Before the
start
line export the route by adding:
myBot.export("{your name}");
- Run the code and the route will be exported.
- Repeat this process until you've exported all your routes.
- Upload the routes in their respective section on CrowdScout
On some systems, hardware acceleration may not be enabled by default.
To enable hardware acceleration use the cli flag: -Dsun.java2d.opengl=true
.
Or, enable it before initializing your MeepMeep
instance with the following snippet:
System.setProperty("sun.java2d.opengl", "true");
Declare a new RoadRunnerBotEntity
and add it via MeepMeep#addEntity(Entity)
.
package com.example.meepmeeptesting;
import com.acmerobotics.roadrunner.Pose2d;
import com.noahbres.meepmeep.MeepMeep;
import com.noahbres.meepmeep.core.colorscheme.scheme.ColorSchemeBlueDark;
import com.noahbres.meepmeep.core.colorscheme.scheme.ColorSchemeRedDark;
import com.noahbres.meepmeep.roadrunner.DefaultBotBuilder;
import com.noahbres.meepmeep.roadrunner.entity.RoadRunnerBotEntity;
public class MeepMeepTesting {
public static void main(String[] args) {
MeepMeep meepMeep = new MeepMeep(800);
// Declare our first bot
RoadRunnerBotEntity myFirstBot = new DefaultBotBuilder(meepMeep)
// We set this bot to be blue
.setColorScheme(new ColorSchemeBlueDark())
.setConstraints(60, 60, Math.toRadians(180), Math.toRadians(180), 15)
.build();
myFirstBot.runAction(myFirstBot.getDrive().actionBuilder(new Pose2d(0, 0, 0))
.lineToX(30)
.turn(Math.toRadians(90))
.lineToY(30)
.turn(Math.toRadians(90))
.lineToX(0)
.turn(Math.toRadians(90))
.lineToY(0)
.turn(Math.toRadians(90))
.build());
// Declare out second bot
RoadRunnerBotEntity mySecondBot = new DefaultBotBuilder(meepMeep)
// We set this bot to be red
.setColorScheme(new ColorSchemeRedDark())
.setConstraints(60, 60, Math.toRadians(180), Math.toRadians(180), 15)
.build();
mySecondBot.runAction(mySecondBot.getDrive().actionBuilder(new Pose2d(30, 30, Math.toRadians(180)))
.lineToX(0)
.turn(Math.toRadians(90))
.lineToY(0)
.turn(Math.toRadians(90))
.lineToX(30)
.turn(Math.toRadians(90))
.lineToY(30)
.turn(Math.toRadians(90))
.build());
meepMeep.setBackground(MeepMeep.Background.FIELD_FREIGHTFRENZY_ADI_DARK)
.setDarkMode(true)
.setBackgroundAlpha(0.95f)
// Add both of our declared bot entities
.addEntity(myFirstBot)
.addEntity(mySecondBot)
.start();
}
}
Default Bot Settings:
- Constraints
- Max Vel: 30in/s
- Max Accel: 30in/s/s
- Max Ang Vel: 60deg/s
- Max Ang Accel: 60deg/s/s
- Track Width: 15in
- Bot Width: 18in
- Bot Width: 18in
- Start Pose: (x: 0in, y: 0in, heading: 0rad)
- Color Scheme: Inherited from MeepMeep.colorManager unless overriden
- Drive Train Type: Mecanum