Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   CTRE CANTalon library installation not working (http://www.chiefdelphi.com/forums/showthread.php?t=153641)

PM_ME_UR_ROBOT 14-01-2017 12:51

CTRE CANTalon library installation not working
 
Hey everyone.

Due to the fact that WPI no longer supports the TalonSRX officially in their library, I went ahead and downloaded the CTR sponsored version and, because I'm on a Mac, I placed it into the folder I was instructed to place it in.

I went ahead and started Eclipse, and even though I had no errors importing the new class (com.ctre.CANTalon), the compile still failed when I tried to push the code onto the robot. I'll paste the error below, any help is appreciated.

compile:
[mkdir] Created dir: /Users/fitz/Documents/workspace/Tank Drive/build
[echo] [athena-compile] Compiling src with classpath=/Users/fitz/wpilib/java/current/lib/WPILib.jar:/Users/fitz/wpilib/java/current/lib/NetworkTables.jar:/Users/fitz/wpilib/java/current/lib/opencv.jar:/Users/fitz/wpilib/java/current/lib/cscore.jar to build
[javac] Compiling 1 source file to /Users/fitz/Documents/workspace/Tank Drive/build
[javac] /Users/fitz/Documents/workspace/Tank Drive/src/org/usfirst/frc/team4206/robot/Robot.java:3: error: package com.ctre does not exist
[javac] import com.ctre.CANTalon;
[javac] ^
[javac] /Users/fitz/Documents/workspace/Tank Drive/src/org/usfirst/frc/team4206/robot/Robot.java:27: error: cannot find symbol
[javac] CANTalon left, right, strafe;
[javac] ^
[javac] symbol: class CANTalon
[javac] location: class Robot
[javac] /Users/fitz/Documents/workspace/Tank Drive/src/org/usfirst/frc/team4206/robot/Robot.java:33: error: cannot find symbol
[javac] left = new CANTalon(1);
[javac] ^
[javac] symbol: class CANTalon
[javac] location: class Robot
[javac] /Users/fitz/Documents/workspace/Tank Drive/src/org/usfirst/frc/team4206/robot/Robot.java:34: error: cannot find symbol
[javac] right = new CANTalon(2);
[javac] ^
[javac] symbol: class CANTalon
[javac] location: class Robot
[javac] /Users/fitz/Documents/workspace/Tank Drive/src/org/usfirst/frc/team4206/robot/Robot.java:35: error: cannot find symbol
[javac] strafe = new CANTalon(3);
[javac] ^
[javac] symbol: class CANTalon
[javac] location: class Robot
[javac] 5 errors

BUILD FAILED
/Users/fitz/wpilib/java/current/ant/build.xml:92: Compile failed; see the compiler error output for details.

Total time: 1 second

PM_ME_UR_ROBOT 14-01-2017 13:33

Re: CTRE CANTalon library installation not working
 
Nevermind! The issue was resolved by installing instead to users/<USER>/wpilib/user/java/lib

We may have messed up and used the wrong installation path, but we're pretty sure CTR's tutorial for installing told us to do the wrong thing.

Either way, thanks to the guys in Discord for the help.

ashrutsood 14-01-2017 15:57

Re: CTRE CANTalon library installation not working
 
We found that the CTRE tutorial was outdated and it was best to use the example projects on Github as models (https://github.com/CrossTheRoadElec/FRC-Examples).

Following these instructions seemed to solve our build problem:
1: Download CTRE Toolsuite (No Installer) package 4.4.1.9 (.zip) from http://www.ctr-electronics.com/hro.h...ical_resources
2: Extract the downloaded Zip file.
3: Take the Java folder and Copy and Paste the entire folder into wpilib/user/
4: If you have any questions refer to the README in the root directory of the zipped folder.

ashrutsood 14-01-2017 16:02

Re: CTRE CANTalon library installation not working
 
I added the post above just in case someone in the future stumbles upon this thread and has the same issue.

addis687 14-01-2017 17:11

Re: CTRE CANTalon library installation not working
 
Hmm...interesting.... I seem to have the files in the correct place (checked with a teammate whose import worked without error). However, "com.ctre" cannot be resolved according to Eclipse. I wish the Talon software was still bundled with WPILIB :yikes:

bdaroz 14-01-2017 18:18

Re: CTRE CANTalon library installation not working
 
If it's just eclipse's internal build throwing the error - and the ANT build step is not, check your classpath/libraries in Eclipse - the CTRE .jar files may not be included.

wjd13 14-01-2017 20:54

Re: CTRE CANTalon library installation not working
 
Has anyone found any documentation/source code for the TalonSRX's?

Jacob C. 14-01-2017 21:58

Re: CTRE CANTalon library installation not working
 
Quote:

Originally Posted by wjd13 (Post 1631321)
Has anyone found any documentation/source code for the TalonSRX's?

How to use the Talon SRX API is outlined in the Software Reference Manual. The API docs for the entire CTRLib (javadocs and doxygen for C++) are included in the latest install and can also be found on our website for Java and C++.


Quote:

Originally Posted by ashrutsood (Post 1631186)
We found that the CTRE tutorial was outdated *snip*

Quote:

Originally Posted by PM_ME_UR_ROBOT (Post 1631122)
*snip* but we're pretty sure CTR's tutorial for installing told us to do the wrong thing. *snip*

Can I ask what "tutorial" you guys were using? For the non-installer zip, we consider the README it contains to be the official instructions, and it says:

Quote:

Take the folder for your desired language (java or cpp) and place it into the wpilib user folder.
It then proceeds to give an example of the Linux path and more detailed information about the files contained. Is there another set of instructions you were following? I just want to make sure we don't have conflicting instructions somewhere.


Quote:

Originally Posted by addis687 (Post 1631225)
Hmm...interesting.... I seem to have the files in the correct place (checked with a teammate whose import worked without error). However, "com.ctre" cannot be resolved according to Eclipse. I wish the Talon software was still bundled with WPILIB :yikes:

This might seem trivial, but have you restarted Eclipse? It puts external libraries into the path when you first open it.

gbonehead 22-01-2017 15:49

Re: CTRE CANTalon library installation not working
 
Quote:

Originally Posted by Jacob C. (Post 1631340)
How to use the Talon SRX API is outlined in the Software Reference Manual. The API docs for the entire CTRLib (javadocs and doxygen for C++) are included in the latest install and can also be found on our website for Java and C++.

Any chance the Java code is available somewhere? We've been trying to reverse engineer how the code actually works based on the examples, but code is even better than reverse engineering :)

I'm guessing based on the distribution that the majority of the code is probably C++ code with a JNI wrapper, but every little bit helps.

Thanks!
Burt Smith
FRC 571 Team Paragon


All times are GMT -5. The time now is 12:33.

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