Closed cmarley3-14 closed 5 years ago
when i tested this code it worked
unless thats not what i coded and someone wrote over it
anyways i will just reverse the order of checking so that it can not just go on to the next step
i changed it to this
if (completed == false){
if (progress == 3) {
RetractBackLegs();
}
else if (progress == 2) {
RetractFrontLegs();
}
else if (progress == 1) {
Walk();
}
else if (progress == 0) {
RaiseRobot();
}
}
also this should all be apart of "Error handling for Walker state machine"
What I meant to say is that the process of extending the pistons takes time, but the code won't take that into account. My mistake, it will execute the entire Climb()
function, but each step will happen super quickly (I think, we'll just test that out (if I can come)).
As in, the pneumatics system will say that the pistons are extended, even though they aren't finished extending. That's why if you look at the 2018 Power Up code, Andrew had to do a sort of timer in the code. So that each step could be completed, with plenty of time in between.
Finally, I think the robot walks backwards.
https://github.com/garykac/amhs-robotics-4681/blob/072f45f54e591a2339f70c3f1e5b8542d68057d7/workspace/2019%20DeepSpace/src/main/java/frc/robot/Robot.java#L119 https://github.com/garykac/amhs-robotics-4681/blob/072f45f54e591a2339f70c3f1e5b8542d68057d7/workspace/2019%20DeepSpace/src/main/java/frc/robot/Robot.java#L120
The problem is that Java will not wait until a function is carried out before moving on to the next line of code.
All those steps will be executed in rapid succession. The walker won't wait until
RaiseRobot()
is completed toreturn progress == 1
. Secondly, line 119 only tests when the button is pressed, and not if it is held down. That means,Climb()
will only execute for some 20 milliseconds before being cut off. It may be that all the steps of climbing have to be implemented directly intoRobot.java
, but this is what I think is going to happen, based off last year's coding experience.