CANTalon support in FRCSim

I found this thread which seems to have been closed without a reply. Is there any plan to include CANTalong support for FRCSim, or am I simply missing a classpath?

https://www.chiefdelphi.com/forums/showthread.php?t=145240&highlight=frcsim

I’ve fought through to ensure both RobotBuilder and Eclipse understand the inclusion of the third party library. These are the messages in the Eclipse console when running the code in simulation mode. (The code runs on the robot but behaves badly so the simulator seemed safer.)

[echo] [simulate] You may now run Gazebo and your DriverStation
[echo] [simulate] Running Code.
[java] resources = |sun.misc.CompoundEnumeration@36aa7bc2|
[java] java.lang.NoClassDefFoundError: com/ctre/CANTalon
[java] at org.usfirst.frc4537.Steam2017V21.RobotMap.init(RobotMap.java:86)
[java] at org.usfirst.frc4537.Steam2017V21.Robot.robotInit(Robot.java:51)
[java] at edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:65)
[java] at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:198)
[java] Caused by: java.lang.ClassNotFoundException: com.ctre.CANTalon
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[java] … 4 more
[java] WARNING: Robots don’t quit!
[java] —> The startCompetition() method (or methods called by it) should have handled the exception above.

Our team did a similar thing for simulating the navx-frc board. The navx-frc is a third party navigation board with a java library, so I think the approach for the CAN Talon would be similar.

For including the third party java library in our build, we created a “libs” folder in the top level of the project structure and added the following line to the Ant build.properties file:
userLibs.dir=libs

I cloned the allwpilib github project: https://github.com/wpilibsuite/allwpilib
and did “git checkout v2017.2.1” or whatever is latest git tag. Then added a simulation implementation of the class. You can look at the other motor controller simulators in /wpilibj/src/sim/java folder of the git project. I would expect that your simulation CAN Talon class could just extend one of the existing motor controller simulation classes. The important thing is that your simulation class needs to have the exact same fully qualified name ( java package and name ) as the real class so that the real class will be replaced by your simulation class during simulation time. Then you need to rebuild the “wpilibjSimulation.jar” by running the following command from the top level of the git project:
gradlew -PmakeSim :wpilibj:wpilibjSimJar

and copy the wpilibj/build/libs/wpilibjSimulation.jar to ~/wpilib/simulation/jar/

Hope this helps.