Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .gitattributes

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy Release

on:
release:
types: [released, prereleased]

jobs:
deploy-release:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission
run: chmod +x gradlew
- name: Extract version (strip leading v)
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Deploy to Maven Central
run: ./gradlew deployCentralPortal -Pversion=$VERSION
env:
MVN_GPG_KEY: ${{ secrets.MVN_GPG_KEY }}
MVN_GPG_PASSWORD: ${{ secrets.MVN_GPG_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
VERSION: ${{ env.VERSION }}
27 changes: 27 additions & 0 deletions .github/workflows/deploy-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy Snapshot

on:
push:
branches: [develop]

jobs:
deploy-snapshot:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission
run: chmod +x gradlew
- name: Deploy Snapshot
run: ./gradlew deployNexusSnapshot -Pversion=$VERSION-SNAPSHOT
env:
MVN_GPG_KEY: ${{ secrets.MVN_GPG_KEY }}
MVN_GPG_PASSWORD: ${{ secrets.MVN_GPG_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
50 changes: 46 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,48 @@
# Ignore Gradle project-specific cache directory
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

# Ignore Gradle build output directory
build
/local.properties
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Kotlin ###
.kotlin

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store

### Junie
/.junie/
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/AndroidProjectSystem.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions .idea/compiler.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/copyright/NextFTC_Copyright.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

4 changes: 1 addition & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions .idea/kotlin-statistics.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 0 additions & 17 deletions .idea/runConfigurations.xml

This file was deleted.

Empty file.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.
108 changes: 108 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# NextControl

![GitHub Release](https://img.shields.io/github/v/release/NextFTC/NextControl?sort=semver&label=version)
![GitHub Repo stars](https://img.shields.io/github/stars/NextFTC/NextControl?style=flat)
![GitHub last commit](https://img.shields.io/github/last-commit/NextFTC/NextControl)

NextControl is an open-source control library for
the [FIRST Tech Challenge](https://www.firstinspires.org/robotics/ftc). It provides a robust system for creating any
controller imaginable.

The docs are at [nextftc.dev/control](https://nextftc.dev/control).

## Getting Started

### Prerequisites

Ensure you have a copy of [FtcRobotController](https://github.com/FIRST-Tech-Challenge/FtcRobotController).

### Installing

In `build.dependencies.gradle`, add the dependency:

```groovy
implementation 'dev.nextftc:control:VERSION'
```

Replace `VERSION` with the latest version (shown at the top of this README).

## Basic Usage

Create a PID controller:

*Kotlin:*

```kotlin
val controlSystem = controlSystem {
posPid(0.005, 0.0, 0.0)
}
```

*Java:*

```java
ControlSystem controlSystem = ControlSystem.builder()
.posPid(0.005, 0, 0)
.build();
```

Then every loop set your motor power:

*Kotlin:*

```kotlin
motor.power = controlSystem.calculate(
KineticState(motor.position, motor.velocity)
)
```

*Java:*

```java
motor.setPower(
controlSystem.calculate(
KineticState(motor.getPosition(),motor.

getVelocity())
)
);
```

For more in-depth usage, read the [docs](https://nextftc.dev/control).

## Built With

- [Kotlin](https://kotlinlang.org/) - A modern, expressive, statically typed, general-purpose programming language for
the JVM developed by JetBrains and sponsored by Google.
- [Gradle](https://gradle.org/) – Powerful build system for automating compilation, testing, and publishing
- [Kotest](https://kotest.io/) – Flexible and expressive testing framework for Kotlin
- [MockK](https://mockk.io/) – Mocking library for Kotlin

## Contributing

Please read our [contributing page](https://nextftc.dev/contributing) for details on our code
of conduct, and the process for submitting pull requests to us.

## Versioning

We use [Semantic Versioning](http://semver.org/) for versioning. For the versions available, see the [releases on this
repository](https://github.com/NextFTC/NextControl/releases).

## Authors

- [Davis Luxenberg](https://github.com/beepbot99)
- [Zach Harel](https://github.com/zachwaffle4)
- [Rowan McAlpin](https://rowanmcalpin.com)

See also the list of
[contributors](https://github.com/NextFTC/NextControl/contributors)
who participated in this project.

## License

This project is licensed under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.html)

You are free to use, modify, and distribute this software under the terms of the GPLv3. Any derivative work must also be
distributed under the same license.

See the [LICENSE](LICENSE) for more information.
Loading