Anyone can help me fix this code?

arning  44007 554.480
FRC: Time since robot boot.Warning  44007 554.499
Warning  44007 554.519
Warning  44007 554.539
FRC: Time since robot boot. ********** Robot program starting ********** 
 NT: Listening on NT3 port 1735, NT4 port 5810 
 NT: Got a NT4 connection from 172.22.11.1 port 56207 
 NT: CONNECTED NT4 client ‘Dashboard@1’ (from 172.22.11.1:56207) 
Warning  1  CANSparkMax object created for CAN ID 9, which is not a SPARK MAX. Some functionalities may not work.  com.revrobotics.CANSparkMax.(CANSparkMax.java:50) 
 Warning at com.revrobotics.CANSparkMax.(CANSparkMax.java:50): CANSparkMax object created for CAN ID 9, which is not a SPARK MAX. Some functionalities may not work. 
 at com.revrobotics.CANSparkMax.(CANSparkMax.java:50) 
 at frc.robot.subsystems.SwerveModule.(SwerveModule.java:52) 
 at frc.robot.subsystems.SwerveSubsystem.(SwerveSubsystem.java:16) 
 at frc.robot.RobotContainer.(RobotContainer.java:16) 
 at frc.robot.Robot.robotInit(Robot.java:30) 
 at edu.wpi.first.wpilibj.TimedRobot.startCompetition(TimedRobot.java:107) 
 at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:366) 
 at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:458) 
 at frc.robot.Main.main(Main.java:23) 
 
ERROR  1  Unhandled exception: edu.wpi.first.hal.util.AllocationException: Code: -1030
Invalid Index for Analog Input
Status: -1030
Minimum: 0 Maximum: 8 Requested: 9  frc.robot.subsystems.SwerveModule.(SwerveModule.java:63) 
 Error at frc.robot.subsystems.SwerveModule.(SwerveModule.java:63): Unhandled exception: edu.wpi.first.hal.util.AllocationException: Code: -1030 
 Invalid Index for Analog Input 
 Status: -1030 
 Minimum: 0 Maximum: 8 Requested: 9 
 at edu.wpi.first.hal.AnalogJNI.initializeAnalogInputPort(Native Method) 
 at edu.wpi.first.wpilibj.AnalogInput.(AnalogInput.java:47) 
 at frc.robot.subsystems.SwerveModule.(SwerveModule.java:63) 
Warning  1  The robot program quit unexpectedly. This is usually due to a code error.
The above stacktrace can help determine where the error occurred.
See Reading Stacktraces — FIRST Robotics Competition documentation for more information.  edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:380) 
 at frc.robot.subsystems.SwerveSubsystem.(SwerveSubsystem.java:16) 
 at frc.robot.RobotContainer.(RobotContainer.java:16) 
 at frc.robot.Robot.robotInit(Robot.java:30) 
 at edu.wpi.first.wpilibj.TimedRobot.startCompetition(TimedRobot.java:107) 
 at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:366) 
 at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:458) 
 at frc.robot.Main.main(Main.java:23) 
 
 Warning at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:380): The robot program quit unexpectedly. This is usually due to a code error. 
 The above stacktrace can help determine where the error occurred. 
 See Reading Stacktraces — FIRST Robotics Competition documentation for more information. 
ERROR  1  The startCompetition() method (or methods called by it) should have handled the exception above.  edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:387) 
 Error at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:387): The startCompetition() method (or methods called by it) should have handled the exception above. 
Warning  0  [phoenix-diagnostics] Server shutdown cleanly. (dur:0)  
Warning  0  [phoenix] Library shutdown cleanly  
 # 
 # A fatal error has been detected by the Java Runtime Environment: 
 # 
 # SIGSEGV (0xb) at pc=0xb6df5fc0, pid=3619, tid=3623 
 # 
 # JRE version: OpenJDK Runtime Environment (17.0.9.7) (build 17.0.9.7-frc+0-2024-17.0.9u7-1) 
 # Java VM: OpenJDK Client VM (17.0.9.7-frc+0-2024-17.0.9u7-1, mixed mode, emulated-client, serial gc, linux-arm) 
 # Problematic frame: 
 # C [libc.so.6+0x6bfc0] 
 # 
 # No core dump will be written. Core dumps have been disabled. To enable core dumping, try “ulimit -c unlimited” before starting Java again 
 # 
 # An error report file with more information is saved as: 
 # /tmp/hs_err_pid3619.log

When I Deploy code to robot , It’s display this in driver station console
and driver station display No Robot Code

This is what you want to dig into.

This page gives more background into reading stack traces that can be helpful in figuring out what the error is.

1 Like

It has something to do with a joystick or trigger value you are trying to access being invalid. If you need feather help it would be nice to see the source code.