Skip to content

FTC Codesim [SYNTH-295] - #1468

Open
BrandonPacewic wants to merge 34 commits into
devfrom
branp/295/ftc-codesim
Open

FTC Codesim [SYNTH-295]#1468
BrandonPacewic wants to merge 34 commits into
devfrom
branp/295/ftc-codesim

Conversation

@BrandonPacewic

@BrandonPacewic BrandonPacewic commented Jul 31, 2026

Copy link
Copy Markdown
Member

Task

SYNTH-295

Support FTC codesim in the Fission simulator.

Symptom

I don't think we have ever actually supported any variation of FTC codesim. Now we do.

Solution

Follows the same type of structure as our FRC codesim although its much simplier. FRC codesim requires and relies on the whole WPILib stack built against the actual manufacturer APIs. The FTC SDK is direct so we can simply setup a clean-room shimmed version of the handful of base classes we want and compile a team's raw .java OpMode source file directly with JDK.

This pr sets up just a handful of FTC classes needed to run a very basic TeleOp Arcade drive mode for dozer. It would be very easy for us to add more support later, this is just the initial scaffolding.

This PR does not setup any autonomous mode testing in FTC.

Verification

You may want to use this version of Dozer as it has labeled wheel joints.

  • Run cd simulation/SyntheSimFTC && ./gradlew build.
  • Run ./gradlew run --args="--src ../samples/FTCDozerArcadeDriveSample --opmode ExampleDozerArcadeDrive".
  • Open up the fission dev server while that is running.
  • Spawn Dozer in Fission, configure Brain -> FTC.
  • Configure Assets -> Simulation -> Wiring Panel.
    • Make the wiring panel look something like this:
image
  • You then should be able to drive with WASD on simulated code.

Before merging, ensure the following criteria are met:

  • All acceptance criteria outlined in the ticket are met.
  • Necessary test cases have been added and updated.
  • A feature toggle or safe disable path has been added (if applicable).
  • User-facing polish:
    • Ask: "Is this ready-looking?"
  • Cross-linking between Jira and GitHub:
    • PR links to the relevant Jira issue.
    • Jira ticket has a comment referencing this PR.

* 'dev' of github.com:Autodesk/synthesis: (106 commits)
  fix(config): drop the "Configuration saved" toast
  fix(topbar): splitdropdown sounds
  feat(topbar): toggle panel suggestion via topbar icons
  feat(UIProvider): toggle panel implementation
  fix(topbar): divider for code connection hidden
  fix: fallback to jolt mass if mass is 0
  feat(topbar): codesim icon change + updating imports
  fix: asan test specific error with shape result
  fix: jolt memory issues in `ZoneSceneObject.ts`
  fix: coverage broke
  fix: correct reporters for actions
  fix: update build script to not modify submodule
  fix: test related missuse of jolt objects
  feat: asan build and test step
  fix(ci/nix): nix develop command
  fix(ui): right click shows descriptiveName
  fix: mirabuf mass override was a no-op
  feat: show toast on reverted config
  feat: make "save" the default and show toast on panel override
  fix: make mutually exclusive panels fire close events for each other
  ...
@BrandonPacewic BrandonPacewic self-assigned this Jul 31, 2026
@BrandonPacewic
BrandonPacewic requested review from a team as code owners July 31, 2026 22:36
@BrandonPacewic BrandonPacewic added the codesim Related to code simulation label Jul 31, 2026

@PepperLola PepperLola left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a reason the FTC and FRC code simulation needs to be distinct on the Fission side? especially if they're going to be the same after systemcore. A lot of the system looks like it's a duplicate of the WPILib sim when it doesn't need to be (e.g., the web worker for the websocket looks to be pretty much exactly the same except for the WS endpoint?).

@PepperLola PepperLola left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, the roborio config modals are unused and I'm deleting them in my next PR, so there's no need to adapt that for FTC. I think ideally everything should work the same on the Fission side between FTC and FRC (since I don't know what would necessarily need to be different; the configuration is pretty flexible already?).

@BrandonPacewic

Copy link
Copy Markdown
Member Author

Is there a reason the FTC and FRC code simulation needs to be distinct on the Fission side? especially if they're going to be the same after systemcore. A lot of the system looks like it's a duplicate of the WPILib sim when it doesn't need to be (e.g., the web worker for the websocket looks to be pretty much exactly the same except for the WS endpoint?).

I combined both the web workers, those were mostly duplicated.

I believe everything else here is split correctly. WPI has a whole flow graph of SimInput/SimOutput/SimFlow/Nora-type etc. FTC has none of this and is simply motor power out, gamepad in. No bidirectional flow whatsoever.

Once we know what systemcore is going to look like we can likely move both FTC and FRC codesim to be the same process.

RoushilS

This comment was marked as outdated.

@RoushilS RoushilS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very glad to see FTC support in Synthesis!

@PepperLola PepperLola left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As far as I can tell, the only difference between the FTC brain and the WPILib one is that FTC handles gamepad input. When it comes to code sim, I think that should ideally be handled on the robot code side (the split of responsibilities should be the same between FRC and FTC code sim). At that point, we could keep all of the configuration we provide for FRC and use it for FTC, meaning users wouldn't have to learn how to do things separately. It would also be easier to maintain since we wouldn't have to maintain two systems that functionally do the same thing.

@PepperLola

PepperLola commented Aug 4, 2026

Copy link
Copy Markdown
Member

Are the Qualcomm files in SyntheSimFTC derived from the real library? If so, they need to retain the copyright notice

Also, FTCState and WPILibState are exactly the same except the WPILib one uses a "SimAutoReconnect" user preference and exports some constants. I would rather we reuse whatever we can and just change WPILibState to always automatically reconnect

FTCTypes are identical as well except for the added DcMotor, which I think should just be either a PWM or a regular SimDevice so we can reuse WPILib sim stuff.

Since we have complete control over the websocket spec for FTC code sim, it would be nice to have it match the WPILib one (e.g., use <> to denote inputs/outputs, same names, etc.). Ideally we would just treat the DcMotors as PWM devices on the Java side and then nothing in Fission would have to change.

Could we also have a human write the documentation?

Since we don't support configuring the websocket url/port, I don't think it makes sense to let users pass in a port to the op mode runner.

RoushilS and others added 9 commits August 6, 2026 11:16
Co-authored-by: Julian Wright <20529380+PepperLola@users.noreply.github.com>
* 'dev' of github.com:Autodesk/synthesis: (86 commits)
  Fix Drag Mode During Gizmo Move (#1480)
  chore: remove unneeded jsx fragments (#1474)
  Update Tabs Indicator on Content Size Change (#1428)
  Fix Configuration Input Selection (#1460)
  style: ran formatter
  Improved 2024 Field Collisions
  fix: make cancelling work and make endgame reset
  fix: use start time delay for autonomous
  feat: make match mode timer time-based
  feat: improve match result modal styling
  refactor: use null instead of explicit fallback value for camera selection
  refactor: use string UUIDs instead of incrementing integers
  fix: update array bracket formatting
  chore: refactor out new build parts functionality
  chore: update comments
  feat: obj mesh reduction fix
  feat: glTF dense meshes extra rung
  feat: mesh decimation for obj and gltf
  chore: update comments
  chore: cleanup comments
  ...
@BrandonPacewic

Copy link
Copy Markdown
Member Author

Are the Qualcomm files in SyntheSimFTC derived from the real library? If so, they need to retain the copyright notice

These shims were written from a decompiled signature list, the actual source content of these files is all closed source. Since we are effectively reimplementing an API for interop this falls under fair use.

@azaleacolburn azaleacolburn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Everything look great; I have a few nits about the java code, but they're not blocking imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codesim Related to code simulation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants