//send trajectory to jaco
 public string sendTraj()
 {
     try
     {
         if (Jaco.JacoIsReady())
         {
             TrajClear();
             m_PointsTrajectory.Add(pointTraj);
             Jaco.ControlManager.SendBasicTrajectory(m_PointsTrajectory);
             //Delay(pointTraj, Jaco);
             Logger.addLog("Trajectory Completed (Angles set)");
             return("Angle set");
         }
         else
         {
             Logger.addLog("Jaco not ready - unable to send trajectory", true);
             return("Jaco not ready - unable to send trajectory");
         }
     }
     catch (Exception)
     {
         Logger.addLog("Error in updating trajectory", true);
         return("Error in updating trajectory");
     }
 }
Esempio n. 2
0
        public JacoArm(string key)
        {
            m_IsEnabled = false;
            m_State     = new JacoArmState();
            m_Cmd       = new CJoystickValue();

            try
            {
                CCypherMessage pass = Crypto.GetInstance().Encrypt(key);
                m_Arm = new CJacoArm(pass);


                Console.WriteLine("Wrapper initialized.");
                if (m_Arm.JacoIsReady())
                {
                    m_Arm.ControlManager.StartControlAPI();
                    // Init sequence, place the arm in READY position.
                    InitSequence();

                    Console.WriteLine("The arm is ready.");
                    m_IsEnabled = true;
                }
                else
                {
                    Console.WriteLine("The arm is not ready!");
                    m_IsEnabled = false;
                }
            } catch (Exception e)
            {
                System.Console.WriteLine(
                    "JACO API initialisation failed. Reason: ");
                System.Console.WriteLine(e.ToString());
                m_IsEnabled = false;
            }

            // 200 ms delay.
            m_WatchDogDelay = new TimeSpan(0, 0, 0, 0, 200);
        }
    public CJacoArm init()
    {
        const string MyValidPassword = "******";

        pointTraj = new CTrajectoryInfo();

        try
        {
            Jaco = new CJacoArm(Crypto.GetInstance().Encrypt(MyValidPassword));
            Jaco.ControlManager.StartControlAPI();
        }
        catch (Exception ex)
        {
            Logger.addLog("Error initializing Jaco!\n" + ex.Message, true);
            return(Jaco);
        }

        if (Jaco.JacoIsReady())
        {
            CClientConfigurations config = new CClientConfigurations();

            config.ClientName      = "Arup";
            config.MaxAngularSpeed = 0.2f;
            config.Organization    = "SV";
            Jaco.ConfigurationsManager.SetClientConfigurations(config);

            Jaco.ControlManager.EraseTrajectories();

            Logger.addLog("Jaco initialized and ready");
            return(Jaco);
        }
        else
        {
            Logger.addLog("Jaco initialized but not ready", true);
            return(Jaco);
        }
    }
        public JacoArm(string key)
        {
            m_IsEnabled = false;
            m_State = new JacoArmState();
            m_Cmd = new CJoystickValue();

            try
            {
                CCypherMessage pass = Crypto.GetInstance().Encrypt(key);
                m_Arm = new CJacoArm(pass);

                Console.WriteLine("Wrapper initialized.");
                if (m_Arm.JacoIsReady())
                {
                    m_Arm.ControlManager.StartControlAPI();
                    // Init sequence, place the arm in READY position.
                    InitSequence();

                    Console.WriteLine("The arm is ready.");
                    m_IsEnabled = true;
                }
                else
                {
                    Console.WriteLine("The arm is not ready!");
                    m_IsEnabled = false;
                }
            } catch (Exception e)
            {
                System.Console.WriteLine(
                    "JACO API initialisation failed. Reason: ");
                System.Console.WriteLine(e.ToString());
                m_IsEnabled = false;
            }

            // 200 ms delay.
            m_WatchDogDelay = new TimeSpan(0,0,0,0,200);
        }