![]() |
arcade drive
Hey guys I am from team 5676 and we have a little or big problem with our arcade drive and the java program. We are using talon motor controllers with the kop andymark motors and pneumatic's. But we don't get it running. The robot is just turning around the y and at the x axes at option 1 but the pneumatic's are working. At option 2 is it not driving and the pneumatic's aren't working also but I thought that it would be he exact copy of the example but the code is getting permanently deployed at the roborio. Because an other problem is that at option 1 is the code stopping and getting periodically erased from the roborio at around 1;50 until I restart it. My first thought was that it's maybe running out of ram but that doesn't seem to be the problem.
Every help or input would be highly appreciated. I thank all of you in advance for your time and help. option 1: Code:
package org.usfirst.frc.team5676.robot;option 2: Code:
package org.usfirst.frc.team5676.robot; |
Re: arcade drive
Q1. Do you have 3 different pistons that are supposed to move when different buttons are pressed?
Q2. Which motors on your drive train are plugged into each port? |
Re: arcade drive
I cleaned your code up a bit. One issue you had was that you were creating new references to your pistons every ~20ms which is a bad thing to do. You were also sharing the same reference for ever single piston, also a bad thing to do. You can see that I moved the created 2 more pistons and created their references in robotInit().
Code:
package org.usfirst.frc.team5676.robot; |
Re: arcade drive
At first thank you very much!!!
Question 1: Yes we do. Question 2: I am sorry, I am not sure I am already home. Do you think that it could be just wired wrong? I tried the default labview code just for fun and it worked perfectly with the arcade drive. So shouldn't it also work with the java code with the "default example"? |
Re: arcade drive
Quote:
Left Front = 0 Left Rear = 1 Right Front = 2 Right Rear = 3 The constructor call has this order for the parameters: Code:
RobotDrive(int leftFront, int leftRear, int rightFront, int rightRear) |
Re: arcade drive
Quote:
You are mixing two paradigms-- this construct you would use for SampleRobot: Code:
public class Robot extends SampleRobot {This is the style to use in IterativeRobot: Code:
public class Robot extends IterativeRobot {Code:
while (isOperatorControl() && isEnabled()) {The net effect is in your option 2, your piston code will only be called once (maybe) only when isOperatorControl() goes false or isEnabled() goes false. I say maybe because it wouldn't surprise me if the teleopPeriodic call was on a thread that is terminated when either of these values go false. But this explains the symptom you found. Stick with Option 1 and take Matt's advice and you should get up and running quickly |
| All times are GMT -5. The time now is 10:26. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi