本文整理汇总了C++中LiveWindow::AddSensor方法的典型用法代码示例。如果您正苦于以下问题:C++ LiveWindow::AddSensor方法的具体用法?C++ LiveWindow::AddSensor怎么用?C++ LiveWindow::AddSensor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LiveWindow
的用法示例。
在下文中一共展示了LiveWindow::AddSensor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void RobotMap::init() {
// The following variables are automatically assigned by
// robotbuilder and will be updated the next time you export to
// Java from robot builder. Do not put any code or make any change
// in the following block or it will be lost on an update. To
// prevent this subsystem from being automatically updated, delete
// the following line.
LiveWindow* lw = LiveWindow::GetInstance();
DRIVE_LJAGA = new CANJaguar(6);
DRIVE_LJAGB = new CANJaguar(7);
DRIVE_RJAGA = new CANJaguar(8);
DRIVE_RJAGB = new CANJaguar(9);
DRIVE_LENC = new Encoder(1, 2, 1, 3, false, Encoder::k4X);
lw->AddSensor("Drive", "lEnc", DRIVE_LENC);
DRIVE_LENC->SetDistancePerPulse(1.0);
DRIVE_LENC->SetPIDSourceParameter(Encoder::kRate);
DRIVE_RENC = new Encoder(1, 4, 1, 5, false, Encoder::k4X);
lw->AddSensor("Drive", "rEnc", DRIVE_RENC);
DRIVE_RENC->SetDistancePerPulse(1.0);
DRIVE_RENC->SetPIDSourceParameter(Encoder::kRate);
DRIVE_SHIFTER = new LiveSolenoid(1, 1);
lw->AddActuator("Drive", "shifter", DRIVE_SHIFTER);
}
示例2: init
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=ALLOCATION
void RobotMap::init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
LiveWindow* lw = LiveWindow::GetInstance();
drivetrainLeftside = new Victor(1, 1);
lw->AddActuator("Drivetrain", "Left side", (Victor*) drivetrainLeftside);
drivetrainRightside = new Victor(1, 2);
lw->AddActuator("Drivetrain", "Right side", (Victor*) drivetrainRightside);
drivetrainRobotDrive = new RobotDrive(drivetrainLeftside, drivetrainRightside);
drivetrainRobotDrive->SetSafetyEnabled(false);
drivetrainRobotDrive->SetExpiration(0.1);
drivetrainRobotDrive->SetSensitivity(0.5);
drivetrainRobotDrive->SetMaxOutput(1.0);
drivetrainDrivetrainGyro = new Gyro(1, 1);
lw->AddSensor("Drivetrain", "Drivetrain Gyro", drivetrainDrivetrainGyro);
drivetrainDrivetrainGyro->SetSensitivity(1.25);
drivetrainOpticalsensor = new DigitalInput(1, 1);
lw->AddSensor("Drivetrain", "Optical sensor", drivetrainOpticalsensor);
drivetrainRangeFinder = new AnalogChannel(1, 2);
lw->AddSensor("Drivetrain", "RangeFinder", drivetrainRangeFinder);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
示例3: init
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=ALLOCATION
void RobotMap::init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
LiveWindow* lw = LiveWindow::GetInstance();
driveTrainRightMotor = new Jaguar(1, 2);
lw->AddActuator("DriveTrain", "RightMotor", (Jaguar*) driveTrainRightMotor);
driveTrainLeftMotor = new Jaguar(1, 1);
lw->AddActuator("DriveTrain", "LeftMotor", (Jaguar*) driveTrainLeftMotor);
driveTrainRobotDrive21 = new RobotDrive(driveTrainLeftMotor, driveTrainRightMotor);
driveTrainRobotDrive21->SetSafetyEnabled(true);
driveTrainRobotDrive21->SetExpiration(0.1);
driveTrainRobotDrive21->SetSensitivity(0.5);
driveTrainRobotDrive21->SetMaxOutput(1.0);
driveTrainRobotDrive21->SetInvertedMotor(RobotDrive::kRearLeftMotor, true);
driveTrainRobotDrive21->SetInvertedMotor(RobotDrive::kRearRightMotor, true);
shootingWheelShootingWheelController = new Talon(1, 3);
lw->AddActuator("ShootingWheel", "ShootingWheelController", (Talon*) shootingWheelShootingWheelController);
loaderLoaderController = new Talon(1, 4);
lw->AddActuator("Loader", "LoaderController", (Talon*) loaderLoaderController);
loaderReadySwitch = new DigitalInput(1, 1);
lw->AddSensor("Loader", "ReadySwitch", loaderReadySwitch);
loaderEndSwitch = new DigitalInput(1, 2);
lw->AddSensor("Loader", "EndSwitch", loaderEndSwitch);
trackLifterTrackLifterController = new Talon(1, 5);
lw->AddActuator("TrackLifter", "TrackLifterController", (Talon*) trackLifterTrackLifterController);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
示例4: init
void RobotMap::init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
LiveWindow *lw = LiveWindow::GetInstance();
controlSSsolenoid1.reset(new Solenoid(1));
lw->AddActuator("ControlSS", "solenoid1", controlSSsolenoid1);
controlSSsolenoid1.reset(new Solenoid(2));
lw->AddActuator("ControlSS", "solenoid2", controlSSsolenoid2);
controlSSsolenoid1.reset(new Solenoid(3));
lw->AddActuator("ControlSS", "solenoid3", controlSSsolenoid3);
controlSSsolenoid1.reset(new Solenoid(4));
lw->AddActuator("ControlSS", "solenoid4", controlSSsolenoid4);
controlSSfrontLS.reset(new DigitalInput(0));
lw->AddSensor("ControlSS", "frontLS", controlSSfrontLS);
controlSSbackLS.reset(new DigitalInput(1));
lw->AddSensor("ControlSS", "backLS", controlSSbackLS);
controlSSsideLS.reset(new DigitalInput(2));
lw->AddSensor("ControlSS", "sideLS", controlSSsideLS);
controlSSpressureGauge.reset(new AnalogInput(1));
lw->AddSensor("ControlSS", "pressureGauge", controlSSpressureGauge);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
示例5: init
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=ALLOCATION
void RobotMap::init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
LiveWindow* lw = LiveWindow::GetInstance();
drivetrainFrontRight = new Talon(1, 1);
lw->AddActuator("Drivetrain", "Front Right", (Talon*) drivetrainFrontRight);
drivetrainFrontLeft = new Talon(1, 2);
lw->AddActuator("Drivetrain", "Front Left", (Talon*) drivetrainFrontLeft);
drivetrainBackRight = new Talon(1, 3);
lw->AddActuator("Drivetrain", "Back Right", (Talon*) drivetrainBackRight);
drivetrainBackLeft = new Talon(1, 4);
lw->AddActuator("Drivetrain", "Back Left", (Talon*) drivetrainBackLeft);
drivetrainDrivetrain = new RobotDrive(drivetrainFrontLeft, drivetrainBackLeft,
drivetrainFrontRight, drivetrainBackRight);
drivetrainDrivetrain->SetSafetyEnabled(true);
drivetrainDrivetrain->SetExpiration(0.1);
drivetrainDrivetrain->SetSensitivity(0.5);
drivetrainDrivetrain->SetMaxOutput(1.0);
shooterDiskPusher = new Relay(1, 1);
lw->AddActuator("Shooter", "Disk Pusher", shooterDiskPusher);
shooterShooterEncoder = new GearTooth(1, 1, false);
lw->AddSensor("Shooter", "Shooter Encoder", shooterShooterEncoder);
shooterShooterTalon1 = new Talon(1, 5);
lw->AddActuator("Shooter", "Shooter Talon 1", (Talon*) shooterShooterTalon1);
shooterShooterTalon2 = new Talon(1, 6);
lw->AddActuator("Shooter", "Shooter Talon 2", (Talon*) shooterShooterTalon2);
shooterPusherStopSwitch = new DigitalInput(1, 2);
lw->AddSensor("Shooter", "Pusher Stop Switch", shooterPusherStopSwitch);
climberClimberTalon1 = new Talon(1, 7);
lw->AddActuator("Climber", "Climber Talon 1", (Talon*) climberClimberTalon1);
climberClimberBeltSystem = new Relay(1, 2);
lw->AddActuator("Climber", "Climber Belt System", climberClimberBeltSystem);
climberDiskStopper1 = new Servo(1, 9);
lw->AddActuator("Climber", "Disk Stopper 1", climberDiskStopper1);
climberDiskStopper2 = new Servo(1, 10);
lw->AddActuator("Climber", "Disk Stopper 2", climberDiskStopper2);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
示例6: RobotInit
/**
* Called when the robot starts up and the robot control software comes online
* Much (if possible, all) of the initialization required for your robot should happen here
*/
void RobotInit()
{
//Get the instance of the LiveWindow system
lw = LiveWindow::GetInstance();
//Create Drivetrain Left Instance and add to LiveWindow
left = new Victor(LEFT_PWM);
lw->AddActuator("Victor", LEFT_PWM, left);
//Create Drivetrain Right Instance and add to LiveWindow
right = new Victor(RIGHT_PWM);
lw->AddActuator("Victor", RIGHT_PWM, right);
//Create RobotDrive Instance
rd = new RobotDrive(left, right);
//Create Primary Shooter Instance and add to LiveWindow
shoot1 = new Victor(SHOOT1_PWM);
lw->AddActuator("Victor", SHOOT1_PWM, shoot1);
//Create Secondary Shooter Instance and add to LiveWindow
shoot2 = new Victor(SHOOT2_PWM);
lw->AddActuator("Victor", SHOOT2_PWM, shoot2);
//Create Kicker Instance and add to LiveWindow
kicker = new Victor(KICKER_PWM);
lw->AddActuator("Victor", KICKER_PWM, kicker);
//Create Kicker Switch Instance and add to LiveWindow
kickerSwitch = new DigitalInput(KICKER_DIO);
lw->AddSensor("Digital Input", KICKER_DIO, kickerSwitch);
//Create Joystick Instance
j1 = new Joystick(JOYSTICK_USB);
}
示例7: init
void RobotMap::init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
LiveWindow* lw = LiveWindow::GetInstance();
moverRightMotor0 = new Jaguar(0);
lw->AddActuator("Mover", "RightMotor0", (Jaguar*) moverRightMotor0);
moverRightMotor1 = new Jaguar(1);
lw->AddActuator("Mover", "RightMotor1", (Jaguar*) moverRightMotor1);
moverLeftMotor2 = new Jaguar(2);
lw->AddActuator("Mover", "LeftMotor2", (Jaguar*) moverLeftMotor2);
moverLeftMotor3 = new Jaguar(3);
lw->AddActuator("Mover", "LeftMotor3", (Jaguar*) moverLeftMotor3);
moverSpeedSwitch = new DigitalInput(8);
lw->AddSensor("Mover", "SpeedSwitch", moverSpeedSwitch);
airCannonLeftCannon = new Solenoid(0, 2);
lw->AddActuator("AirCannon", "LeftCannon", airCannonLeftCannon);
airCannonMiddleCannon = new Solenoid(0, 1);
lw->AddActuator("AirCannon", "MiddleCannon", airCannonMiddleCannon);
airCannonRightCannon = new Solenoid(0, 0);
lw->AddActuator("AirCannon", "RightCannon", airCannonRightCannon);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
示例8: init
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=ALLOCATION
void RobotMap::init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
LiveWindow* lw = LiveWindow::GetInstance();
drivetrainleftfront = new CANJaguar(6);
drivetrainleftrear = new CANJaguar(18);
drivetrainrightfront = new CANJaguar(11);
drivetrainrightrear = new CANJaguar(5);
elevatorLeft = new CANJaguar(8);
elevatorRight = new CANJaguar(4);
elevatorPot = new AnalogChannel(1, 1);
lw->AddSensor("Elevator", "Pot", elevatorPot);
shooterFront = new CANJaguar(3);
shooterRear = new CANJaguar(7);
shifterLeft = new Servo(1, 1);
lw->AddActuator("Shifter", "Left", shifterLeft);
shifterRight = new Servo(1, 2);
lw->AddActuator("Shifter", "Right", shifterRight);
flopperFlopperSpike = new Relay(1, 1);
lw->AddActuator("Flopper", "FlopperSpike", flopperFlopperSpike);
flopperIRSensor = new DigitalInput(1, 1);
lw->AddSensor("Flopper", "IRSensor", flopperIRSensor);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
示例9: init
void RobotMap::init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
LiveWindow* lw = LiveWindow::GetInstance();
driveLeftFront = new Talon(1);
lw->AddActuator("Drive", "Left Front", (Talon*) driveLeftFront);
driveLeftRear = new Talon(2);
lw->AddActuator("Drive", "Left Rear", (Talon*) driveLeftRear);
driveRightFront = new Talon(3);
lw->AddActuator("Drive", "Right Front", (Talon*) driveRightFront);
driveRightRear = new Talon(4);
lw->AddActuator("Drive", "Right Rear", (Talon*) driveRightRear);
driveRobotDrive41 = new RobotDrive(driveLeftFront, driveLeftRear,
driveRightFront, driveRightRear);
driveRobotDrive41->SetSafetyEnabled(true);
driveRobotDrive41->SetExpiration(0.1);
driveRobotDrive41->SetSensitivity(0.5);
driveRobotDrive41->SetMaxOutput(1.0);
grabberGrabberPnuematicCylinder = new DoubleSolenoid(0, 0, 1);
lw->AddActuator("Grabber", "Grabber Pnuematic Cylinder", grabberGrabberPnuematicCylinder);
elevatorLifterEncoder = new Encoder(0, 1, false, Encoder::k4X);
lw->AddSensor("Elevator", "Lifter Encoder", elevatorLifterEncoder);
elevatorLifterEncoder->SetDistancePerPulse(1.0);
elevatorLifterEncoder->SetPIDSourceParameter(Encoder::kDistance);
elevatorLifterMotor = new Talon(0);
lw->AddActuator("Elevator", "LifterMotor", (Talon*) elevatorLifterMotor);
elevatorUpperLimitSwitch = new DigitalInput(2);
lw->AddSensor("Elevator", "Upper Limit Switch", elevatorUpperLimitSwitch);
elevatorLowerLimitSwitch = new DigitalInput(3);
lw->AddSensor("Elevator", "Lower Limit Switch", elevatorLowerLimitSwitch);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
示例10: init
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=ALLOCATION
void RobotMap::init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
LiveWindow* lw = LiveWindow::GetInstance();
driveTrainLeftDrive = new CANJaguar(1);
driveTrainRightDrive = new CANJaguar(2);
driveTrainRight0Drive = new CANJaguar(3);
driveTrainLeft0Drive = new CANJaguar(4);
driveTrainRobotDrive = new RobotDrive(driveTrainLeftDrive, driveTrainRightDrive, driveTrainRight0Drive, driveTrainLeft0Drive);
driveTrainRobotDrive->SetSafetyEnabled(false);
driveTrainRobotDrive->SetExpiration(0.1);
driveTrainRobotDrive->SetSensitivity(0.5);
driveTrainRobotDrive->SetMaxOutput(1.0);
collectorPacManIR = new DigitalInput(1, 4);
lw->AddSensor("Collector", "PacManIR", collectorPacManIR);
collectorPacManFeeder = new Victor(1, 3);
lw->AddActuator("Collector", "PacManFeeder", (Victor*) collectorPacManFeeder);
shootermainShooter = new CANJaguar(7);
shooterTurret = new CANJaguar(5);
shooteroneBitIREncoder = new DigitalInput(1, 6);
lw->AddSensor("Shooter", "oneBitIREncoder", shooteroneBitIREncoder);
shooterAngleEncoder = new AnalogChannel(1, 2);
lw->AddSensor("Shooter", "AngleEncoder", shooterAngleEncoder);
shooterAngleVictor = new Victor(1, 4);
lw->AddActuator("Shooter", "AngleVictor", (Victor*) shooterAngleVictor);
angleCheckWithGyroGyro1 = new Gyro(1, 1);
lw->AddSensor("AngleCheckWithGyro", "Gyro 1", angleCheckWithGyroGyro1);
//angleCheckWithGyroGyro1->SetSensitivity(0.007);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
angleCheckWithGyroGyro1->Reset();
}
示例11: init
void RobotMap::init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
LiveWindow *lw = LiveWindow::GetInstance();
driveLeftDrive.reset(new CANTalon(5));
lw->AddActuator("Drive", "LeftDrive", driveLeftDrive);
driveRightDrive.reset(new CANTalon(3));
lw->AddActuator("Drive", "RightDrive", driveRightDrive);
driveTankDrive.reset(new RobotDrive(driveLeftDrive, driveRightDrive));
driveTankDrive->SetSafetyEnabled(true);
driveTankDrive->SetExpiration(0.1);
driveTankDrive->SetSensitivity(0.5);
driveTankDrive->SetMaxOutput(1.0);
shooterSystemLeftShooterTalonLeft.reset(new CANTalon(2));
lw->AddActuator("ShooterSystemLeft", "ShooterTalonLeft", shooterSystemLeftShooterTalonLeft);
shooterSystemLeftQuadEncShooterLeft.reset(new Encoder(9, 8, false, Encoder::k4X));
lw->AddSensor("ShooterSystemLeft", "QuadEncShooterLeft", shooterSystemLeftQuadEncShooterLeft);
shooterSystemLeftQuadEncShooterLeft->SetDistancePerPulse(1.0);
shooterSystemLeftQuadEncShooterLeft->SetPIDSourceType(PIDSourceType::kRate);
intakeSubsystemIntakeTalon.reset(new CANTalon(1));
lw->AddActuator("IntakeSubsystem", "IntakeTalon", intakeSubsystemIntakeTalon);
shooterSystemRightShooterTalonRight.reset(new CANTalon(4));
lw->AddActuator("ShooterSystemRight", "ShooterTalonRight", shooterSystemRightShooterTalonRight);
shooterSystemRightQuadEncShooterRight.reset(new Encoder(7, 6, false, Encoder::k4X));
lw->AddSensor("ShooterSystemRight", "QuadEncShooterRight", shooterSystemRightQuadEncShooterRight);
shooterSystemRightQuadEncShooterRight->SetDistancePerPulse(1.0);
shooterSystemRightQuadEncShooterRight->SetPIDSourceType(PIDSourceType::kRate);
intakeSubsystemServoLeft.reset(new Servo(0));
lw->AddActuator("IntakeSubsystem", "ServoLeft", intakeSubsystemServoLeft);
intakeSubsystemServoRight.reset(new Servo(1));
lw->AddActuator("IntakeSubsystem", "ServoRight", intakeSubsystemServoRight);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
示例12: init
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=ALLOCATION
void RobotMap::init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
LiveWindow* lw = LiveWindow::GetInstance();
driveTrainDriveLeft1 = new Victor(1, 1);
lw->AddActuator("DriveTrain", "DriveLeft1", (Victor*) driveTrainDriveLeft1);
driveTrainDriveRight1 = new Victor(1, 3);
lw->AddActuator("DriveTrain", "DriveRight1", (Victor*) driveTrainDriveRight1);
driveTrainRobotDrive = new RobotDrive(driveTrainDriveLeft1, driveTrainDriveRight1);
driveTrainRobotDrive->SetSafetyEnabled(true);
driveTrainRobotDrive->SetExpiration(0.25);
driveTrainRobotDrive->SetSensitivity(0.5);
driveTrainRobotDrive->SetMaxOutput(1.0);
driveTrainultrasonicDistance = new AnalogChannel(1, 1);
lw->AddSensor("DriveTrain", "ultrasonicDistance", driveTrainultrasonicDistance);
feederFeederMotor = new Victor(1, 2);
lw->AddActuator("Feeder", "FeederMotor", (Victor*) feederFeederMotor);
climberClimberMotor = new Victor(1, 5);
lw->AddActuator("Climber", "ClimberMotor", (Victor*) climberClimberMotor);
climberTapeLimitLeft = new DigitalInput(1, 1);
lw->AddSensor("Climber", "TapeLimitLeft", climberTapeLimitLeft);
climberTapeLimitRight = new DigitalInput(1, 2);
lw->AddSensor("Climber", "TapeLimitRight", climberTapeLimitRight);
climberTapeAngleLeft = new Servo(1, 6);
lw->AddActuator("Climber", "TapeAngleLeft", climberTapeAngleLeft);
climberTapeAngleRight = new Servo(1, 7);
lw->AddActuator("Climber", "TapeAngleRight", climberTapeAngleRight);
shootershooterMotor = new CANJaguar(4);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
示例13: init
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=ALLOCATION
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=ALLOCATION
void RobotMap::init() {
LiveWindow* lw = LiveWindow::GetInstance();
driveLSpeed = new Talon(1, 2);
lw->AddActuator("Drive", "LSpeed", (Talon*) driveLSpeed);
driveRSpeed = new Talon(1, 1);
lw->AddActuator("Drive", "RSpeed", (Talon*) driveRSpeed);
driveControl = new RobotDrive(driveLSpeed, driveRSpeed);
driveControl->SetSafetyEnabled(true);
driveControl->SetExpiration(0.1);
driveControl->SetSensitivity(0.5);
driveControl->SetMaxOutput(1.0);
driveGyro = new Gyro(1, 1);
lw->AddSensor("Drive", "Gyro", driveGyro);
driveGyro->SetSensitivity(0.007);
driveTurn = new Victor(1, 4);
//lw->AddActuator("Drive", "Turn", (Victor*) driveTurn);
driveGyroPID = new PIDController(0.03, 0.0, 0.0,/* F: 0.0, */ driveGyro, driveTurn, 0.02);
lw->AddActuator("Drive", "GyroPID", driveGyroPID);
driveGyroPID->SetContinuous(false); driveGyroPID->SetAbsoluteTolerance(0.2);
driveGyroPID->SetOutputRange(-1.0, 1.0);
driveLEncoder = new Encoder(1, 2, 1, 3, false, Encoder::k1X);
lw->AddSensor("Drive", "LEncoder", driveLEncoder);
driveLEncoder->SetDistancePerPulse(1.0);
driveLEncoder->SetPIDSourceParameter(Encoder::kDistance);
driveLEncoder->Start();
driveREncoder = new Encoder(1, 9, 1, 10, true, Encoder::k1X);
lw->AddSensor("Drive", "REncoder", driveREncoder);
driveREncoder->SetDistancePerPulse(1.0);
driveREncoder->SetPIDSourceParameter(Encoder::kDistance);
driveREncoder->Start();
pincerPinch = new Relay(1,2);
tiltTilt = new Relay(1,3);
lw->AddSensor("El Pincho", "Pinch", pincerPinch);
lw->AddSensor("El Pincho", "Tilt", tiltTilt);
compressorSysComp = new Compressor(1, 1, 1, 4);
catapultEncoder = new Encoder(1, 6, 1, 7, false, Encoder::k4X);
lw->AddSensor("Catapult", "Encoder", catapultEncoder);
catapultEncoder->SetDistancePerPulse(1.0);
catapultEncoder->SetPIDSourceParameter(Encoder::kDistance);
catapultEncoder->Start();
catapultJag2 = new CANJaguar(2);
catapultJag3 = new CANJaguar(3);
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
示例14: init
void HardwareMap::init() {
log_info("init()");
// Add hardware to the live window
// You can then debug each hardware object in the driver station test mode
// on the smart dashboard.
LiveWindow *lw = LiveWindow::GetInstance();
lw->AddActuator("Drive", "Front Left Motor", &front_left_motor);
lw->AddActuator("Drive", "Rear Left Motor", &rear_left_motor);
lw->AddActuator("Drive", "Front Right Motor", &front_right_motor);
lw->AddActuator("Drive", "Rear Right Motor", &rear_right_motor);
lw->AddActuator("Arm", "Front Arm Motor", &front_arm_motor);
lw->AddActuator("Arm", "Wheel Motor", &wheel_motor);
lw->AddActuator("Shooter", "Left Launch Solenoid", &launch_solenoid_left);
lw->AddActuator("Shooter", "Right Launch Solenoid", &launch_solenoid_right);
lw->AddSensor("Shooter", "Compressor", &compressor);
}
示例15: init
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=ALLOCATION
void RobotMap::init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
LiveWindow* lw = LiveWindow::GetInstance();
driveTrainSpeedControllerRR = new Talon(1, 3);
lw->AddActuator("DriveTrain", "SpeedControllerRR", (Talon*) driveTrainSpeedControllerRR);
driveTrainSpeedControllerRL = new Talon(1, 1);
lw->AddActuator("DriveTrain", "SpeedControllerRL", (Talon*) driveTrainSpeedControllerRL);
driveTrainSpeedControllerFR = new Talon(1, 4);
lw->AddActuator("DriveTrain", "SpeedControllerFR", (Talon*) driveTrainSpeedControllerFR);
driveTrainSpeedControllerFL = new Talon(1, 2);
lw->AddActuator("DriveTrain", "SpeedControllerFL", (Talon*) driveTrainSpeedControllerFL);
driveTrainOmniDrive = new RobotDrive(driveTrainSpeedControllerFL, driveTrainSpeedControllerRL,
driveTrainSpeedControllerFR, driveTrainSpeedControllerRR);
driveTrainOmniDrive->SetSafetyEnabled(false);
driveTrainOmniDrive->SetExpiration(0.1);
driveTrainOmniDrive->SetSensitivity(0.5);
driveTrainOmniDrive->SetMaxOutput(1.0);
feederSpeedController = new Talon(1, 6);
lw->AddActuator("Feeder", "SpeedController", (Talon*) feederSpeedController);
feederLimitSwitch = new DigitalInput(1, 9);
lw->AddSensor("Feeder", "LimitSwitch", feederLimitSwitch);
launcherLimitSwitchUp = new DigitalInput(1, 8);
lw->AddSensor("Launcher", "LimitSwitchUp", launcherLimitSwitchUp);
launcherSpeedController = new Victor(1, 5);
lw->AddActuator("Launcher", "SpeedController", (Victor*) launcherSpeedController);
launcherLimitSwitchDown = new DigitalInput(1, 7);
lw->AddSensor("Launcher", "LimitSwitchDown", launcherLimitSwitchDown);
launcherDistanceSensor = new AnalogChannel(1, 1);
lw->AddSensor("Launcher", "DistanceSensor", launcherDistanceSensor);
pneumaticMainCompressor = new Compressor(1, 5, 1, 1);
feederSolenoidFeederDown = new Solenoid(1, 1);
lw->AddActuator("FeederSolenoid", "FeederDown", feederSolenoidFeederDown);
cameraMoveLeft = new DigitalInput(1, 10);
lw->AddSensor("Camera", "MoveLeft", cameraMoveLeft);
cameraMoveRight = new DigitalInput(1, 11);
lw->AddSensor("Camera", "MoveRight", cameraMoveRight);
cameraCameraServo = new Servo(1, 8);
lw->AddActuator("Camera", "CameraServo", cameraCameraServo);
distanceSensorUltrasonicSensor = new AnalogChannel(1, 2);
lw->AddSensor("DistanceSensor", "UltrasonicSensor", distanceSensorUltrasonicSensor);
distanceSensorInRangeLight = new Relay(1, 2);
lw->AddActuator("DistanceSensor", "InRangeLight", distanceSensorInRangeLight);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}