TASRobotics / RaidZero-FRC-2019

Competition code for 2019 season
1 stars 0 forks source link

Autochooser #55

Closed usymmij closed 5 years ago

usymmij commented 5 years ago

closes #45 32 autons may or may not be too much next time im going to use arrays enums are painful when used this way

usymmij commented 5 years ago

will test tmmrw morn

usymmij commented 5 years ago

the constructor first posts the sendable choosers to smartdashboard then, when the chooserSetup() method is called by setup(), chooserSetup() pseudocode

' int x; if ( teleop is selected ) { return PathChoices.TELEOP } else { if ( the cargo ship has been selected ) { target = cargoship } else { target = rocket }

    for ( each term of enum Level ) {
        if (nth term of Level == Level selected) {
            increases x so if Teleop is chosen, x increases by 0, if level 1 chosen, increases by 1, if level 2                         
                chosen, increase by 25
        }
    }

    for ( each term of enum TargetGoal ) {
        if (nth term of TargetGoal == TargetGoal selected) {
            increases x so x increases the same as what place the target is ordered in the enum
                //enum { number0, number1, number2, number3, number4 }
        }
    }

    for ( each term of enum Side ) {
        if (nth term of Side == Side selected) {
            increases x so x increases the same as what place the side is ordered in the enum * 8
        }
    }

    for ( each term of enum Piece) {
        if (nth term of Piece == Piece selected) {
            increases x so x increases the same as what place the Piece is ordered in the enum * 4
        }
    }

    return the xth value inside PathChoices
}`
usymmij commented 5 years ago

oops i accidentally clicked re-request review sorry

usymmij commented 5 years ago

aha fixed it