Added template files, but this isn't working
This commit is contained in:
26
templates/basic/.gitignore
vendored
Normal file
26
templates/basic/.gitignore
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# Gradle
|
||||||
|
.gradle/
|
||||||
|
build/
|
||||||
|
gradle-app.setting
|
||||||
|
!gradle-wrapper.jar
|
||||||
|
|
||||||
|
# Android
|
||||||
|
*.apk
|
||||||
|
*.ap_
|
||||||
|
*.aab
|
||||||
|
local.properties
|
||||||
|
|
||||||
|
# IDEs
|
||||||
|
.idea/
|
||||||
|
*.iml
|
||||||
|
.vscode/
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*~
|
||||||
|
|
||||||
|
# OS
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Weevil
|
||||||
|
.weevil/
|
||||||
11
templates/basic/.weevil.toml.template
Normal file
11
templates/basic/.weevil.toml.template
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[project]
|
||||||
|
name = "{{PROJECT_NAME}}"
|
||||||
|
created = "{{CREATION_DATE}}"
|
||||||
|
weevil_version = "{{WEEVIL_VERSION}}"
|
||||||
|
template = "{{TEMPLATE_NAME}}"
|
||||||
|
|
||||||
|
[ftc]
|
||||||
|
sdk_version = "10.1.1"
|
||||||
|
|
||||||
|
[build]
|
||||||
|
gradle_version = "8.5"
|
||||||
53
templates/basic/README.md.template
Normal file
53
templates/basic/README.md.template
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# {{PROJECT_NAME}}
|
||||||
|
|
||||||
|
FTC Robot project created with Weevil {{WEEVIL_VERSION}} on {{CREATION_DATE}}.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
This is a minimal FTC robot project. Add your robot code in:
|
||||||
|
- `src/main/java/robot/opmodes/` - OpModes for TeleOp and Autonomous
|
||||||
|
- `src/main/java/robot/subsystems/` - Robot subsystems
|
||||||
|
- `src/main/java/robot/hardware/` - Hardware abstractions
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Setup environment (first time only)
|
||||||
|
weevil setup
|
||||||
|
|
||||||
|
# Build APK
|
||||||
|
weevil build
|
||||||
|
|
||||||
|
# Deploy to robot
|
||||||
|
weevil deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
## Project Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
{{PROJECT_NAME}}/
|
||||||
|
├── src/
|
||||||
|
│ ├── main/java/robot/
|
||||||
|
│ │ ├── hardware/ # Hardware interfaces
|
||||||
|
│ │ ├── subsystems/ # Robot subsystems
|
||||||
|
│ │ └── opmodes/ # TeleOp and Autonomous
|
||||||
|
│ └── test/java/robot/ # Unit tests
|
||||||
|
├── build.gradle # Build configuration
|
||||||
|
└── README.md # This file
|
||||||
|
```
|
||||||
|
|
||||||
|
## Next Steps
|
||||||
|
|
||||||
|
1. Add your robot hardware in `src/main/java/robot/hardware/`
|
||||||
|
2. Create subsystems in `src/main/java/robot/subsystems/`
|
||||||
|
3. Write OpModes in `src/main/java/robot/opmodes/`
|
||||||
|
4. Test and deploy!
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
- [Weevil Documentation](https://docs.weevil.dev)
|
||||||
|
- [FTC SDK Documentation](https://ftc-docs.firstinspires.org)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Created with [Weevil](https://weevil.dev) - FTC Project Generator
|
||||||
58
templates/basic/build.gradle.template
Normal file
58
templates/basic/build.gradle.template
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
plugins {
|
||||||
|
id 'com.android.application'
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace 'org.firstinspires.ftc.{{PACKAGE_NAME}}'
|
||||||
|
compileSdk 34
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId 'org.firstinspires.ftc.{{PACKAGE_NAME}}'
|
||||||
|
minSdk 24
|
||||||
|
targetSdk 34
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.0"
|
||||||
|
|
||||||
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
srcDirs = ['src/main/java']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
test {
|
||||||
|
java {
|
||||||
|
srcDirs = ['src/test/java']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
google()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation 'org.firstinspires.ftc:RobotCore:10.1.1'
|
||||||
|
implementation 'org.firstinspires.ftc:Hardware:10.1.1'
|
||||||
|
implementation 'org.firstinspires.ftc:FtcCommon:10.1.1'
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||||
|
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
testImplementation 'org.mockito:mockito-core:5.3.1'
|
||||||
|
}
|
||||||
17
templates/basic/settings.gradle
Normal file
17
templates/basic/settings.gradle
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
gradlePluginPortal()
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rootProject.name = 'FtcRobotController'
|
||||||
1
templates/basic/src/main/java/robot/hardware/.gitkeep
Normal file
1
templates/basic/src/main/java/robot/hardware/.gitkeep
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# This file ensures the directory is tracked by git even when empty
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
// Generated by Weevil {{WEEVIL_VERSION}} on {{CREATION_DATE}}
|
||||||
|
package robot.{{PACKAGE_NAME}};
|
||||||
|
|
||||||
|
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
|
||||||
|
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
|
||||||
|
import com.qualcomm.robotcore.hardware.DcMotor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Basic OpMode template for {{PROJECT_NAME}}
|
||||||
|
*
|
||||||
|
* This is a minimal starting point for your robot code.
|
||||||
|
* Add your hardware and control logic here.
|
||||||
|
*/
|
||||||
|
@TeleOp(name = "{{PROJECT_NAME}}: Basic", group = "TeleOp")
|
||||||
|
public class BasicOpMode extends OpMode {
|
||||||
|
|
||||||
|
// Declare your hardware here
|
||||||
|
// private DcMotor leftMotor;
|
||||||
|
// private DcMotor rightMotor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize hardware and setup
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
// Initialize your hardware
|
||||||
|
// leftMotor = hardwareMap.get(DcMotor.class, "left_motor");
|
||||||
|
// rightMotor = hardwareMap.get(DcMotor.class, "right_motor");
|
||||||
|
|
||||||
|
telemetry.addData("Status", "{{PROJECT_NAME}} initialized");
|
||||||
|
telemetry.addData("Created", "Weevil {{WEEVIL_VERSION}}");
|
||||||
|
telemetry.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs repeatedly after init, before play
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void init_loop() {
|
||||||
|
telemetry.addData("Status", "Waiting for start...");
|
||||||
|
telemetry.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs once when play is pressed
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void start() {
|
||||||
|
telemetry.addData("Status", "Running!");
|
||||||
|
telemetry.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main control loop - runs repeatedly during play
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void loop() {
|
||||||
|
// Add your control code here
|
||||||
|
|
||||||
|
// Example: Read gamepad and control motors
|
||||||
|
// double leftPower = -gamepad1.left_stick_y;
|
||||||
|
// double rightPower = -gamepad1.right_stick_y;
|
||||||
|
// leftMotor.setPower(leftPower);
|
||||||
|
// rightMotor.setPower(rightPower);
|
||||||
|
|
||||||
|
// Update telemetry
|
||||||
|
telemetry.addData("Status", "Running");
|
||||||
|
telemetry.addData("Project", "{{PROJECT_NAME}}");
|
||||||
|
// telemetry.addData("Left Power", leftPower);
|
||||||
|
// telemetry.addData("Right Power", rightPower);
|
||||||
|
telemetry.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs once when stop is pressed
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void stop() {
|
||||||
|
// Stop all motors
|
||||||
|
// leftMotor.setPower(0);
|
||||||
|
// rightMotor.setPower(0);
|
||||||
|
|
||||||
|
telemetry.addData("Status", "Stopped");
|
||||||
|
telemetry.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
1
templates/basic/src/main/java/robot/subsystems/.gitkeep
Normal file
1
templates/basic/src/main/java/robot/subsystems/.gitkeep
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# This file ensures the directory is tracked by git even when empty
|
||||||
1
templates/basic/src/test/java/robot/.gitkeep
Normal file
1
templates/basic/src/test/java/robot/.gitkeep
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# This file ensures the directory is tracked by git even when empty
|
||||||
Reference in New Issue
Block a user