/// <summary>
        /// Adds a servo to the controller
        /// </summary>
        /// <param name="ID">Servo ID</param>
        /// <param name="mode">JOG mode</param>
        public void AddServo(byte ID, HerkulexDescription.JOG_MODE mode, UInt16 initialPosition)
        {
            Servo servo = new Servo(ID, mode);

            Servos.Add(ID, servo);
            Servos[ID].SetAbsolutePosition(initialPosition);
            //reply to all packets
            RAM_WRITE(ID, HerkulexDescription.RAM_ADDR.ACK_Policy, 1, 0x02); //reply to I_JOG / S_JOG

            RecoverErrors(servo);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds a servo to the controller
        /// </summary>
        /// <param name="ID">Servo ID</param>
        /// <param name="mode">JOG mode</param>
        public void AddServo(ServoId ID, HerkulexDescription.JOG_MODE mode)
        {
            Servo servo = new Servo(ID, mode);

            while (!Servos.TryAdd(ID, servo))
            {
                ;                               //ON tente l'ajout tant qu'il n'est pas validé
            }
            //reply to all packets
            RAM_WRITE(ID, HerkulexDescription.RAM_ADDR.ACK_Policy, 1, 0x02); //reply to I_JOG / S_JOG
            RecoverErrors(ID);
        }
Ejemplo n.º 3
0
 public Servo(ServoId pID, HerkulexDescription.JOG_MODE mode)
 {
     ID   = pID;
     Mode = mode;
 }