virtual void TeleopInit() { // This makes sure that the autonomous stops running when // teleop starts running. If you want the autonomous to // continue until interrupted by another command, remove // this line or comment it out. autonomousCommand->Cancel(); resetSensors->Cancel(); startCompressor->Start(); }
virtual void TeleopInit() { // This makes sure that the autonomous stops running when // teleop starts running. If you want the autonomous to // continue until interrupted by another command, remove // this line or comment it out. if (_autonomousCommand) { _autonomousCommand->Cancel(); } clearLCD(); _teleopCommand = (Command*)_teleopChooser->GetSelected(); // _teleopCommand = (Command*)_noOpCmd; printCommandToLCD(_teleopCommand->GetName()); // if (! CommandBase::azimuthSubsystem->IsCalibrated()) // { // CommandBase::azimuthSubsystem->CalibrateAzimuth(); // } _teleopCommand->Start(); // _testRobotCmd->Start(); // _cmd = new TestBridgeArmCmd(CommandBase::oi->driveTrigger); // _cmd->Start(); }
void TeleopInit() { // This makes sure that the autonomous stops running when // teleop starts running. If you want the autonomous to // continue until interrupted by another command, remove // this line or comment it out. if (autonomousCommand != NULL) autonomousCommand->Cancel(); }
virtual void TeleopInit() { // This makes sure that the autonomous stops running when // teleop starts running. If you want the autonomous to // continue until interrupted by another command, remove // this line or comment it out. autonomousCommand->Cancel(); cmdEmergencyStop(); //make sure everything is off and in a netral state when teleop starts. }
void TeleopInit() { // This makes sure that the autonomous stops running when // teleop starts running. If you want the autonomous to // continue until interrupted by another command, remove // this line or comment it out. teleop = new SendI2C(LEDSystem::LEDstate::teleop); teleop->Initialize(); if (autonomousCommand != NULL) autonomousCommand->Cancel(); }
virtual void TeleopInit() { // This makes sure that the autonomous stops running when // teleop starts running. If you want the autonomous to // continue until interrupted by another command, remove // this line or comment it out. autonomousCommand->Cancel(); //reset servos //uncomment later //resetCommand->Start(); CommandBase::elevator->updateStatus(); CommandBase::delivery->updateStatus(); CommandBase::intake->updateStatus(); }
// Called repeatedly when this Command is scheduled to run void CollectorUP::Execute() { if ((Robot::shooterArm->GetCurrentAngle() >= 57.5) && (Robot::shooterArm->GetTargetAngle() >= 57.5)) { Robot::collector->SetCollectorPosition(false); } else if (Robot::shooterArm->GetTargetAngle() < 57.5) { Command *cmd = Robot::collector->GetCurrentCommand(); if (cmd != (Command *)0) cmd->Cancel(); Robot::shooterArm->SetTargetPosition(ShooterArm::TRUSS); } }
virtual void AutonomousInit() { if (_teleopCommand) { _teleopCommand->Cancel(); } clearLCD(); _autonomousCommand = (Command*)_autoChooser->GetSelected(); // _autonomousCommand = (Command*) _autoFireCmd; printCommandToLCD(_autonomousCommand->GetName()); _autonomousCommand->Start(); }
virtual void DisabledPeriodic() { resetSensors->Cancel(); driversStationUpdater->Run(); SmartDashboard::PutNumber("Gyro Angle", CommandBase::chassisSensors->getGyroAngle()); SmartDashboard::PutNumber("Left Drive Encoder", CommandBase::chassisSensors->getLeftDistance()); SmartDashboard::PutNumber("Right Drive Encoder", CommandBase::chassisSensors->getRightDistance()); SmartDashboard::PutNumber("X-Axis Accelerometer", CommandBase::chassisSensors->getAccelerometerXData()); SmartDashboard::PutNumber("Y-Axis Accelerometer", CommandBase::chassisSensors->getAccelerometerYData()); SmartDashboard::PutNumber("Z-Axis Accelerometer", CommandBase::chassisSensors->getAccelerometerZData()); SmartDashboard::PutNumber("Left Drive Stick", CommandBase::oi->getDriveStickLeft()->GetY()); SmartDashboard::PutNumber("Right Drive Stick", CommandBase::oi->getDriveStickRight()->GetY()); SmartDashboard::PutNumber("Left Front Motor", CommandBase::chassis->getSpeedControllerOutput(1)); SmartDashboard::PutNumber("Left Rear Motor", CommandBase::chassis->getSpeedControllerOutput(3)); SmartDashboard::PutNumber("Right Front Motor", CommandBase::chassis->getSpeedControllerOutput(2)); SmartDashboard::PutNumber("Right Rear Motor", CommandBase::chassis->getSpeedControllerOutput(4)); SmartDashboard::PutBoolean("Shooter State", CommandBase::shooter->getShooterState()); Scheduler::GetInstance()->Run(); }
/** * Update the network tables associated with the Scheduler object on the * SmartDashboard. */ void Scheduler::UpdateTable() { CommandSet::iterator commandIter; if (m_table != nullptr) { // Get the list of possible commands to cancel auto new_toCancel = m_table->GetValue("Cancel"); if (new_toCancel) toCancel = new_toCancel->GetDoubleArray(); else toCancel.resize(0); // m_table->RetrieveValue("Ids", *ids); // cancel commands that have had the cancel buttons pressed // on the SmartDashboad if (!toCancel.empty()) { for (commandIter = m_commands.begin(); commandIter != m_commands.end(); ++commandIter) { for (unsigned i = 0; i < toCancel.size(); i++) { Command* c = *commandIter; if (c->GetID() == toCancel[i]) { c->Cancel(); } } } toCancel.resize(0); m_table->PutValue("Cancel", nt::Value::MakeDoubleArray(toCancel)); } // Set the running commands if (m_runningCommandsChanged) { commands.resize(0); ids.resize(0); for (commandIter = m_commands.begin(); commandIter != m_commands.end(); ++commandIter) { Command* c = *commandIter; commands.push_back(c->GetName()); ids.push_back(c->GetID()); } m_table->PutValue("Names", nt::Value::MakeStringArray(commands)); m_table->PutValue("Ids", nt::Value::MakeDoubleArray(ids)); } } }
virtual void TeleopInit() { autonomousCommand->Cancel(); }
virtual void AutonomousInit() { autonomousCommand->Start(); clearLCD->Start(); resetSensors->Cancel(); startCompressor->Start(); }