Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSL for TeleOp control #1

Open
broad-well opened this issue Apr 11, 2018 · 0 comments
Open

DSL for TeleOp control #1

broad-well opened this issue Apr 11, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@broad-well
Copy link
Member

This issue proposes the development and inclusion of a DSL (Domain-Specific Language) for TeleOp control from Gamepad to output columns.

Motivation

Communication between Programmers and Builders

A DSL for TeleOp allows builders to understand code that's written in it. This eliminates the need for builders (especially drivers) to always consult programmers for controller key-mappings.

Greater Understanding & Abstraction

By making the TeleOp control syntax more understandable, programmers can achieve greater efficiency in rapidly responding to key design decisions, improving overall team agility. By incorporating domain-specific abstraction above common TeleOp control patterns, repetition is reduced across teams.

Concerns

Lack of customizability

A key challenge in the implementation of this DSL is to permit greater flexibility for edge cases for teams. It is impossible to provide universal abstractions for every control pattern required, thus it is important for teams to have such capability. The inability to customize may induce inefficiencies in developing custom design patterns in accordance with the API that we provide. Code for past seasons should be examined for the most important design patterns, which should be included.

Technical Description

The DSL is expected to have a use case syntax similar to the following, replacing the current methodology.

@Override
public void loop() {
  // Binary input columns
  teleOpController.when(gamepad1.left_bumper).isPressed().then(glyphLift::raisePlatform);

  // Responding to change (toggles, etc.)
  teleOpController.when(gamepad1.right_bumper).isChanged().then(status -> if (status)
      drivetrain.togglePrecision());

  // Use analog input columns like binary ones
  teleOpController.when(gamepad1.left_trigger)
      .isAbove(0.7).then(chopsticks::raise)
      .isBelow(0.3).then(chopsticks::lower);
}
@broad-well broad-well added the enhancement New feature or request label Apr 11, 2018
LakeYin pushed a commit that referenced this issue Oct 4, 2018
Pulled FTC SDK v4.0 from ARC-Core
broad-well added a commit that referenced this issue Oct 12, 2018
* Updated the .gitignore

More useful .gitignore generated for Windows and Android Studio using gitignore.io

https://www.gitignore.io/

* Added macOS .gitignore settings

Used gitignore.io again

* Fixed and updated all of the gradle stuff to comply with the newer Android Studio versions

* Removing .idea syncing (1/2)

* Stop .idea syncing (Part 2/2)

* Added the DogeCV 2018 code as well as the DogeCV examples

* Stop .idea syncing(1/2)

* Changed the formatting to be more correct

* Fixed build.gradle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant