Simulator help

For our team we have been trying to use robot simulator, however I have came into many issues.
Firstly many of the components of the robot is not shown on the simulator.
[CAN SPARK MAX] WPILib or External HAL Error: CAN: Message not found
[CAN SPARK MAX] Unable to retrieve SPARK MAX firmware version for CAN ID: 23. Please verify the deviceID field matches the configured CAN ID of the controller, and that the controller is connected to the CAN Bus.

The issue with CAN IDs also effect 21,22, and 25
I have made a wrapper class in for the simulation which shows the device in the simulator, however still gives the errors shown above

I have also connected a controller compatible with our code, however the program can not see it
Warning at edu.wpi.first.wpilibj.DriverStation.reportJoystickUnpluggedWarning(DriverStation.java:1097): Joystick Button 5 on port 0 not available, check if controller is plugged in

Along with so I have found errors I cannot seem to fix
Warning at edu.wpi.first.wpilibj.IterativeRobotBase.printLoopOverrunMessage(IterativeRobotBase.java:276): Loop time of 0.02s overrun

Watchdog not fed within 0.020000s

CTR: Firm Vers could not be retrieved. Use Phoenix Tuner to check ID and firmware(CRF) version.
Talon SRX 10
The one above also applies to number 11,12, and 13
I am a second year programmer on a our team, however I have very little experience in this field so any advice is also appericated

All of those except for the joystick stem from missing simulation support for the vendor libraries. I know CTRE has a new version out but not sure about rev. Are you using 2021 WPILIB?

not sure but probably not, want would it take to update it?

https://www.chiefdelphi.com/t/wpilib-blog-2021-kickoff-release-of-wpilib/389974/3
If you don’t know if you are, you’re not. It was released today.

As I’ve said in my post here, REV doesn’t have simulation support yet (though it’s on their roadmap). The joystick errors are also because of missing hardware, did you create and assign joysticks in the SimGUI?
Is your wrapper class on github? There might be an issue there.

We wrote a wrapper for SparkMAX to work in the simulation:

This was enough to get our driving working.

For the loop overruns in our code, most of those were for CAN devices which were not simulated. We have concentrated on the drivetrain, so we just put in a bunch of:
if (Robot.isReal()) { ... }
calls to ignore that code in the sim.

Have not yet tested the 2021 release, although we have been using the Dev 2020 version.

1 Like

I’ll just denote one key issue: don’t confuse SimDevice and SimDeviceSim. SimDevice defines the device’s properties while SimDeviceSim reads them. So teams should use SimDeviceSim.