Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DriveWheelMechanism"/> class.
 /// </summary>
 /// <param name="motor">The motor.</param>
 /// <param name="input">The input.</param>
 /// <param name="wheelbaseXM">The wheelbase xm.</param>
 /// <param name="wheelDiameterM">The wheel diameter m.</param>
 /// <param name="output">The output.</param>
 /// <param name="wheelStaticCoef">The wheel static coef.</param>
 /// <param name="wheelDynamicCoef">The wheel dynamic coef.</param>
 /// <param name="staticFriction">The static friction.</param>
 /// <param name="dynamicFriction">The dynamic friction.</param>
 public DriveWheelMechanism(DCMotor motor, ISimSpeedController input, double wheelbaseXM, double wheelDiameterM, IServoFeedback output,
                            double wheelStaticCoef = 1.07, double wheelDynamicCoef = 0.1, double staticFriction = 0.1, double dynamicFriction = 0.01) :
     this(motor, input, wheelbaseXM, wheelDiameterM, wheelStaticCoef, wheelDynamicCoef,
          staticFriction, dynamicFriction)
 {
     m_output = output;
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShooterWheelMechanism"/> class.
 /// </summary>
 /// <param name="input">The speed controller being used.</param>
 /// <param name="output">The feedback output.</param>
 /// <param name="model">The motor model.</param>
 /// <param name="invertInput">True if the input is inverted.</param>
 /// <param name="minimumVelocity">The minimum velocity in Rotations Per Minute</param>
 /// <param name="deaccelConstant">The deaccel constant in Rotations Per Minute</param>
 /// <param name="systemInertia">The system inertia in kg*m^2.</param>
 /// <param name="cpr">The counts per rotation of the sensor.</param>
 /// <exception cref="ArgumentOutOfRangeException">Shooter Wheels do not support analog inputs</exception>
 public ShooterWheelMechanism(ISimSpeedController input, IServoFeedback output, DCMotor model,
                              bool invertInput, double minimumVelocity, double deaccelConstant, double systemInertia, double cpr)
 {
     if (output is SimAnalogInput)
     {
         throw new ArgumentOutOfRangeException(nameof(output), "Shooter Wheels do not support analog inputs");
     }
     m_input                = input;
     m_output               = output;
     m_model                = model;
     m_invert               = invertInput;
     m_minimumVelocity      = minimumVelocity.RpmsToRadiansPerSecond();
     DeaccelerationConstant = deaccelConstant.RpmsToRadiansPerSecond();
     SystemInertia          = systemInertia;
     m_cpr = cpr;
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DriveWheelMechanism"/> class.
 /// </summary>
 /// <param name="motor">The motor.</param>
 /// <param name="input">The input.</param>
 /// <param name="wheelbaseXM">The wheelbase xm.</param>
 /// <param name="wheelDiameterM">The wheel diameter m.</param>
 /// <param name="output">The output.</param>
 /// <param name="wheelStaticCoef">The wheel static coef.</param>
 /// <param name="wheelDynamicCoef">The wheel dynamic coef.</param>
 /// <param name="staticFriction">The static friction.</param>
 /// <param name="dynamicFriction">The dynamic friction.</param>
 public DriveWheelMechanism(DCMotor motor, ISimSpeedController input, double wheelbaseXM, double wheelDiameterM, IServoFeedback output,
     double wheelStaticCoef = 1.07, double wheelDynamicCoef = 0.1, double staticFriction = 0.1, double dynamicFriction = 0.01) :
     this(motor, input, wheelbaseXM, wheelDiameterM, wheelStaticCoef, wheelDynamicCoef,
         staticFriction, dynamicFriction)
 {
     m_output = output;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ShooterWheelMechanism"/> class.
 /// </summary>
 /// <param name="input">The speed controller being used.</param>
 /// <param name="output">The feedback output.</param>
 /// <param name="model">The motor model.</param>
 /// <param name="invertInput">True if the input is inverted.</param>
 /// <param name="minimumVelocity">The minimum velocity in Rotations Per Minute</param>
 /// <param name="deaccelConstant">The deaccel constant in Rotations Per Minute</param>
 /// <param name="systemInertia">The system inertia in kg*m^2.</param>
 /// <param name="cpr">The counts per rotation of the sensor.</param>
 /// <exception cref="ArgumentOutOfRangeException">Shooter Wheels do not support analog inputs</exception>
 public ShooterWheelMechanism(ISimSpeedController input, IServoFeedback output, DCMotor model,
     bool invertInput, double minimumVelocity, double deaccelConstant, double systemInertia, double cpr)
 {
     if (output is SimAnalogInput)
     {
         throw new ArgumentOutOfRangeException(nameof(output), "Shooter Wheels do not support analog inputs");
     }
     m_input = input;
     m_output = output;
     m_model = model;
     m_invert = invertInput;
     m_minimumVelocity = minimumVelocity.RpmsToRadiansPerSecond();
     DeaccelerationConstant = deaccelConstant.RpmsToRadiansPerSecond();
     SystemInertia = systemInertia;
     m_cpr = cpr;
 }