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

WPILibBrain Mapping #1043

Merged
merged 23 commits into from
Jul 26, 2024
Merged

WPILibBrain Mapping #1043

merged 23 commits into from
Jul 26, 2024

Conversation

PepperLola
Copy link
Member

@PepperLola PepperLola commented Jul 24, 2024

Changes:

  • Added mapping of PWM and CAN groups
    • Modals to select initialized PWM ports and drivers
  • Added mirabuf joint instance info to drivers so the config UI can display joint names along with driver types to better differentiate them when selecting

Testing:

  1. Run simulator
  2. Create PWM group (CAN not within the scope of this PR)
    1. Ensure WS data is there and only the initialized PWM port (0 in Java sample code) shows up on the left
    2. Ensure driver type and joint names show up on the right
  3. When in disconnected or disabled mode, console should print 0 0, meaning port 0 and speed 0
  4. Enable autonomous mode in the simulator and ensure it now prints 0 0.5
  5. Enable teleop mode and ensure it prints 0 0.25

Note

There is commented out PWM driving code in WPILibBrain.ts in the PWMGroup class Update method. You can uncomment it to make the robot actually move instead of just printing the speed to the console.

Running the simulator

  1. Navigate to the simulation directory in the root of the synthesis project
  2. Navigate into `SyntheSimJava
  3. Run ./gradlew build && ./gradlew publishToMavenLocal
  4. Navigate to simulation/samples/JavaSample
  5. Install WPILib utilities if you don't have them
  6. Open the JavaSample project in WPILib VSCode
  7. Install Phoenix v6 and REVLib vendor libraries
    1. https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2024-latest.json
    2. https://software-metadata.revrobotics.com/REVLib-2024.json
  8. Run ./gradlew build && ./gradlew simulateJava

Note

See the SyntheSimJava README for documentation on the library.

JIRA Issue

@PepperLola PepperLola requested a review from a team as a code owner July 24, 2024 18:18
@PepperLola PepperLola changed the base branch from master to dev July 24, 2024 18:19
@PepperLola PepperLola requested review from HunterBarclay and a team as code owners July 24, 2024 18:19
@PepperLola PepperLola requested review from a-crowell and LucaHaverty and removed request for a team, a-crowell and LucaHaverty July 24, 2024 18:19
@PepperLola PepperLola self-assigned this Jul 24, 2024
@PepperLola PepperLola changed the title jwrigh/1746/wpilibbrain mapping WPILibBrain Mapping Jul 24, 2024
Copy link
Member

@azaleacolburn azaleacolburn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It worked perfectly

Copy link
Member

@azaleacolburn azaleacolburn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@azaleacolburn azaleacolburn mentioned this pull request Jul 26, 2024
9 tasks
Copy link
Member

@BrandonPacewic BrandonPacewic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It indeed works, looking forward to what the final product of this is going to look like.

@HunterBarclay HunterBarclay merged commit 3799d07 into dev Jul 26, 2024
13 checks passed
@HunterBarclay HunterBarclay deleted the jwrigh/1746/wpilibbrain-mapping branch July 26, 2024 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants