|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Missing CANTalon class
Obligatory "I'm not very experienced with Java nor programming robots in FRC," so feel free to be as critical as you want, everything is a learning process after all.
We've recently decided to use CAN on our robot to connect our Talon SRX controllers, only problem is that the original code we had done used the Talon class to initialize the speed controllers to build our RobotDrive. No big deal though, we just have to change Talon to CANTalon and remove the port numbers from the constructor since CAN doesn't use PWM and -- oh dear why is there so much red on my screen now? So the errors came from our program not having CANTalon imported into it, but when I try to import it using the following path, it says it does not exist: import edu.wpi.first.wpilibj.CANTalon; We're really not sure how to resolve this issue, all our other classes have imported just fine, but this one just doesn't seem to exist. There isn't much documentation saying I'd have to install some other plugins or update to a certain version for it to be available, so what am I doing wrong? Thanks in advance to anyone reading. tl;dr edu.wpi.first.wpilibj.CANTalon isn't being imported because it's missing, how can I make that not happen? |
|
#2
|
||||
|
||||
|
Re: Missing CANTalon class
As always, it really helps if we can see your full code. There could be confounding variables everywhere, and we can't see all the ways things can change. Can you perhaps upload it to GitHub?
Also, make sure you are using CANTalon, not CANTalonSRX, as that class was removed in 2016. |
|
#3
|
|||
|
|||
|
Re: Missing CANTalon class
Side note: Are your CANTalon constructors empty? If you removed the ports and didn't replace it with their integer CAN IDs then that would cause a compile-time error on its own.
Last edited by Tyler Scheuble : 22-09-2016 at 11:14. |
|
#4
|
|||
|
|||
|
Re: Missing CANTalon class
Quote:
https://github.com/carson-fitzgibbon/Robotics-Test As for the CANTalon vs CANTalonSRX thing, we are trying to use CANTalon. I made sure to give each constructor their own unique integer from 0 to 3 since we have four motor controllers. Problem isn't so much with the construction as it is the import not being found :/ |
|
#5
|
||||
|
||||
|
Re: Missing CANTalon class
The CAN ID is not a random number. It needs to match the ID you assigned to the actual motor controller. I don't think 0 is a valid CAN ID. You need to connect to the web interface of the RoboRIO and check the CAN ID of each CANTalon motor controller.
|
|
#6
|
||||
|
||||
|
Re: Missing CANTalon class
Unfortunately I'm not in a position to test it right now, but try removing
Code:
import edu.wpi.first.wpilibj.*; |
|
#7
|
|||
|
|||
|
Re: Missing CANTalon class
Quote:
|
|
#8
|
|||||
|
|||||
|
Re: Missing CANTalon class
Are you using the most updated WPILIB? The recommended IDE is eclipse so you would have had to follow special instructions to get it working with netbeans. If you are using an old WPILIB from the cRIO days that wouldn't have a CANTalon class. From your build.xml file I believe you are, all the old sunspot references are still in there.
|
|
#9
|
||||
|
||||
|
Re: Missing CANTalon class
Quote:
Also try it with eclipse. From my understanding NetBeans works only with older versions of WPILIB and the CRIO. The version of WPILIB that netbeans uses I don't believe to have been updated. |
|
#10
|
|||
|
|||
|
Re: Missing CANTalon class
Quote:
|
|
#11
|
|||||
|
|||||
|
Re: Missing CANTalon class
Quote:
|
|
#12
|
|||
|
|||
|
Re: Missing CANTalon class
Quote:
I recreated our project in Eclipse and copied the code over and now the error marking works, but more importantly: CANTalon works! Thank you all for the help. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|