Quote:
Originally Posted by Pramizle
My team is having extreme difficulty in regards to using the CAN Jaguar class. The current code that we are using to initialize it is:
self.jaguar = wpilib.CANJaguar(1,4)
From this line of code we get an error saying that two values are needed but that the code is entering in three.
Please help. We are completely lost and are losing hair as well as sleep.
|
The error message is correct. In python there is an implicit first parameter called 'self', so when you pass it 2 parameters, you actually passed it three.
Instead, you should initialize the CANJaguar like so:
Code:
self.jaguar = wpilib.CANJaguar(1)
As referenced in the
RobotPy CANJaguar documentation, there's only a single parameter you need to pass to the CANJaguar object, which is the deviceNumber.
Make sure that you're using the very latest version of RobotPy, as the CANJaguar object has had a lot of bugfixes this season!
Quote:
Originally Posted by ozrien
did you mean...
self.jaguar = new CANJaguar(1);
... your using java right?
Also I only see one param for the constructor. What is '4' supposed to be. I assume '1' is the device ID.
|
This is the python forum.
