View Single Post
  #2   Spotlight this post!  
Unread 31-01-2017, 23:48
rtielking rtielking is offline
Registered User
FRC #4330
 
Join Date: Jan 2017
Location: St Louis
Posts: 2
rtielking is an unknown quantity at this point
Re: CANTalon support in FRCSim

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.
Reply With Quote