Open edf42001 opened 1 year ago
If you think about it, yesterday was the first time we really got to test autos for real. What a learning experience! My take aways were: Don't be afraid to make big changes, and don't be afraid to go slow. Once it works it can be dialed in. (You might have took away different lessons :+1:)
TurnToNAngle
, you could do it in the initialize
method (not the constructor, as the robot doesn't know what alliance it is on yet when the constructor is run). But something like this. Then you don't have to do it manually for every time you turn.if (on red alliance) {
targetAngle = -targetAngle;
}
startAngle
) and is just where the robot is when the command starts. But imagine you turn to -5 degrees, but it ends at -6. Then it would drive straight at -6. You can force it to always drive to the exact same angle with this method. If you do you'll need to flip the angle in initialize
if on red alliance like above. DriveStraightForDistance
that sets the speed limit. Then you could go faster for two piece (since the ground is flat), but leave the 1.5 the same speed.If the cube intake works better then cone, you could switch 1.5 to cube as well.
I think there's a small problem with your deadline command group
I think you've successfully completed this issue.Only thing would be to crank the dial up on the slowness at which the robot approaches picking up a 1.5th cone, to avoid knocking it over. Or try a tipped cone. If 1.5 cone is an extra autonomous you wanted.
Just of collection of things my brain has thought about:
TurnToNAngleCmd
just like drive for distance. The more buttery smooth it is, the more consistent it will becurrentAngle = modAngle(currentAngle);
inTurnToNAngleCmd
is unnecessary because of the lineswhich btw you could combine into
double error = modAngle(targetAngle - currentAngle);
driveTrain.resetOdometry
at the start so it lines up with the sim field and we can see if it is working0.5
forTurnToNAngleCmd
. Grok turns very fast