7039TEamXO / 7039-2024-robot-code

Other
3 stars 0 forks source link

Auto Shooting logic #3

Closed Ido-Sobol closed 8 months ago

Ido-Sobol commented 9 months ago

When we want to shoot, we need to set a point for the shot and set the action to TRAVEL (in auto, the wheels should spin in the TRAVEL state). Once this is done, we need to create another point with an identical Pose2d, but the action should be set to PODIUM.

Develop a logic that interrupts the array of points during shooting and resumes it only when readyToShoot() is true (probably needs to have delay).

if(error.getNorm() < Constants.AutonomousConstants.distanceToletrance && 
error.getAngle().getRadians() < Constants.AutonomousConstants.angleToletrance && 
(!points[currentPointIndex].getAction().equals(RobotState.PODIUM) || readyToShoot())){
//continue point index
}

the above means if we are in place, and we are ready to shoot or the robot's state isn't podium shooting, continue to the next point.