Files
FTC-Project-Gen/linux/templates/README.md.template
2026-01-24 12:39:32 -06:00

133 lines
3.0 KiB
Plaintext

# {{PROJECT_NAME}}
FTC robot project generated by FTC Project Generator v{{GENERATOR_VERSION}}.
## Quick Start
```bash
# Run tests
./gradlew test
# Watch tests (auto-rerun)
./gradlew test --continuous
# Build and check
./build.sh
# Deploy to robot
./deploy-to-robot.sh
```
## Project Structure
```
{{PROJECT_NAME}}/
├── src/main/java/robot/
│ ├── subsystems/ Your robot logic (tested on PC)
│ ├── hardware/ FTC hardware implementations
│ └── opmodes/ FTC OpModes for Control Hub
└── src/test/java/robot/ Unit tests (run without robot)
```
## Development Workflow
1. **Write code** in `src/main/java/robot/`
2. **Write tests** in `src/test/java/robot/`
3. **Run tests** with `./gradlew test --continuous`
4. **Tests pass** → You're good!
## Deployment to Robot
When ready to test on actual hardware:
1. **Uncomment FTC imports** in:
- `src/main/java/robot/hardware/MecanumDrive.java`
- `src/main/java/robot/opmodes/TeleOp.java`
2. **Run deployment script:**
```bash
./deploy-to-robot.sh
```
The script will:
- Deploy your code to SDK TeamCode
- Build APK
- Install to Control Hub (via USB or WiFi)
### Connection Methods
- **USB**: Just plug in and run (recommended)
- **WiFi**: Connect to 'FIRST-xxxx-RC' network (IP: 192.168.43.1)
- **Custom**: `./deploy-to-robot.sh -i 192.168.1.x`
## Adding New Subsystems
Follow the pattern:
1. **Create subsystem** with inner Hardware interface:
```java
public class MySubsystem {
public interface Hardware {
void doThing();
}
}
```
2. **Create test** with inline mock:
```java
class MySubsystemTest {
static class MockHardware implements MySubsystem.Hardware {
boolean didThing = false;
public void doThing() { didThing = true; }
}
}
```
3. **Create hardware impl** for robot (keep FTC imports commented during dev)
## Tips
- Keep FTC imports commented during development
- Write tests for everything - they run instantly on PC
- Use `./gradlew test --continuous` for fast iteration
- Multiple projects can share the same FTC SDK
## Commands
```bash
# Development (on PC)
./gradlew test Run all tests
./gradlew test --continuous Watch mode
# Before deployment
./build.sh Check for compile errors
./build.sh --clean Clean build
# Deploy to robot
./deploy-to-robot.sh Full deployment
./deploy-to-robot.sh --help Show options
# Other
./gradlew clean Clean build artifacts
./gradlew tasks List available tasks
```
## Upgrading
To upgrade this project to a newer version of the generator:
```bash
# From parent directory
ftc-new-project {{PROJECT_NAME}} --upgrade
```
This will update build files and scripts while preserving your code.
## Generated by FTC Project Generator
This project structure separates your robot code from the FTC SDK,
making it easy to test on PC and deploy when ready.
Generator version: {{GENERATOR_VERSION}}
FTC SDK version: {{FTC_VERSION}}