Go to Post When we find bugs at work, we don't ask "who wrote that section of code?" We ask "Who is the best, most knowledgeable person to work on fixing this bug?" - Jon Stratis [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-01-2017, 20:04
DrewRoboroos DrewRoboroos is offline
Registered User
FRC #4537
 
Join Date: Jan 2017
Location: Australia
Posts: 3
DrewRoboroos is an unknown quantity at this point
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/s...ghlight=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(Rob otMap.java:86)
[java] at org.usfirst.frc4537.Steam2017V21.Robot.robotInit(R obot.java:51)
[java] at edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:65)
[java] at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:198)
[java] Caused by: java.lang.ClassNotFoundException: com.ctre.CANTalon
[java] at java.net.URLClassLoader.findClass(URLClassLoader.j ava:381)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:4 24)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:331)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:3 57)
[java] ... 4 more
[java] WARNING: Robots don't quit!
[java] ---> The startCompetition() method (or methods called by it) should have handled the exception above.
Reply With Quote
  #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: 1
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
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 14:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi