Exemplo n.º 1
0
 /// <summary>
 /// Servo polled event
 /// </summary>
 /// <param name="servo"></param>
 public virtual void OnHerkulexServoInformation(Servo servo)
 {
     OnHerkulexServoInformationEvent?.Invoke(this, new HerkulexServoInformationArgs
     {
         Servo = servo
     });
 }
Exemplo n.º 2
0
 /// <summary>
 /// Error occured event
 /// </summary>
 /// <param name="servo"></param>
 public virtual void OnHerkulexError(Servo servo)
 {
     //Ne doit être appelé que si il y a une erreur
     HerkulexErrorEvent?.Invoke(this, new HerkulexManagerNS.HerkulexEventArgs.HerkulexErrorArgs
     {
         Servo = servo
     });
 }
Exemplo n.º 3
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);
        }