![]() |
CAN Jaguar
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. |
Re: CAN Jaguar
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. |
Re: CAN Jaguar
Quote:
Instead, you should initialize the CANJaguar like so: Code:
self.jaguar = wpilib.CANJaguar(1)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:
|
Re: CAN Jaguar
I am also from the TeraViks. I knew that 'self' was implied, but how does one specify the use of the different Control Modes without this method.
|
Re: CAN Jaguar
I imagine you'd probably want to call the appropriate method. Maybe... changeControlMode?
To be fair, the documentation is a bit confusing in its format. The ControlMode displayed at the top is just enumerating what types are available, and does not indicate that it's a parameter you can pass to the constructor. |
Re: CAN Jaguar
Quote:
|
Re: CAN Jaguar
Now, when I try this:
Code:
self.jaguar = wpilib.CANJaguar(1)Code:
raise frccan.CANMessageNotFound("message not found") |
Re: CAN Jaguar
That sounds like a bug in RobotPy's WPILib. Do you have a stack trace you can paste?
|
Re: CAN Jaguar
Code:
16:07:23:251 INFO : wpilib : WPILib version 2015.0.8 |
Re: CAN Jaguar
Interesting. That error message is terrible -- but the code seems to indicate that it can't find the CANJaguar. Are you sure ID 1 is the right ID for the Jaguar -- or that perhaps there's another device on ID 1? Most of the time it is recommended to not use ID 1, as that's the default ID for a lot of devices.
|
Re: CAN Jaguar
Though I can't truly verify it, I checked it today and it said on the web interface that the PCM was assigned to Device ID #0 and the PDP was Device #2 and the Jaguar was assigned to Device #1. I will be back there on Tuesday.
|
Re: CAN Jaguar
Quote:
Devices of different types do not conflict so having the PCM and PDP both at 0 is not an issue. Another thing to check would be your CAN error counts on the last tab on the left side of the DS. |
Re: CAN Jaguar
A week ago it decided to work. One of the problems was that the Jaguar Device ID # couldn't ever be changed. We pressed the user button within 5 seconds. We just mucked with stuff, and eventually, the Jaguar worked, though we still were unable to change the ID.
I don't have any idea why it did that, but I just know to muck around with some semblance of method from what I learned and it might work. |
Re: CAN Jaguar
Thank you so much for all of your help. We were able to get it moving and moved on to bigger and better things... Like using PID :P
|
| All times are GMT -5. The time now is 19:50. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi