static void Main(string[] args) { Program AllFunctions = new Program(); //connect to server AllFunctions.ConnectToServer(); /* ********************************************************** */ //Please Write Code Below /* ********************************************************** */ PTPJointParams ptpJointParams = new PTPJointParams(); JOGCmd jogCmd = new JOGCmd(); PTPCoordinateParams ptpCoordinateParams = new PTPCoordinateParams(); PTPCmd ptpCmd = new PTPCmd(); //Set up the velocity of inverse kinematics ptpCoordinateParams.xyzVelocity = 100; SetPTPCoordinateParams(ptpCoordinateParams); //Set up the velocity of forward kinematics ptpJointParams.velocity[0] = 50F; ptpJointParams.velocity[1] = 50F; ptpJointParams.velocity[2] = 50F; SetPTPJointParams(ptpJointParams); //Use inverse kinematics, move to coordinate(-270, 140, 95) ptpCmd.ptpMode = 1; ptpCmd.x = -270F; ptpCmd.y = 140F; ptpCmd.z = 95F; SetPTPCmd(ptpCmd); //Turn on the suction cup SetEndEffectorSuctionCup(true); //Use forward kinematics, move to coordinate(130, 45, 56.9) ptpCmd.ptpMode = 3; ptpCmd.x = 130F; ptpCmd.y = 45F; ptpCmd.z = 56.9F; SetPTPCmd(ptpCmd); //Turn off the suction cup and release the object SetEndEffectorSuctionCup(false); /* ********************************************************** */ //Please Write Code Above /* ********************************************************** */ Console.WriteLine("Program End"); }
//ID 73, SetJOGCmd static void SetJOGCmd(JOGCmd jogCmd) { Program AllFunctions = new Program(); AllFunctions.ConnectToServer(); byte[] DATA_TO_SEND = new byte[8]; //info of the functon Message message = new Message(); // set ID 80 INFO message.id = 73; message.rw = 1; message.isQueued = 0; message.paramsLen = 4; //Start set functions //Header DATA_TO_SEND[0] = 170; //0xAA DATA_TO_SEND[1] = 170; //0xAA // Params DATA_TO_SEND[2] = message.paramsLen; //Len DATA_TO_SEND[3] = message.id; //ID DATA_TO_SEND[4] = 0; //Ctrl DATA_TO_SEND[5] = jogCmd.isJoint; //ID DATA_TO_SEND[6] = jogCmd.cmd; //Ctrl DATA_TO_SEND[7] = message.paramsLen; //Send instruction string hexString = string.Empty; hexString = ToHexString(DATA_TO_SEND); AllFunctions.Send(hexString); }