コード例 #1
0
ファイル: RobotDrive.cs プロジェクト: atrimper/WPILib
 /// <summary>
 /// Provides arcade style driving for the robot.
 /// </summary>
 /// <remarks>Given a single joystick, the class assumes the Y axis for the move value and the X
 /// axis for the rotate value.</remarks>
 /// <param name="stick">The joystick to use for drving. Y-axis will be forward/backwards, and X-axis
 /// will be rotation.</param>
 /// <param name="squaredInputs">If this setting is true, it decreases the sensitvity at lower speeds.</param>
 public void ArcadeDrive(GenericHID stick, bool squaredInputs = true)
 {
     if (stick == null)
     {
         throw new ArgumentNullException(nameof(stick), "Joystick provided was null");
     }
     ArcadeDrive(stick.GetY(), stick.GetX(), squaredInputs);
 }
コード例 #2
0
ファイル: RobotDrive.cs プロジェクト: atrimper/WPILib
 /// <summary>
 /// Provide tank style driving for the robot.
 /// </summary>
 /// <remarks>Drives the robot using the 2 joystick inputs. The Y-axis will be selected
 /// from each joystick object.</remarks>
 /// <param name="leftStick">The joystick to control the left side of the robot.</param>
 /// <param name="rightStick">The joystick to control the right side of the robot.</param>
 /// <param name="squaredInputs">If this setting is true, it decreases the sensitvity at lower speeds.</param>
 public void TankDrive(GenericHID leftStick, GenericHID rightStick, bool squaredInputs = true)
 {
     if (leftStick == null)
     {
         throw new ArgumentNullException(nameof(leftStick), "Joystick provided was null");
     }
     if (rightStick == null)
     {
         throw new ArgumentNullException(nameof(rightStick), "Joystick provided was null");
     }
     TankDrive(leftStick.GetY(), rightStick.GetY(), squaredInputs);
 }
コード例 #3
0
ファイル: RobotDrive.cs プロジェクト: chopshop-166/WPILib
 /// <summary>
 /// Provides arcade style driving for the robot.
 /// </summary>
 /// <remarks>Given a single joystick, the class assumes the Y axis for the move value and the X
 /// axis for the rotate value.</remarks>
 /// <param name="stick">The joystick to use for drving. Y-axis will be forward/backwards, and X-axis
 /// will be rotation.</param>
 /// <param name="squaredInputs">If this setting is true, it decreases the sensitvity at lower speeds.</param>
 public void ArcadeDrive(GenericHID stick, bool squaredInputs = true)
 {
     if (stick == null)
         throw new ArgumentNullException(nameof(stick), "Joystick provided was null");
     ArcadeDrive(stick.GetY(), stick.GetX(), squaredInputs);
 }
コード例 #4
0
ファイル: RobotDrive.cs プロジェクト: chopshop-166/WPILib
 /// <summary>
 /// Provide tank style driving for the robot.
 /// </summary>
 /// <remarks>Drives the robot using the 2 joystick inputs. The Y-axis will be selected
 /// from each joystick object.</remarks>
 /// <param name="leftStick">The joystick to control the left side of the robot.</param>
 /// <param name="rightStick">The joystick to control the right side of the robot.</param>
 /// <param name="squaredInputs">If this setting is true, it decreases the sensitvity at lower speeds.</param>
 public void TankDrive(GenericHID leftStick, GenericHID rightStick, bool squaredInputs = true)
 {
     if (leftStick == null)
         throw new ArgumentNullException(nameof(leftStick), "Joystick provided was null");
     if (rightStick == null)
         throw new ArgumentNullException(nameof(rightStick), "Joystick provided was null");
     TankDrive(leftStick.GetY(), rightStick.GetY(), squaredInputs);
 }