public void TestVictorSPStarts0() { using (VictorSP t = new VictorSP(2)) { Assert.AreEqual(t.Get(), 0); } }
public void TestVictorSPSet() { using (VictorSP t = new VictorSP(2)) { t.Set(1); Assert.AreEqual(t.Get(), 1); } }
public void TestPIDWrite() { using (VictorSP t = new VictorSP(2)) { t.PidWrite(-1); Assert.AreEqual(t.Get(), -1); } }
public void bindMotors() { motorClimb = new VictorSP(RobotMap.motorClimb); motorGearIntake = new VictorSP(RobotMap.motorGearIntake); motorGearUp = new VictorSP(RobotMap.motorGearUp); motorClimb.SafetyEnabled = false; motorGearIntake.SafetyEnabled = false; motorGearUp.SafetyEnabled = false; initTables(); }
public void TestPWMHelpers() { using (VictorSP t = new VictorSP(2)) { t.Set(1); Assert.AreEqual(PWMHelpers.ReverseByType(nameof(VictorSP), HalData()["pwm"][2]["raw_value"]), 1); Assert.AreEqual(PWMHelpers.ReverseByType(2), 1); Assert.AreEqual(HalData()["pwm"][2]["value"], 1); } }
public drivingControl() { motorFrontLeft.SafetyEnabled = false; motorFrontRight.SafetyEnabled = false; motorRearLeft.SafetyEnabled = false; motorRearRight.SafetyEnabled = false; motorFrontLeft = new VictorSP(RobotMap.motorFrontLeft); motorFrontRight = new VictorSP(RobotMap.motorFrontRight); motorRearLeft = new VictorSP(RobotMap.motorRearLeft); motorRearRight = new VictorSP(RobotMap.motorRearRight); drive.SafetyEnabled = false; drive = new RobotDrive(motorFrontLeft, motorRearLeft, motorFrontRight, motorRearRight); }
/// <summary> /// This function is run when the robot is first started up and should be /// used for any initialization code. /// </summary> public override void RobotInit() { chooser = new SendableChooser(); chooser.AddDefault("Default Auto", defaultAuto); chooser.AddObject("My Auto", straightAuto); chooser.AddObject("Left Auto", leftAuto); SmartDashboard.PutData("Chooser", chooser); //start cameras? CameraServer.Instance.StartAutomaticCapture(0); CameraServer.Instance.StartAutomaticCapture(1); //create joystick and robotdrive objects for joystick input and motor control stick = new Joystick(0); drive = new RobotDrive(0, 1, 2, 3); climber = new VictorSP(4); getRope = new VictorSP(5); flag = '\0'; testTime = new System.Timers.Timer(50); elapsed = true; elapsedTimes = 0; testTime.AutoReset = false; testTime.Elapsed += TimeAlert; }
public void TestVictorSPInitialized() { using (VictorSP t = new VictorSP(2)) Assert.AreEqual(HalData()["pwm"][2]["type"], "victorsp"); }
public operatingControl() { motorBallReady = new VictorSP(RobotMap.motorBallReady); motorBallShoot = new VictorSP(RobotMap.motorBallShoot); motorRobotClimb = new VictorSP(RobotMap.motorRobotClimb); }