My team and I recently acquired SDS Mk4 modules with NEOS. We have assembled them and tried setting them up. When we forked code from the SDS mk4 GitHub and updated everything to 2022. However, when we try to run our code, we get numerous errors. One of the errors says that there are multiple instances of a sparkmax with the same CAN ID. We are certain this isn’t a wiring issue as we’ve checked the CAN wires and used the rev hardware client. We also have given IDs to the CAN Encoders and none of those are numbered the same as the sparkmax. The sparkmax is always the front left drive motor (The first one listed in the code under the method CreateNeo)
We also get a CTR: CAN frame not received/too-stale error and we do not know the source of this error. We also get this error 8 times even though we only have 4 encoders.
The message “CANSparkMax instance has already been created with this device ID” suggests a software problem, not a hardware one. You are either creating your motors twice, or you have two motors sharing an id in the code. We could say more if you shared a link to your code.
Regarding the other message, you may find some suggestions in this thread useful, but if it’s only at start up and everything works after that, then I wouldn’t worry.
That error stacktrace is saying that you’re instantiating an object with a CAN ID that’s already in use. This can happen with something as silly as a simply typo, or as complex as a code path causing a command-based subsystem to get instantiated twice. Without code, we can’t say 100%.
What we can say, based on the stacktrace, is that whatever the second one is, is being created on line 109 (in the constructor method) of your DrivetrainSubsystem class.
I’m not personally familiar with the SDS library, so not much more help I can be for now.
It appears you are creating 2 drivetrain subsystems. One I robot and one in Robot container. Since drivetrain subsystem creates motor controllers you make another one for each can ID. Thus the failure.
yes fixing the first issue will resolve the second one. The Shuffleboard tab breaks because the data never makes it to the network tables, it breaks upon initialization.
Yes our code is working, however, it seems like our cancoders are booting into relative mode, as their degrees keep changing back to zero in shuffleboard but we have yet to figure out why.