wpilibsuite / wpilibsuite/SystemcoreTesting

Simulation does not crash on double-allocated SmartIO

Open
#124 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Not Implemented Yet WPILib
Dominant language
Java
Stars
186
Forks
24
Avg merge
8h 27m
Merged PRs (30d)
9

Description

MRE:

public class Robot extends TimedRobot {
  /**
   * This function is run when the robot is first started up and should be used for any
   * initialization code.
   */
  public Robot() {
    var in0 = new PWMSparkMax(0);
    var alsoIn0 = new DigitalInput(0);
  }
}

This code will crash on a systemcore (as expected), but runs fine in simulation.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Java Robot constructor in the MRE and trace how PWMSparkMax(0) and DigitalInput(0) are handled in simulation versus on a systemcore. Reproduce the example in simulation and compare its allocation behavior with the expected crash for a double-allocated SmartIO.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
embedded-iot, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.