![]() |
URGENT:Auto Problem trying to fix before tomorrow
On our first day of competition, we ran into some problems with our shooter. The shooter does not seem to be functioning right in autonomous, but it functions fine in teleoperated. We use the same methods for both, but they both yield different results. Any ideas as to why it works well in one and not the other? The launcher barely moves when we try it in auto, but works fine in teleoperated. The driving is fine in auto. Here is the code:
Autonomous method: public void autonomous() { myDrive.setSafetyEnabled(false); myDrive.drive(-.5, 0.0); Timer.delay(3.5); myDrive.stopMotor(); Timer.delay(1.5); startRaisingLauncher(); Timer.delay(3.5); stopMovingLauncher(); stopAll(); } Raising launcher method: private void startRaisingLauncher() { setLiftPower(-1); } set power method: private void setLiftPower(double power) { M1.set(-power); M2.set(power); } |
Re: URGENT:Auto Problem trying to fix before tomorrow
Without seeing more of the code, it will be difficult to determine what the issue is. Are you having problems both on and off the field? Is there any way the power values to the motors could be different between Autonomous and Teleop modes?
Also, if you wrap your code in [code][/code] tags, it will format nicely, like this: Code:
public void autonomous() { |
Re: URGENT:Auto Problem trying to fix before tomorrow
Thanks, here is the full code:
Code:
/*----------------------------------------------------------------------------*/ /* |
Re: URGENT:Auto Problem trying to fix before tomorrow
Quote:
It did not seem too powerful when I tested it in the pits. I don't see how the power values can be different. They are set in the code at the max. I really don't understand how the same method could produce different results. Are our timer delays in the right spot? |
Re: URGENT:Auto Problem trying to fix before tomorrow
Did the driving movement for autonomous work properly?
|
Re: URGENT:Auto Problem trying to fix before tomorrow
Quote:
You could add some System.out.println()s to verify the timing. My team uses IterativeRobot, so I'm not super familiar with SimpleRobot, but the timing looks ok to me. Have you ensured that the delay values are long enough for the robot to physically respond? You cold try increasing the delay between raising and stopping the arm to see what kind of effect time has. |
Re: URGENT:Auto Problem trying to fix before tomorrow
Quote:
|
Re: URGENT:Auto Problem trying to fix before tomorrow
Quote:
|
Re: URGENT:Auto Problem trying to fix before tomorrow
Are we confident that the argument for Timer.delay() is in seconds and not milliseconds? I don't remember off hand.
|
Re: URGENT:Auto Problem trying to fix before tomorrow
Hmm... I think I may have figured out the problem. Would I also need to have the setSafetyEnabled method with the shooter object and the driver object?
I feel like that is the problem. When I changed the timer delays between on shooter and off shooter, it had not effect. I wonder if the setSafetyEnabled method has anything to do with that. |
Re: URGENT:Auto Problem trying to fix before tomorrow
Quote:
|
Re: URGENT:Auto Problem trying to fix before tomorrow
Quote:
|
Re: URGENT:Auto Problem trying to fix before tomorrow
Quote:
Time is in milliseconds. Unlike other programming platforms, the crio really does not like long delays. Thus it's better for you to manage time, and adjust your motor outputs based on time. Code:
public void autonomous() { |
Re: URGENT:Auto Problem trying to fix before tomorrow
Quote:
Another question about the code. For the time conditions in the else statements, are the last two statements supposed to be greater than signs instead of less than signs? *Nevermind, I believe I understand this now. Lastly, what do you think was the problem with the original code? |
Re: URGENT:Auto Problem trying to fix before tomorrow
Is it possible that your shooter takes more than 3.5 seconds to reach it's raised state? If it is mechanically OK to raise your shooter while you are driving you could start raising it at the start of auton at the same time as you start driving forward and let it run longer:
Code:
public void autonomous() { Good Luck. |
| All times are GMT -5. The time now is 11:14. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi