Skip to content
frcvanPublic

About

Very Awesome Robot '27

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

VAR27: Very Awesome Robot '27

This is currently a WPILib 2027 + Commands V3 testing repository with simulation support.

Requirements

  • WPILib 2027 Alpha 7
  • Java 25
  • Git

Clone

git clone https://github.com/frcvan/var27
cd var27

Run

Run the desktop simulator, including the simulation GUI:

./gradlew simulateJava

Build the project and run its tests:

./gradlew build
./gradlew test

Wasm

org.teamvan.robot.WasmMain is the Web Image entry. It does not call RobotBase.startRobot and does not construct Robot, because both load HAL. The browser calls wasmTick() once every 20 ms. That tick reads inputs, runs Scheduler, publishes outputs, and writes /Sim/Pose/X, /Sim/Pose/Y, and /Sim/Pose/Rotation.

The host installs these functions on globalThis before calling wasmStart():

  • wasmNowNanos() returns monotonic time in nanoseconds.
  • wasmDs() returns {enabled, alliance, leftX, leftY, rightX}. alliance is "red" or "blue".
  • wasmNtGet(path) returns the current NetworkTables value, or undefined.
  • wasmNtPut(path, value) receives telemetry and the pose numbers.

web/sim/ is the keyboard driver station. WASD drives, Q and E rotate, and Shift selects the red alliance. Pushing main publishes that page and the Javadoc from .github/workflows/pages.yml.

./gradlew nativeCompile builds var27.js and var27.js.wasm. Desktop ./gradlew simulateJava is unchanged.

Debug mode

Debug mode is intended for a deployed RoboRIO application. It enables JMX profiling on port 1099; it does not enable a JDWP source-level debugger.

Deploy with debug mode enabled:

./gradlew deploy -PdebugMode

The RoboRIO must be reachable and the team number must be configured in WPILib preferences. The JMX endpoint is:

service:jmx:rmi:///jndi/rmi://roborio-<TEAM>-frc.local:1099/jmxrmi

You can also use the RoboRIO address 10.<TEAM/100>.2 in place of the hostname. For example, team 2600 uses 10.26.2.

VS Code

Install a JMX-capable Java extension or profiling tool, then create a JMX connection using the endpoint above. Use the RoboRIO hostname or IP address and port 1099.

VS Code's standard Java remote-debug attach command expects JDWP, so it will not connect to this JMX endpoint as a normal source debugger.

IntelliJ IDEA

Use IntelliJ's JMX support or a JMX-capable plugin to create a connection with the endpoint above. Select the RoboRIO hostname or IP address and port 1099.

IntelliJ's Remote JVM Debug configuration expects JDWP, so it will not connect to this JMX endpoint as a normal source debugger.

JMX remote authentication and SSL are disabled by this repository's debug configuration. Only use this mode on a trusted robot network.

About

Very Awesome Robot '27

Resources

Stars

1 star

Watchers

0 watching

Forks

Used by

Contributors

Languages