Esempio n. 1
0
        /// <summary>
        /// Constructor for a single motor output.
        /// </summary>
        /// <param name="servo">Servo output instance.</param>
        /// <param name="velocity">Initial motor velocity.</param>
        public Output(IO.Interfaces.Servo.Output servo,
                      double velocity = IO.Interfaces.Motor.Velocities.Stop)
        {
            if ((velocity < IO.Interfaces.Motor.Velocities.Minimum) ||
                (velocity > IO.Interfaces.Motor.Velocities.Maximum))
            {
                throw new System.Exception("Invalid motor velocity");
            }

            servo.position = velocity;
            this.servo     = servo;
        }
Esempio n. 2
0
 /// <summary>
 /// Consructor for a single motor output.
 /// </summary>
 /// <param name="servo">Servo output instance.</param>
 /// <param name="velocity">Initial normalized motor velocity.
 /// Allowed values are -1.0 (full speed reverse) to +1.0
 /// (full speed forward.</param>
 public Output(IO.Interfaces.Servo.Output servo,
               double velocity = IO.Interfaces.Motor.Velocities.Stop)
 {
     servo.position = velocity;
     this.servo     = servo;
 }