frc6941 / 2024-competition-robot

FRC 6941 IronPulse 2024 Competition Robot
4 stars 3 forks source link

Simulation: Crash after transition from Disabled -> Autonomous -> Disabled #27

Closed RealAllenDa closed 7 months ago

RealAllenDa commented 7 months ago

Bug Description Stable, reproducible crash when:

  1. Select 'Autonomous' in Robot State
  2. Select any other state other than Autonomous
  3. Back to 'Autonomous' <-- Crash occurs here

Error at net.ironpulse.RobotContainer.getAutonomousCommand(RobotContainer.java:114): Unhandled exception: java.lang.Exception: Originally composed at: at edu.wpi.first.wpilibj2.command.CommandScheduler.registerComposedCommands(CommandScheduler.java:599) at edu.wpi.first.wpilibj2.command.SequentialCommandGroup.addCommands(SequentialCommandGroup.java:47) at edu.wpi.first.wpilibj2.command.SequentialCommandGroup.(SequentialCommandGroup.java:33) at edu.wpi.first.wpilibj2.command.Command.beforeStarting(Command.java:218) at net.ironpulse.RobotContainer.getAutonomousCommand(RobotContainer.java:114) at net.ironpulse.Robot.autonomousInit(Robot.java:28) at edu.wpi.first.wpilibj.IterativeRobotBase.loopFunc(IterativeRobotBase.java:345) at edu.wpi.first.wpilibj.TimedRobot.startCompetition(TimedRobot.java:131) at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:365) at edu.wpi.first.wpilibj.RobotBase.lambda$startRobot$0(RobotBase.java:433) at java.base/java.lang.Thread.run(Thread.java:833)

Surprisingly generic java.lang.Exception.

RealAllenDa commented 7 months ago

Related to d7b67ee

RealAllenDa commented 7 months ago

cc @EvanLuo42

RealAllenDa commented 7 months ago

Underlying exception is

java.lang.IllegalArgumentException: Commands that have been composed may not be added to another composition or scheduled individually!

in getAutonomousCommand() -> registerComposedCommands(commands) at selected.beforeStarting(...) Returning selected without the decorator (by using a try-catch) after (1)(2) also crashes at (3).