void redDevansh() // Places preload (1-2) + 2 buckies (2-4) + TURN LEFT Knocks buckies (1-6) + Places two Balls (2) { deploy(); intake(true); wait10Msec(10); moveStraight(1, 0, 475); wait10Msec(50); moveStraight(-1, 0, 475); //stopIntake(); lift(BUMP); holdArm(); waitForButton(); intake(false); wait10Msec(100); waitForButton(); resetValues(0); liftDown(); // end Devansh waitForButton(); intake(true); moveStraight(1, 0, (HALF_TILE)); wait10Msec(50); pickUpBall(1); spin(-1, 0, 200); crossBump(); lift(BARRIER); holdArm(); wait10Msec(30); moveStraight(1, 0, 550); intake(false); // end udit resetValues(1000); }
void redUdit() { deploy(); intake(1); wait10Msec(10); moveStraight(1, 0, 475); //picks up wait10Msec(50); moveStraight(-1, 0, 475);//comes back //intake(0)(); spin(1, 0, 400); lift(BUMP); holdArm(); waitForButton(); intake(-1); wait10Msec(100); resetValues(0); liftDown(); // added // end Devansh waitForButton(); intake(1); moveStraight(1, 0, (HALF_TILE)); wait10Msec(50); pickUpBall(1); spin(-1, 0, 200); crossBump(); lift(BARRIER); holdArm(); wait10Msec(30); moveStraight(1, 0, 550); intake(-1); // end udit resetValues(1000); }
//MAIN// task main() { initializeRobot(); waitForStart(); servo[intakeServo] = 80; //SAFE BEGIN// //---Lift arm moveArm(80); wait10Msec(60); moveArm(0); //---Move forward moveStraight(6.0,50); //---Turn Right gyroCenterPivot(-30, 100); stopDriveTrain(); //---Score servo[intakeServo] = 150; wait1Msec(700); //---Move forward to get on ramp moveStraight(12.0, -100); stopDriveTrain(); gyroCenterPivot(45,100); stopDriveTrain(); moveStraight(60.0,100); stopDriveTrain(); //---Close box servo[intakeServo] = 80; wait1Msec(5000); }
void redUdit() { deploy(); intake(true); wait10Msec(10); moveStraight(1, 0, 475); wait10Msec(50); moveStraight(-1, 0, 475); //stopIntake(); lift(BUMP); holdArm(); waitForButton(); intake(false); wait10Msec(100); waitForButton(); resetValues(0); liftDown(); // end Devansh waitForButton(); intake(true); moveStraight(1, 0, (HALF_TILE)); wait10Msec(50); pickUpBall(1); spin(-1, 0, 200); crossBump(); lift(BARRIER); holdArm(); wait10Msec(30); moveStraight(1, 0, 550); intake(false); // end udit resetValues(1000); }
int find_ir(int i){ bool stops = false; while (!stops) { if(SensorValue[IRSeeker]==5 ) { if(i<23) { moveStraight (r*50,50); //Move to Bucket hand_1(60); //Dump wait10Msec(200); // Wait for dump moveStraight (r*50,100); //Move out of dump hand_1(180); // stops = true; } else { hand_1(60); moveStraight (r*50,100); wait10Msec(200); hand_1(180); stops = true; } } else moveStraight (r*30,100); i= i+1; } return i; }
void redDevansh() // Places preload (1-2) + 2 buckies (2-4) + TURN LEFT Knocks buckies (1-6) { deploy(); intake(1); wait10Msec(10); moveStraight(1, 0, 455); //picks up wait10Msec(50); moveStraight(-1, 0, 475);//comes back intake(0); // end part 1: prepare dump waitForButton(); lift(BUMP); holdArm(); intake(-1); resetValues(1200); // end part 2: dump waitForButton(); liftDown(); wait10Msec(100); moveStraight(1, 0, 700); // end part 3: prepare hit spin(-1, 0, 200); intake(-1); lift(BUMP); holdArm(); noRamp(1, 250); resetValues(0); // end part 4: hit }
void move_past_buckets(int i){ // string temp = i; //eraseDisplay(); //nxtDisplayCenteredBigTextLine( 4,temp); //wait10Msec(10000); string print; print = i; nxtDisplayCenteredTextLine(0,print); wait10Msec(400); int n=0; while(27-i > n) { moveStraight (r*30,100); n= n+1; } { moveStraight (r*50,465); move (z*50,r*50,600); moveStraight (r*50,1150); move (z*50,r*50,700); moveStraight (r*50,1700); } }
task main() { initializeRobot(); waitForStart(); // Wait for the beginning of autonomous phase. /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// //// //// //// Add your robot specific autonomous code here. //// //// //// /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// waitForStart(); { moveStraight (-50,500); move (50,-50,373); movearm (75,700); movehand (160); movearm (75,600); movehand (110); moveStraight (-30,1480); movearm (75,700); } while (true) {} }
task main() { waitForStart(); moveStraight(50,170); move(-50,50,430); moveArm(-75,700); moveHand(160); moveArm(-75,800); moveHand(140); moveStraight(30,1450); moveArm(-75,700); wait1Msec(1000); moveStraight(-30,400); move(-50,50,430); moveStraight(-50,800); /* moveStraight(50,1630); move(50,-50,390); moveArm(-75,700); moveHand(160); moveArm(-75,900); moveHand(140); moveStraight(30,800); moveArm(-75,700); wait1Msec(1000); moveStraight(-30,500); move(-50,50,500); moveStraight(-30,1650); moveArm(75,2000);*/ while (true) {} }
int main() { moveStraight(1500); #ifdef TEST TEST(); #endif moveStraight(-1500); return 0; }
/*----------------------------------------------------------------------------- *Function name: traverseSimpleTrack *Description: This function navegates the maze using the simplified instructions * to get to the desired station faster *Inputs: maze = Maze * = the actuall maze that the robot will be traversing in this function * robot = Robot * = the robot that will be traversing the maze * outTurns = char * = the set of turns that the robot will be fallowing *Outputs: none -----------------------------------------------------------------------------*/ void traverseSimpleTrack(Maze *maze, RobotModel *robot, char *outTurns) { int done = 0; int bToL, bToR, bInF, onB; int turn = 0; while(!done) { clear(); printMazePlusCurrentPos(*maze, *robot); /*Letting the robot know where the paths are with respect to itself*/ bToL = blackToLeft(*maze, *robot); bToR = blackToRight(*maze, *robot); bInF = blackInFront(*maze, *robot); onB = onBlack(*maze, *robot); /*If there are no path on either side of the robot, then the robot just moves forward*/ if(bToL == 0 && bToR == 0 && onB == 1) { moveStraight(robot); } /*If the robot can turn, it checks the outTurns array to see what the next turn it needs to take is*/ /*the turn index turn is the incremented to let the robot know what the next turn is*/ else { switch(outTurns[turn]) { case 'R': turnRight(robot); turn++; break; case 'L': turnLeft(robot); turn++; break; case 'S': moveStraight(robot); turn++; break; case 'U': uTurn(robot); break; default: break; } /*if the robot is not on the maze than it is at its desired station and the function is done running*/ if(!onBlack(*maze, *robot)) { done = 1; printw("\nYour station has arrived\n"); } } getch(); } }
void Udit() { deploy(); intake(true); moveStraight(1, 0, 150); wait10Msec(30); moveStraight(-1, 0, 150); lift(BUMP); moveStraight(-1, 0, 150); setRight(127); setLeft(127); }
task main() { initializeRobot(); waitForStart(); // Wait for the beginning of autonomous phase. { if(SensorValue[IRSeeker] == 7) //right { //...turn left. moveStraight (-50,115); move (50,-50,481); movearm (75,700); movehand (160); movearm (75,600); movehand (110); moveStraight (-30,1850); movearm (75,750); moveStraight (50,400); move (-50,50,400); movearm (-75,1400); movehand (250); moveStraight (50,600); } else if(SensorValue[IRSeeker] <= 5) //left { moveStraight (-50,1900); move (50,-50,420); movearm (75,700); movehand (160); movearm (75,600); movehand (110); moveStraight (-30,540); movearm (75,-1000); moveStraight (50,200); } else if(SensorValue[IRSeeker] == 6) //middle { moveStraight (-50,860); move (50,-50,421); movearm (75,700); movehand (160); movearm (75,600); movehand (110); moveStraight (-30,1350); movearm (75,850); moveStraight (50,1400); } } while (true) { return; } }
/* Psuedocode Ramp Forward -> [Cross Barrier] -> Raise Arm HIGH -> Hold Arm HIGH -> Ramp Zero -> [Reach Goal] -> Outtake -> [Finish Outtake] -> Stop Intake -> Ramp Forward -> Ramp Zero -> [Reach Barrier] -> Lower Arm LOW -> Ramp Backward -> [Reach Square] -> Hard Zero Wait Until Press -> Raise Arm BARRIER -> Hold Arm BARRIER -> Ramp Forward -> Ramp Zero -> [Reach Barrier] -> Ramp Backward -> [Reach Square] -> Hard Zero -> Wait Until Press -> Ramp Forward -> Ramp Zero -> [Reach Barrier] */ void Alex() // Caches preload (5) + Knocks 2 big balls (10) { deploy(); moveStraight(1, 0, 1600); // 1600 is just before goal lift(HIGH); // nearest 100 holdArm(); moveStraight(1, 0, 300); // reaches goal //wait1Msec(1000); intake(-1); wait1Msec(500); // outtake intake(0); moveStraight(-1, 0, 400); //move back away from goal...Apparently Safety is greater than move forward liftDown(); moveStraight(-1, 0, 1500); waitForButton(); lift(BARRIER); holdArm(); intake(-1); moveStraight(1, 0, 550); //estimated guess based on 10Q's values wait1Msec(300); moveStraight(-1, 0, 550); waitForButton(); moveStraight(1, 0, 950); wait1Msec(300); moveStraight(-1, 0, 950); resetValues(100); }
task main() { initializeRobot(); waitForStart(); //----------GAMBLE BEGIN------------ needArm = true; wait1Msec(300); //---Detect IR Beacon if(SensorValue[IRSensor] <= 4 && SensorValue[IRSensor]!=0) { crate = 1; } if(SensorValue[IRSensor] == 5) { crate = 2; } if(SensorValue[IRSensor] == 0) { crate = 3; } //---Move forward moveStraight(8, 100); //---Turn Left gyroCenterPivot(-34,100); //---Move forward moveStraight(27.0, 100); //---Turn Right gyroCenterPivot(93,100); //needArm = true; //---Get on ramp moveStraight(31.0,100); //---Check which crate for positioning if(crate == 2) { moveStraight(8.0, 100); } else if(crate == 3) { moveStraight(23.0,100); } //If crate == 1, then do not move. Robot is already positioned to score. //---Stop stopDriveTrain(); //---SCORE scoreAutoArm(); }
void Alex2() // Knocks 2 big balls (10) then caches preload { deploy(); lift(BARRIER); holdArm(); intake(-1); moveStraight(1, 0, 580); //estimated guess based on 10Q's values wait1Msec(300); //moveStraight(-1, 0, 550); moveStraight(-1, 0, 580); waitForButton(); moveStraight(1, 0, 950); wait1Msec(300); //moveStraight(-1, 0, 950); moveStraight(-1, 0, 950); resetValues(100); waitForButton(); moveStraight(1, 0, 1420); // maintenence and recalibrating needed lift(HIGH); // nearest 100 holdArmHigh(); moveStraight(1, 0, 500); // reaches goal //wait1Msec(1000); intake(-1); wait1Msec(500); // outtake moveStraight(-1, 0, 400); //move back away from goal...Apparently Safety is greater than move forward motor[LeftArm] = motor[RightArm] = -127; wait1Msec(800); motor[LeftArm] = motor[RightArm] = 0; // end score bucky moveStraight(-1, 0, 1300); // now user readjust for first ball }
void AlexAlt() // Caches preload (5) + Knocks 2 big balls (10) { deploy(); moveStraight(1, 0, 1600); // maintenence and recalibrating needed liftTime(1,300); holdArmHigh(); moveStraight(1, 0, 650); // reaches goal //wait1Msec(1000); intake(-1); wait1Msec(500); // outtake moveStraight(-1, 0, 400); //move back away from goal...Apparently Safety is greater than move forward liftDown(); // end score bucky moveStraight(-1, 0, 1400); // now user readjust for first ball waitForButton(); lift(BARRIER); holdArm(); intake(-1); moveStraight(1, 0, 580); //estimated guess based on 10Q's values wait1Msec(300); //moveStraight(-1, 0, 550); moveStraight(-1, 0, 580); waitForButton(); moveStraight(1, 0, 950); wait1Msec(300); //moveStraight(-1, 0, 950); moveStraight(-1, 0, 950); resetValues(100); }
/* Psuedocode Ramp Forward -> [Cross Barrier] -> Raise Arm HIGH -> Hold Arm HIGH -> Ramp Zero -> [Reach Goal] -> Outtake -> [Finish Outtake] -> Stop Intake -> Ramp Forward -> Ramp Zero -> [Reach Barrier] -> Lower Arm LOW -> Ramp Backward -> [Reach Square] -> Hard Zero Wait Until Press -> Raise Arm BARRIER -> Hold Arm BARRIER -> Ramp Forward -> Ramp Zero -> [Reach Barrier] -> Ramp Backward -> [Reach Square] -> Hard Zero -> Wait Until Press -> Ramp Forward -> Ramp Zero -> [Reach Barrier] */ void Alex() // Caches preload (5) + Knocks 2 big balls (10) { deploy(); moveStraight(1, 0, 1550); // 1600 is just before goal...changed for some reason lift(HIGH); // only accurate to the nearest 100... may need to adjust HIGH value holdArm(); moveStraight(1, 0, 300); // reaches goal //wait1Msec(1000); intake(false); wait1Msec(1000); // outtake stopIntake(); moveStraight(-1, 0, 400); // move back away from goal...Apparently Safety is greater than move forward liftDown(); moveStraight(-1, 0, 1500); waitForButton(); lift(BARRIER); holdArm(); intake(false); moveStraight(1, 0, 550); // estimated guess based on 10Q's values - WORKS wait1Msec(300); moveStraight(-1, 0, 550); waitForButton(); moveStraight(1, 0, 950); // A bit of trouble... Not sure if you want to spin rollers for this hit... wait1Msec(300); // outtaking pushes the ball away + needs good aiming moveStraight(-1, 0, 950); resetValues(100); }
void blueUdit() { deploy(); intake(1); wait10Msec(10); moveStraight(1, 0, 475); //picks up wait10Msec(50); moveStraight(-1, 0, 475);//comes back //intake(0)(); spin(1, 0, 400); lift(BUMP); holdArm(); waitForButton(); intake(-1); wait10Msec(100); resetValues(0); liftDown(); // added waitForButton(); //liftDown(); // end Devansh //waitForButton(); intake(1); moveStraight(1, 0, (HALF_TILE)); wait10Msec(50); pickUpBall(1); spin(1, 0, 200); //crossBump(); lift(BUMP); nMotorEncoder[LeftMWheel] = 0; if(true) { setRight(127); wait10Msec(10); setLeft(127); } while (abs(nMotorEncoder[LeftMWheel]) < 500) { setRight(127); setLeft(127); } setRight(0); setLeft(0); lift(BARRIER); holdArm(); wait10Msec(30); moveStraight(1, 0, 550); intake(-1); // end udit resetValues(1000); }
void skills() { deploy(); wait10Msec(20); intakeSlow(1); moveStraight(1, 0, 430); //picks up wait10Msec(50); moveStraight(-1, 0, 430);//comes back intake(1); lift(BUMP - 50); holdArm(); moveStraight(-1,0,700);//hops bump waitForButton(); liftDown(); intake(0); waitForButton(); moveStraight(1, 0, 1400); // maintenence and recalibrating needed wait10Msec(30); lift(HIGH); holdArmHigh(); moveStraight(1, 0, 430); // reaches goal //wait1Msec(1000); intake(-1); wait10Msec(150); // outtake moveStraight(-1, 0, 400); //move back away from goal...Apparently Safety is greater than move forward lift(LOW); wait10Msec(50); intake(0); // end score bucky moveStraight(-1, 0, 1400); // now user readjust for first ball waitForButton(); moveStraight(1,0,600); spin(1,0,200); lift(BARRIER); holdArmHigh(); moveStraight(1, 0, 475); wait10Msec(40); moveStraight(-1, 0, 275); }
task main() { waitForStart(); moveStraight(-50,500); move(50,-50,375); moveArm(75,700); moveHand(160); moveArm(75,600); moveHand(110); moveStraight(-30,1400); moveArm(75,700); while (true) {} }
task main() { initializeRobot(); waitForStart(); // Wait for the beginning of autonomous phase. wait1Msec(100); int nButtonsMask; bool isTouch = false; // Boolean indicating if a touch sensor has been pressed. // If one has, this changes to true. while (isTouch == false) { moveStraight(-15,10); nButtonsMask = SensorValue[S3]; if (nButtonsMask & 0x01) isTouch = true; if (nButtonsMask & 0x02) isTouch = true; } while (true) { return; } }
void transfer_To_MiddleLand(int repeat_Num, Target target) { ColorBoundary color_B = classifyObject(target.flag); printf("\n--------------------see down------------------\n\n"); int i; // 물체 차고 재접근의 루프 for(i=0; i<repeat_Num; i++){ set_Position(NOTHING, PLASTIC); // 이제 물체 차야함 left_Kick(); usleep(200000); // 물체앞까지 의무걸음 moveStraight(); usleep(5500000); // 5걸음 moveStop(); usleep(200000); } }
task main() { initializeRobot(); waitForStart(); StartTask(RampArm); //- While, the robot is moving, the arm will be slightly raised. moveStraight(65.0, 60.0, 100.0); //- The robot will move straight, having the wheels angled at 65 degrees. while(true); }
int approach2Milk(VideoCopy *image, Target obj) { ColorBoundary color_B = classifyObject(obj.flag); int isFind; prevTarget.x_point = prevTarget.y_point = -1; while(1) { // search isFind = toleranceSearch(image, &obj, color_B); //printf("isFind : %d\n", isFind); printf("y : %d\n", obj.y_point); if(isFind <= 0) // stop_Signal break; // if(obj.y_point < 20) // break; // command -> robot else{ prevTarget = obj; // printf("pass command\nx_mid : %d\n", obj.x_point); int wPix = (MAX_X/2 - obj.x_point); // printf("wPix : %d\n", wPix); int direction = wPix < 0 ? 0 : 1; wPix = abs(wPix); if(wPix > 60){ if(direction == 0) moveLeft(); else if(direction == 1) moveRight(); } else{ moveStraight(); } } } moveStop(); printf("approach complete. isFind : %d\n", isFind); if (prevTarget.x_point == -1) { // 아예 처음부터 못 찾은 경우 return 2; } else if (prevTarget.y_point > 80) { // 갑자기 사라졌다고 의심할 수 있을 경우 return 1; } else { return 0; } }
task main() { initializeRobot(); waitForStart(); StartTask(RampArm); //- The arm is raised so that our robot can go on the ramp without problems moveStraight(130.0, 55.0, 75.0); //- The robot moves for 55 inches at a 130 angle while(true){} }
task main() { initializeRobot(); waitForStart(); StartTask(RampArm); //- The arm is raised so that our robot can go on the ramp without problems moveStraight(55.0, 60.0, 75.0); //- The robot moves 60 inches at 55 degrees while(true){} }
//MAIN// task main() { initializeRobot(); waitForStart(); moveArm(ARM_UP); //lift arm wait10Msec(80); moveStraight(90.0, 10.0, 50.0); //move forward to crate dropTheBlock(); while(true){}; }
//////////////////MAIN///////////////////// task main() { initializeRobot(); waitForStart(); //ARM NEEDS TO BE RAISED HIGH ENOUGH THAT IT WILL BE OVER THE CRATES BUT NOT HIT THE BAR wait1Msec(300); if(SensorValue[IRSensor] <= 3 && SensorValue[IRSensor] != 0) { crate = 1; } else if(SensorValue[IRSensor] == 4) { crate = 2; } else if(SensorValue[IRSensor] > 4) { crate = 3; } //---Move up and left moveStraight(90.0, 3.0,100.0); moveStraight(25.0,27.0,100.0); //---Rotate perpendicular to ramp moveArc(0.0,180.0,100.0);//180 deg moveArc(0.0,70.0,100.0); //---Move up ramp to first crate, lift arm up StartTask(ScoreArm); moveStraight(0.0, 27.0 ,100.0); //move to crate 1 if(crate == 2) //this crate would have to be the closest one to us { moveStraight(0.0, 15.0, 100.0); //move to crate 2 } else if(crate == 3) { moveStraight(0.0, 24.0, 100.0); //move to crate 3 } boxOpen = true; StopTask(HoldBox); //if crate == 1 or 4, just score in crate 1 dropTheBlock(); while(true){} }
task main() { initializeRobot(); moveStraight(DIR_FWD, 0, 0, true); waitForStart(); // Wait for the beginning of autonomous phase. }