Hi- Team 7318 mentor here. We are having some issues with our code: The robot drives fine as expected, however commands are not being executed by our Xbox controller on port 1. Driver Station shows the controller is connected and registered to port 1. The button presses are being received in DS. We have traced the program and can’t find anything obvious. Could somebody please offer some feedback? Unfortunately we don’t have access to Github on the school network so I am uploading a zip here. Thanks in advance! -7318
robot.zip (19.3 KB)
I see that many of your subsystems use the Spark (PWM) motor controller, but the drive subsystem uses the CANSparkMax controller. Can you confirm that you are actually using the Spark controller connected to PWM?
Other 7318 member here: Thanks for the input! Yes- our drivetrain is entirely on SparkMax and Rev Neos. Our other systems are all on regular Spark controllers and CIMs or BAG motors.
Try something like one of these. Since I don’t have the full code I can’t run any simulations. Didn’t know about the Elum thing though so that should come in handy some time.
Register a log/print callback with CommandScheduler.onCommandInitialize
(and possibly the other callbacks as well) to see what commands are getting scheduled. Commands might be getting interrupted or finishing in a way you’re not expecting.
As silly as this is: we have found the issue and gotten some closure…
Our PWM-Servo cables were plugged into the Spark Controllers backwards!!! Thanks for the suggestions everybody.
I would highly recommend you use SmartDashboard to help you visualize the scheduling of the subsystems.
There are callbacks you can set as well, but SmartDashboard puts make it really easy for our students to see what is going on. Here is how we do it in our code, this is Python but hopefully you can easily see how to convert it to Java.
Then, when you’re running your code just open Glass,Shuffleboard, or SmartDashboard and watch the entries from there. When a command is scheduled, the Currently scheduled value will change.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.