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(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 _fmpz_poly_hensel_lift_without_inverse(fmpz *G, fmpz *H, const fmpz *f, long lenF, const fmpz *g, long lenG, const fmpz *h, long lenH, const fmpz *a, long lenA, const fmpz *b, long lenB, const fmpz_t p, const fmpz_t p1) { const fmpz one[1] = {1l}; const long lenM = FLINT_MAX(lenG, lenH); const long lenE = FLINT_MAX(lenG + lenB - 2, lenH + lenA - 2); const long lenD = FLINT_MAX(lenE, lenF); fmpz *C, *D, *E, *M; C = _fmpz_vec_init(lenF + lenD + lenE + lenM); D = C + lenF; E = D + lenD; M = E + lenE; if (lenG >= lenH) _fmpz_poly_mul(C, g,lenG, h, lenH); else _fmpz_poly_mul(C, h, lenH, g, lenG); _fmpz_vec_sub(C, f, C, lenF); _fmpz_vec_scalar_divexact_fmpz(D, C, lenF, p); _fmpz_vec_scalar_mod_fmpz(C, D, lenF, p1); lift(G, g, lenG, b, lenB); lift(H, h, lenH, a, lenA); _fmpz_vec_clear(C, lenF + lenD + lenE + lenM); }
/* 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 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 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); }
lift90sr ( double pin[size], double Sm[size], double Rm[size], int m ) { int j, mj, i, N; double s[size], kemp[size], r[size], pout1[size], pout2[size], temp[size]; for ( j = 1; j <= m / 4; j++ ) { s[j - 1] = Sm[j - 1]; r[j - 1] = Rm[j - 1]; mj = 2 * j - 1; kemp[0] = pin[mj - 1]; kemp[1] = pin[mj]; lift ( kemp, s[j - 1], r[j - 1] ); pout1[mj - 1] = pout[0]; pout1[mj] = pout[1]; temp[0] = pin[ ( m / 2 ) + mj - 1]; temp[1] = pin[ ( m / 2 ) + mj]; lift ( temp, s[j - 1], r[j - 1] ); pout2[mj - 1] = ( -1 ) * pout[1]; pout2[mj] = pout[0]; } for ( i = 0; i < m / 2; i++ ) poutb[i] = pout1[i]; for ( i = m / 2, j = 0; i < m; i++, j++ ) poutb[i] = pout2[j]; }
void blueBrian() { moveStraight(1, 0, 1000); // estimate going 2 tiles, under bump perpendicular to barrier wait10Msec(30); // stableeeeeeeeeeeeeeeee hit ball gently? spin(-1, 0, 100); // uh... hopefully it doesn't fall out? //wait10Msec(70); 1 sec stabilization time already incorporated in spin() lift(HIGH); // uh.. holdArmHigh(); wait10Msec(70); moveStraight(1, 0, 450); wait10Msec(70); intake(-1); wait10Msec(10); // lol intake(0); moveStraight(-1, 0, 200); // lol intake(-1); // lol wait10Msec(20); intake(0); moveStraight(-1, 0, 250); resetValues(0); liftDown(); spin(1, 0, 100); moveStraight(-1, 0, 1000); waitForButton(); // end 15 pts lift(BARRIER); holdArm(); moveStraight(1, 0, 950); // end 5 pts, or 20pts total }
//Deposit the balls into the high goal on the center field structure. void depositBalls() { //Jack //Make lift go up (Below) lift(36); wait1Msec(2000); lift(-36); }
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 }
/* 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); }
// If restricted is true, we don't use (e <-> true) rewrite list<expr_pair> apply(expr const & e, expr const & H, bool restrited) { expr c, Hdec, A, arg1, arg2; if (is_relation(e)) { return mk_singleton(e, H); } else if (is_standard(m_env) && is_not(m_env, e, arg1)) { expr new_e = mk_iff(arg1, mk_false()); expr new_H = mk_app(mk_constant(get_iff_false_intro_name()), arg1, H); return mk_singleton(new_e, new_H); } else if (is_standard(m_env) && is_and(e, arg1, arg2)) { // TODO(Leo): we can extend this trick to any type that has only one constructor expr H1 = mk_app(mk_constant(get_and_elim_left_name()), arg1, arg2, H); expr H2 = mk_app(mk_constant(get_and_elim_right_name()), arg1, arg2, H); auto r1 = apply(arg1, H1, restrited); auto r2 = apply(arg2, H2, restrited); return append(r1, r2); } else if (is_pi(e)) { // TODO(dhs): keep name? expr local = m_tctx.mk_tmp_local(binding_domain(e), binding_info(e)); expr new_e = instantiate(binding_body(e), local); expr new_H = mk_app(H, local); auto r = apply(new_e, new_H, restrited); unsigned len = length(r); if (len == 0) { return r; } else if (len == 1 && head(r).first == new_e && head(r).second == new_H) { return mk_singleton(e, H); } else { return lift(local, r); } } else if (is_standard(m_env) && is_ite(e, c, Hdec, A, arg1, arg2) && is_prop(e)) { // TODO(Leo): support HoTT mode if users request expr not_c = mk_app(mk_constant(get_not_name()), c); expr Hc = m_tctx.mk_tmp_local(c); expr Hnc = m_tctx.mk_tmp_local(not_c); expr H1 = mk_app({mk_constant(get_implies_of_if_pos_name()), c, arg1, arg2, Hdec, e, Hc}); expr H2 = mk_app({mk_constant(get_implies_of_if_neg_name()), c, arg1, arg2, Hdec, e, Hnc}); auto r1 = lift(Hc, apply(arg1, H1, restrited)); auto r2 = lift(Hnc, apply(arg2, H2, restrited)); return append(r1, r2); } else if (!restrited) { expr new_e = m_tctx.whnf(e); if (new_e != e) { if (auto r = apply(new_e, H, true)) return r; } if (is_standard(m_env) && is_prop(e)) { expr new_e = mk_iff(e, mk_true()); expr new_H = mk_app(mk_constant(get_iff_true_intro_name()), e, H); return mk_singleton(new_e, new_H); } else { return list<expr_pair>(); } } else { return list<expr_pair>(); } }
task controllerDrive() { while(true) { //Right side of the robot is controlled by the right joystick, Y-axis driveSpeedright(vexRT[Ch2]); //Left side of the robot is controlled by the left joystick, Y-axis driveSpeedleft(vexRT[Ch3]); //The following will control lift if(vexRT[Btn5U] == 1) { lift(127); } else if(vexRT[Btn5D] == 1)//Btn 5D goes down { lift(-127); } else { lift(0); } //This controls the pneuamtic CLAW. if(vexRT[Btn6U] == 1) // If button 6U (upper right shoulder button) is pressed: { SensorValue[CLAW] = 1; SensorValue[CLAW] = 1; // ...activate the solenoid. } else // If button 6U (upper right shoulder button) is NOT pressed: { SensorValue[CLAW] = 0; // ..deactivate the solenoid. SensorValue[CLAW] = 0; } /* //The following is for the motor CLAW if(vexRT[Btn6U] == 1) //If Button 6U is pressed... { motor[CLAWMotor] = 127; //...close the gripper. } else if(vexRT[Btn6D] == 1) //Else, if button 6D is pressed... { motor[CLAWMotor] = -127; //...open the gripper. } else //Else (neither button is pressed)... { motor[CLAWMotor] = 0; //...stop the gripper. } */ } }
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); }
//autonomous main task main() { //drives forward until the distance sensor detects that it is 200 mm or closer to the wall driveWithUltraSonic(460, MOTOR_SPEED); lift(250); driveForwardWithEncoder(80, 50, 1000); setMotorTarget(CLAW_MOTOR, 360, 50); waitUntilMotorStop(CLAW_MOTOR); //uses the smart motor as a servo to move the lift motor up lift(200); rotate(-175); driveForwardWithEncoder(955, 50, 2350); lift(-300); }
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() { while(true) { getJoystickSettings(joystick); if (joy1Btn(5) == 1) single_main_wheel_fast(joystick.joy1_y2, joystick.joy1_x2); else single_main_wheel(joystick.joy1_y2, joystick.joy1_x2); lift(joystick.joy2_y1); if (joy2Btn(6) == 1) winchmove(joystick.joy2_y2); else motor[winch] = 0; servo_in(joy2Btn(4)); servo_out(joy2Btn(2)); servo_stop(joy2Btn(3)); /* servoFlat(joy2Btn(1)); servoDrop(joy2Btn(2)); servoRaise(joy2Btn(4)); servoAngleDown(joy2Btn(3)); */ flagmove(joystick.joy1_x1); wait1Msec(TIME_INTERVAL); } }
task main() { servo[sCubes] = 126; waitForStart(); while(true) { getJoystickSettings(joystick); // Update Buttons and Joysticks if(!bDisconnected)//makes sure robot is still connected to Samantha { sniperCheck(); drive(); flag(); lift(); liftLimit(); winch(); dispenser(); //all of the above code runs the methods that control all the motorized parts of our robot. wait1Msec(10); //a wait to ensure that multiple signals do not stack and to prevent lag. } else { motor[Left] = 0; motor[Right] = 0; motor[mLift] = 0; motor[mFlag] = 0; motor[mWinch1] = motor[mWinch2] = 0; servo[sCubes] = 126; } } }
void ShadeGraph::generate(GLSLShader& vs, GLSLShader& fs) { if (outputs.count("gl_Position")) { CodeNodePtr cn = outputs["gl_Position"]; typedef std::set<ValueNodePtr> ValueNodeSet; // Add statements. AssignmentPtr s(new Assignment); s->define = false; s->lhs = "gl_Position"; s->rhs = cn; vs.main->statements.push_back(s); } if (outputs.count("gl_FragColor")) { CodeNodePtr cn = outputs["gl_FragColor"]; // Add statements. AssignmentPtr s(new Assignment); s->define = false; s->lhs = "gl_FragColor"; s->rhs = cn; fs.main->statements.push_back(s); } lift(vs, fs); declareInputs(vs); declareInputs(fs); }
void lift_builtins(World& world) { // This must be run first lift_pipeline(world); while (true) { Continuation* cur = nullptr; Scope::for_each(world, [&] (const Scope& scope) { if (cur) return; for (auto n : scope.f_cfg().post_order()) { if (n->continuation()->order() <= 1) continue; if (is_passed_to_accelerator(n->continuation(), false)) { cur = n->continuation(); break; } } }); if (!cur) break; static const int inline_threshold = 4; if (is_passed_to_intrinsic(cur, Intrinsic::Vectorize)) { Scope scope(cur); force_inline(scope, inline_threshold); } Scope scope(cur); // remove all continuations - they should be top-level functions and can thus be ignored std::vector<const Def*> defs; for (auto param : free_defs(scope)) { if (!param->isa_continuation()) { assert(param->order() == 0 && "creating a higher-order function"); defs.push_back(param); } } auto lifted = lift(scope, defs); for (auto use : cur->copy_uses()) { if (auto ucontinuation = use->isa_continuation()) { if (auto callee = ucontinuation->callee()->isa_continuation()) { if (callee->is_intrinsic()) { auto old_ops = ucontinuation->ops(); Array<const Def*> new_ops(old_ops.size() + defs.size()); std::copy(defs.begin(), defs.end(), std::copy(old_ops.begin(), old_ops.end(), new_ops.begin())); // old ops + former free defs assert(old_ops[use.index()] == cur); new_ops[use.index()] = world.global(lifted, false, lifted->debug()); // update to new lifted continuation // jump to new top-level dummy function with new args auto fn_type = world.fn_type(Array<const Type*>(new_ops.size()-1, [&] (auto i) { return new_ops[i+1]->type(); })); auto ncontinuation = world.continuation(fn_type, callee->cc(), callee->intrinsic(), callee->debug()); ucontinuation->jump(ncontinuation, new_ops.skip_front(), ucontinuation->jump_debug()); } } } } world.cleanup(); } }
void StandardGraspPerformer::performGrasp(const object_manipulation_msgs::PickupGoal &pickup_goal, const object_manipulation_msgs::Grasp &grasp, GraspExecutionInfo &execution_info) { execution_info.result_ = approachAndGrasp(pickup_goal, grasp, execution_info); if (execution_info.result_.result_code != GraspResult::SUCCESS) return; //check if there is anything in gripper; if not, open gripper and retreat if (!mechInterface().graspPostureQuery(pickup_goal.arm_name, grasp)) { ROS_DEBUG_NAMED("manipulation","Hand reports that grasp was not successfully executed; " "releasing object and retreating"); mechInterface().handPostureGraspAction(pickup_goal.arm_name, grasp, object_manipulation_msgs::GraspHandPostureExecutionGoal::RELEASE, -1); retreat(pickup_goal, grasp, execution_info); execution_info.result_ = Result(GraspResult::GRASP_FAILED, false); return; } //attach object to gripper if (!pickup_goal.collision_object_name.empty()) { mechInterface().attachObjectToGripper(pickup_goal.arm_name, pickup_goal.collision_object_name); } execution_info.result_ = lift(pickup_goal, grasp, execution_info); }
int main(){ //auto comp1 = lift([]{ return 100; }).then(f).then(g).then(h); //auto comp2 = chain([]{ return 100; }, f, g, h); auto comp1 = lift(f).then(g).then(h); auto comp2 = chain(f, g, h); std::cout << comp1(100) << "\n" << comp2(100); }
void operatorControl() { lcdInitiate(); while (true){ ch3 = joystickAxes(3); ch1 = joystickAxes(1); drive(ch3, ch1); // lift code lift(); // pincer code pincers(); lcd(); delay(100); if(joystickGetDigital(2,7,JOY_DOWN)){ motorSet(left_lift_Motor1, -127); delay(2000); motorSet(left_lift_Motor1, 0); motorSet(left_lift_Motor2, 127); delay(2000); motorSet(left_lift_Motor2, 0); motorSet(right_lift_Motor3, -127); delay(2000); motorSet(right_lift_Motor3, 0); motorSet(right_lift_Motor4, 127); delay(2000); motorSet(right_lift_Motor4, 0); } } }
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); }
task main() { initializeRobot(); while(true) { getJoystickSettings(joystick); main_wheel(joystick.joy1_x1, joystick.joy1_y1); lift(joystick.joy2_y1); if ( joy2Btn(8)==1 ) elevMoveFree(joystick.joy2_y2); else elevMove(joystick.joy2_y2); resetElevEncoder(joy2Btn(3)); servoInitial(joy2Btn(2)); servoAngle (joy2Btn(4)); displayMessage(joy2Btn(1)); wait1Msec(TIME_INTERVAL); } }
Foam::scalar Foam::accordionValve::curLift() const { return max ( lift(engineDB_.theta()), minLift_ ); }
task main() { while(true){ //drive(); lift(); //endEffector(); } }
Foam::scalar Foam::thoboisValve::curLift() const { return max ( lift(engineDB_.theta()), minLift_ ); }
siglist listLift(const siglist& l) { int n = (int)l.size(); siglist r(n); for(int i = 0; i<n; i++) r[i] = lift(l[i]); return r; }
Foam::scalar Foam::dieselEngineValve::curLift() const { return max ( lift(engineDB_.theta()), minLift_ ); }