![]() |
setX() not working
Not sure if I should post this here or in the Java section...
I was trying to use setX to set a speed of the motor. I set up the speed and position references. But the Jaguar would not do anything (RobotDrive works fine). I did not set PID and am wondering if this could be the problem. Thanks in advance for your help. |
Re: setX() not working
Quote:
-Joe |
Re: setX() not working
related question: is there a default number of ticks per revolution? I had everything you listed set but that value, and the speed was always reported as 0.0. Tomorrow I'll try setting some arbitrary value (or maybe look up the proper one :p ).
|
Re: setX() not working
Quote:
-Joe |
Re: setX() not working
Ok, so I set the number of ticks, and setSpeed still does not seem to work. Here's what I've written.
Code:
CANJaguar jag;Code:
public void teleopPeriodic() { |
Re: setX() not working
Quote:
-Joe |
Re: setX() not working
I forgot to mention that with 100 ticks per revolution, my test rig reaches a max speed of 900 rpm. I'll try P=100 today, along with many other combinations of constants, and get back to you. Thanks.
|
Re: setX() not working
Ok, I found the issue. Instead of doing something like this
Code:
jag2 = new CANJaguar(2);Code:
jag2 = new CANJaguar(2,CANJaguar.ControlMode.kSpeed); |
Re: setX() not working
Quote:
setPID() sets the PID constants for the control mode you are in. The original code you posted will work if you move setPID() below changeControlMode(). -Joe |
Re: setX() not working
Quote:
A concerned programmer |
Re: setX() not working
Quote:
-Joe |
Re: setX() not working
So if i plug the laptop into the cRIO port 1 and boot the robot I should get all the println?? How would I run the robot from the driver station then??
|
Re: setX() not working
I'm using Ubuntu with Netbeans installed there, and have the driver station running in a virtual machine of Windows XP (Remember that any computer can act as the driver station). The println's go to Netbeans. if you have the driver station on a seperate laptop, simply plug both of them into the D-Link (or put one/both on wireless), and run the code from netbeans to get it to display the output. Make sure no IPs conflict!
Quote:
|
Re: setX() not working
DUH I cant believe I didnt think of that before. Thanks so much!
|
| All times are GMT -5. The time now is 02:50. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi