您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ IsOperatorControl函数代码示例

51自学网 2021-06-01 21:42:12
  C++
这篇教程C++ IsOperatorControl函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中IsOperatorControl函数的典型用法代码示例。如果您正苦于以下问题:C++ IsOperatorControl函数的具体用法?C++ IsOperatorControl怎么用?C++ IsOperatorControl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了IsOperatorControl函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: OperatorControl

	/**	 * Runs the motor from the output of a Joystick.	 */	void OperatorControl() {		while (IsOperatorControl() && IsEnabled()) {			// Set the motor controller's output.			// This takes a number from -1 (100% speed in reverse) to +1 (100% speed forwards).			m_motor.Set(m_stick.GetY());			Wait(kUpdatePeriod); // Wait 5ms for the next update.		}	}
开发者ID:Beachbot330,项目名称:eclipse_plugins,代码行数:12,


示例2: OperatorControl

	//	// Main Tele Operator Mode function.  This function is called once, therefore a while loop that checks IsOperatorControl and IsEnabled is used 	// to maintain control until the end of tele operator mode	//	void OperatorControl()	{		//myRobot.SetSafetyEnabled(true);				timer->Start();		Relay* reddlight = new Relay(4);		//Timer* lighttimer = new Timer();		//lighttimer->Start();		while (IsOperatorControl() && IsEnabled())		{			reddlight->Set(reddlight->kForward);			/*			if (lighttimer->Get()<=0.5) {				reddlight->Set(reddlight->kForward);			}			else if(lighttimer->Get()<1){				reddlight->Set(reddlight->kOff);			}			else {				lighttimer->Reset();			}			*/			//			// Get inputs			//			driverInput->GetInputs();			drive->GetInputs();			catapult->GetInputs();			feeder->GetInputs();						//			// Pass values between components as necessary			//			//catapult->SetSafeToFire(feeder->GetAngle()<95); 						//			// Execute one step on each component			//			drive->ExecStep(); 			catapult->ExecStep();			feeder->ExecStep(); 					    //			// Set Outputs on all components			//			catapult->SetOutputs();			feeder->SetOutputs();						//			// Wait for step timer to expire.  This allows us to control the amount of time each step takes. Afterwards, restart the 			// timer for the next loop			//			while (timer->Get()<(PERIOD_IN_SECONDS));			timer->Reset();		}	}
开发者ID:TitaniumTitans,项目名称:FRC-2014,代码行数:61,


示例3: printf

void WorkshopRobot::OperatorControl(void){	printf("2250 start/n"); 					//Check in with the console.	while (IsOperatorControl()){ 				//Called once at the beggining of the teleop mode.		//printf("Feed!/n");		driveSys->RunDriveSystem();		LauncherMech->RunLauncher();		Wait(0.005); 							//Minimum motor controller wait time. (also handy for ticks)	}}
开发者ID:Team2550,项目名称:cRIO-Code,代码行数:9,


示例4: OperatorControl

	void OperatorControl(void)	{		while (IsOperatorControl())		{			driveTrain->Drive();			pickupBall->Pickup();			ballShooter->ShootBall();		}	}
开发者ID:FRC-263,项目名称:Gimli,代码行数:9,


示例5: OperatorControl

	/**	 * Runs the motors with arcade steering. 	 */	void OperatorControl(void)	{		myRobot.SetSafetyEnabled(true);		while (IsOperatorControl())		{			myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)			Wait(0.005);				// wait for a motor update time		}	}
开发者ID:Skunk-ProLaptop,项目名称:Skunkworks1983,代码行数:12,


示例6: OperatorControl

	/**	 * Runs the motors with arcade steering. 	 */	void OperatorControl(void)	{		GetWatchdog().SetEnabled(true);		while (IsOperatorControl())		{			GetWatchdog().Feed();			myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)		}	}
开发者ID:Team694,项目名称:frc,代码行数:12,


示例7: while

void TestBed::OperatorControl(void){	while (IsOperatorControl() && !IsDisabled())	{		DriveSys->RemoteDrive();		SmartDashboard::PutNumber("LeftStick: ", DriveSys->LeftStickY);		SmartDashboard::PutNumber("RightStick:", DriveSys->RightStickY);		Wait(0.005);// wait for a motor update time	}}
开发者ID:Team2550,项目名称:cRIO-Code,代码行数:10,


示例8: OperatorControl

	/**	 * Runs the motors with arcade steering. 	 */	void OperatorControl(void)	{		float speed = 0;		while (IsOperatorControl())		{			myRobot.TankDrive(leftstick, rightstick);			//driveleft.Set(1);  //Why are we setting driveleft and driveright to 1 and -1?			//driveright.Set(-1);  		}	}
开发者ID:AdriannasArsenic,项目名称:robot2013,代码行数:13,


示例9: TeleopInit

	void TeleopInit()	{		while(IsOperatorControl())		{			intake();			shoot();				}			}
开发者ID:Mbaig7,项目名称:2013_Medic,代码行数:10,


示例10: OperatorControl

	/**	 * Runs the motors with arcade steering.	 */	void OperatorControl()	{		while (IsOperatorControl() && IsEnabled())		{			myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)			//camera.GetImage(Image); 	//get the most recent image from the camera			Wait(0.005);				// wait for a motor update time		}	}
开发者ID:dat-tehcie-stew,项目名称:2172,代码行数:13,


示例11: OperatorControl

void OperatorControl(void){	SetWatchdogEnabled(true);	while (IsOperatorControl())	{		WatchdogFeed();		ArcadeDrive(JOYSTICK_PORT);		Wait(0.005);	}}
开发者ID:2202Programming,项目名称:OldCode,代码行数:10,


示例12: OperatorControl

		/**		 * Runs the motors under driver control with either tank or arcade steering selected		 * by a jumper in DS Digin 0. Also an arm will operate based on a joystick Y-axis. 		 */		void OperatorControl()		{			control->initialize();			while (IsOperatorControl())			{				control->run();				dsLCD->UpdateLCD();				Wait(0.005);			}		}
开发者ID:2202Programming,项目名称:OldCode,代码行数:14,


示例13: OperatorControl

	// Code to be run during the remaining 2:20 of the match (after Autonomous())	//	// OperatorControl	//	* Calls all the above methods	void OperatorControl()	{		// SAFETY AND SANITY - SET ALL TO ZERO		intake.Set(0.0);		rightWinch.Set(0.0);		leftWinch.Set(0.0);		arm.Set(DoubleSolenoid::kReverse);		/* TODO: Investigate. At least year's (GTR East) competition, we reached the conclusion that disabling this was 		 * the only way we could get out robot code to work (reliably). Should this be set to false?		 */ 		robotDrive.SetSafetyEnabled(false);		Timer clock;		int sanity = 0;		int bigSanity = 0;		loading = false;		loaded = winchSwitch.Get();		RegisterButtons();		gamepad.Update();		leftStick.Update();		compressor.Start();		while (IsOperatorControl() && IsEnabled())		{			clock.Start();			HandleDriverInputs();			HandleShooter();			HandleArm();			//			HandleEject();			while (!clock.HasPeriodPassed(LOOP_PERIOD)); // add an IsEnabled???			clock.Reset();			sanity++;			if (sanity >= 100)			{				bigSanity++;				sanity = 0;				dsLCD->PrintfLine(DriverStationLCD::kUser_Line4, "%d", bigSanity);			}			gamepad.Update();			leftStick.Update();			dsLCD->UpdateLCD();		}		// SAFETY AND SANITY - SET ALL TO ZERO		intake.Set(0.0);		rightWinch.Set(0.0);		leftWinch.Set(0.0);	}
开发者ID:D3ZOMBKEELA,项目名称:Robot-2014,代码行数:59,


示例14: OperatorControl

    /**     * Drive based upon joystick inputs, and automatically control     * motors if the robot begins tipping.     */    void OperatorControl()    {        robotDrive.SetSafetyEnabled(false);        while (IsOperatorControl() && IsEnabled()) {            double xAxisRate = stick.GetX();            double yAxisRate = stick.GetY();            double pitchAngleDegrees = ahrs->GetPitch();            double rollAngleDegrees = ahrs->GetRoll();            if ( !autoBalanceXMode &&                 (fabs(pitchAngleDegrees) >=                  fabs(kOffBalanceThresholdDegrees))) {                autoBalanceXMode = true;            }            else if ( autoBalanceXMode &&                      (fabs(pitchAngleDegrees) <=                       fabs(kOnBalanceThresholdDegrees))) {                autoBalanceXMode = false;            }            if ( !autoBalanceYMode &&                 (fabs(pitchAngleDegrees) >=                  fabs(kOffBalanceThresholdDegrees))) {                autoBalanceYMode = true;            }            else if ( autoBalanceYMode &&                      (fabs(pitchAngleDegrees) <=                       fabs(kOnBalanceThresholdDegrees))) {                autoBalanceYMode = false;            }            // Control drive system automatically,            // driving in reverse direction of pitch/roll angle,            // with a magnitude based upon the angle            if ( autoBalanceXMode ) {                double pitchAngleRadians = pitchAngleDegrees * (M_PI / 180.0);                xAxisRate = sin(pitchAngleRadians) * -1;            }            if ( autoBalanceYMode ) {                double rollAngleRadians = rollAngleDegrees * (M_PI / 180.0);                yAxisRate = sin(rollAngleRadians) * -1;            }            try {                // Use the joystick X axis for lateral movement, Y axis for forward movement, and Z axis for rotation.                robotDrive.MecanumDrive_Cartesian(xAxisRate, yAxisRate,stick.GetZ());            } catch (std::exception ex ) {                std::string err_string = "Drive system error:  ";                err_string += ex.what();                DriverStation::ReportError(err_string.c_str());            }            Wait(0.005); // wait 5ms to avoid hogging CPU cycles        }    }
开发者ID:HighRollersCode,项目名称:HR16,代码行数:59,


示例15: OperatorControl

	/**	 *  Tells the robot to drive to a set distance (in inches) from an object using	 *  proportional control.	 */	void OperatorControl() {		double currentDistance; //distance measured from the ultrasonic sensor values		double currentSpeed; //speed to set the drive train motors		while (IsOperatorControl() && IsEnabled()) {			currentDistance = ultrasonic->GetValue() * valueToInches; //sensor returns a value from 0-4095 that is scaled to inches			currentSpeed = (holdDistance - currentDistance) * pGain; //convert distance error to a motor speed			myRobot->Drive(currentSpeed, 0); //drive robot		}	}
开发者ID:Talos4757,项目名称:allwpilib,代码行数:15,


示例16: OperatorControl

	/**	 * Runs the motors with arcade steering. 	 */	void OperatorControl(void) {		while (IsOperatorControl()) {			dsLCD->PrintfLine(DriverStationLCD::kUser_Line2, "Voltage: %f",					signal.GetVoltage());			dsLCD->PrintfLine(DriverStationLCD::kUser_Line3, "CVoltage: %f",					signalControlVoltage.GetVoltage());			dsLCD->UpdateLCD();			Wait(0.005); // wait for a motor update time		}	}
开发者ID:2202Programming,项目名称:OldCode,代码行数:14,


示例17: while

void MainRobot::OperatorControl() {    mWatchdog->SetEnabled(true);    while (IsOperatorControl()) {        mJoystickController->Run();        GetWatchdog().Feed();        Wait(cMotorWait);    }    return;}
开发者ID:cosmicomic,项目名称:Bandit_2013,代码行数:11,


示例18: printf

void Michael1::OperatorControl(void){	printf("/n/n/tStart Teleop:/n/n");	GetWatchdog().SetEnabled(false);	ariels_light->Set(0);		while (IsOperatorControl())	{		dt->TankDrive(left_stick, right_stick);	}}
开发者ID:Team694,项目名称:frc,代码行数:11,


示例19: OperatorControl

	/**	 * Runs the motors with arcade steering. 	 */	void OperatorControl(void)	{		myRobot.SetSafetyEnabled(true);		while (IsOperatorControl())		{			myRobot.ArcadeDrive(stick.getAxisLeftY(), stick.getAxisLeftX()); // drive with arcade style (use left stick)			dsLCD->Printf(DriverStationLCD::kUser_Line2, 1, "Move: %f4", stick.getAxisLeftY());			dsLCD->Printf(DriverStationLCD::kUser_Line3, 1, "Rotate: %f4", stick.getAxisLeftX());			dsLCD->UpdateLCD();			Wait(0.005);				// wait for a motor update time		}	}
开发者ID:2202Programming,项目名称:OldCode,代码行数:15,


示例20: OperatorControl

	void OperatorControl()	{		tank.StartDrive();		kick.StartKicker();		while (IsOperatorControl())		{			comp.checkCompressor();			tank.Drive(PrimaryController.GetRawAxis(LEFT_JOYSTICK), PrimaryController.GetRawAxis(RIGHT_JOYSTICK), (int)PrimaryController.GetRawButton(BUTTON_HIGH_DRIVE_SHIFT), (int)PrimaryController.GetRawButton(BUTTON_LOW_DRIVE_SHIFT));			kick.StateMachine(PrimaryController.GetRawButton(BUTTON_KICK));			collect.runCollector(PrimaryController.GetRawButton(BUTTON_ROLLER_ON));		}	}
开发者ID:Team537,项目名称:RobotCode,代码行数:12,


示例21: OperatorControl

	/**	 * Runs the motors with Mecanum drive.	 */	void OperatorControl()	{		robotDrive.SetSafetyEnabled(false);		while (IsOperatorControl() && IsEnabled())		{        	// Use the joystick X axis for lateral movement, Y axis for forward movement, and Z axis for rotation.        	// This sample does not use field-oriented drive, so the gyro input is set to zero.			robotDrive.MecanumDrive_Cartesian(stick.GetX(), stick.GetY(), stick.GetZ());			Wait(0.005); // wait 5ms to avoid hogging CPU cycles		}	}
开发者ID:FRCTeam2370,项目名称:2015-ForkliftBot,代码行数:15,


示例22: OperatorControl

	void OperatorControl()	{		while (IsOperatorControl() && IsEnabled())		{			drive->Drive(drivePad);			lifter->RunLifter(gamePad, drivePad);			//printf("Tote: %f/n", lifter->shortLiftMotor1->Get());			//printf("Angle: %f/n", drive->mecanumGyro->GetAngle());			//printf("FL: %f/t FR: %f /t BL: %f/t BR: %f/t Avg: %d/n", drive->FLMotor->GetPosition(), drive->FRMotor->GetPosition(), drive->BLMotor->GetPosition(), drive->BRMotor->GetPosition(), drive->AverageLeftStrafe());			//printf("WideEncoder: %f/t ShortEncoder: %f/n", lifter->canLiftMotor->GetPosition(), lifter->shortLiftMotor1->GetPosition());		}	}
开发者ID:FRCTeam263,项目名称:FRC_2015_2016,代码行数:12,


示例23: OperatorControl

	/**	 * Code to be run during the remaining 2:20 of the match (after Autonomous())	 */	void OperatorControl()	{		/* TODO: Investigate. At least year's (GTR East) competition, we reached the conclusion that disabling this was 		 * the only way we could get out robot code to work (reliably). Should this be set to false?		 */ 		robotDrive.SetSafetyEnabled(true);		while (IsOperatorControl())		{			robotDrive.ArcadeDrive(rightStick);			Wait(0.005);		}	}
开发者ID:GabbyGenereux,项目名称:Robot-2014,代码行数:15,


示例24: OperatorControl

	void OperatorControl(void)	{		digEncoder.Start();		const double ppsTOrpm = 60.0/250.0;	//This converts from Pos per Second to Rotations per Minute (See second number on back of encoder to replace 250 if you need it)				while (IsOperatorControl())		{			SmartDashboard::PutNumber("Digital Encoder RPM", digEncoder.GetRate()*ppsTOrpm);			Wait(0.1);		}		digEncoder.Stop();	}
开发者ID:Numeri,项目名称:MainWorkingCode,代码行数:12,


示例25: OperatorControl

	/**	 * Runs the motors with arcade steering. 	 */	void OperatorControl()	{		cout << "Hello operator!" << endl;		myRobot.SetSafetyEnabled(true);		while (IsOperatorControl())		{						myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)			Wait(0.005);				// wait for a motor update time		}		cout << "Bye operator!" << endl;	}
开发者ID:RevereRoboticsFRC,项目名称:SimpleTemplate,代码行数:15,


示例26: OperatorControl

	/**	 * Run the closed loop position controller on the Jag.	 */	void OperatorControl()	{		printf("In OperatorControl/n");		GetWatchdog().SetEnabled(true);		while (IsOperatorControl() && !IsDisabled())		{			GetWatchdog().Feed();			// Set the desired setpoint			speedJag.Set(stick.GetAxis(axis) * 150.0);			UpdateDashboardStatus();			Wait(0.05);		}	}
开发者ID:FRC980,项目名称:FRC-Team-980,代码行数:16,


示例27: OperatorControl

	void OperatorControl(){		myRobot->ResetDisplacement();		Drive->SetPriority(1);		Drive->join();		Shooter_Intake->SetPriority(2);		Shooter_Intake->join();		while(IsOperatorControl() && IsEnabled()){			Wait(2);			printf("Teleop");		}	}
开发者ID:SigmaCat-Robotics,项目名称:SigmaCodeCPP,代码行数:13,


示例28: OperatorControl

	void OperatorControl(void)	{				GetWatchdog().SetExpiration(.1);		GetWatchdog().SetEnabled(true);		GetWatchdog().Feed();		while (IsOperatorControl())		{			GetWatchdog().Feed();	   							UpdateDash();			Wait(.001f);		}	}
开发者ID:HighRollersCode,项目名称:HR12,代码行数:13,


示例29: OperatorControl

	void OperatorControl()	{		myRobot.SetSafetyEnabled(true);		while (IsOperatorControl() && IsEnabled())		{			//MECANUM DRIVE			float yValue = stick->GetY();			float xValue = stick->GetX();			float rotation = stick->GetTwist();			myRobot.MecanumDrive_Cartesian(xValue, yValue, rotation, 0.0);			Wait(0.005);		}	}
开发者ID:FRCTeam1967,项目名称:FRCTeam1967,代码行数:13,


示例30: OperatorControl

	void OperatorControl(void)	{		myRobot.SetSafetyEnabled(true);				gamepad.EnableButton(BUTTON_COLLECTOR_FWD);		gamepad.EnableButton(BUTTON_COLLECTOR_REV);		gamepad.EnableButton(BUTTON_SHOOTER);		gamepad.EnableButton(BUTTON_CLAW_1_LOCKED);		gamepad.EnableButton(BUTTON_CLAW_2_LOCKED);		gamepad.EnableButton(BUTTON_CLAW_1_UNLOCKED);		gamepad.EnableButton(BUTTON_CLAW_2_UNLOCKED);		gamepad.EnableButton(BUTTON_STOP_ALL);		gamepad.EnableButton(BUTTON_JOG_FWD);		gamepad.EnableButton(BUTTON_JOG_REV);		stick2.EnableButton(BUTTON_SHIFT);		// Set inital states for all switches and buttons		gamepad.Update();		indexSwitch.Update();		greenClawLockSwitch.Update();		yellowClawLockSwitch.Update();				stick2.Update();				// Set initial states for all pneumatic actuators		shifter.Set(DoubleSolenoid::kReverse);		greenClaw.Set(DoubleSolenoid::kReverse);		yellowClaw.Set(DoubleSolenoid::kReverse);		compressor.Start ();				while (IsOperatorControl())		{			gamepad.Update();			stick2.Update();			indexSwitch.Update();			greenClawLockSwitch.Update();			yellowClawLockSwitch.Update();						HandleCollectorInputs();			HandleDriverInputsManual();			HandleArmInputs();			HandleShooterInputs();			HandleResetButton();			UpdateStatusDisplays();						dsLCD->UpdateLCD();			Wait(0.005);				// wait for a motor update time		}	}
开发者ID:aitrean,项目名称:Wham-O,代码行数:51,



注:本文中的IsOperatorControl函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ IsPC函数代码示例
C++ IsOper函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。