// Use this for initialization void Start() { initializeJoints(); RoboDK RDK = new RoboDK(); ROBOT = RDK.ItemUserPick("Select a robot", RoboDK.ITEM_TYPE_ROBOT); RDK.setRunMode(RoboDK.RUNMODE_SIMULATE); ROBOT.MoveJ(home_joints); Mat frame = ROBOT.PoseFrame(); //Mat tool = Variables.ROBOT.PoseTool(); Mat pose_ref = ROBOT.Pose(); target_pose = ROBOT.Pose(); xyz_ref = target_pose.Pos(); ROBOT.MoveJ(pose_ref); ROBOT.setPoseFrame(frame); //Variables.ROBOT.setPoseTool(tool); ROBOT.setSpeed(500); ROBOT.setZoneData(5); //Setting inial right controller 3D position VR_Init_Pos[0] = Right_Controller.transform.position.z; VR_Init_Pos[1] = Right_Controller.transform.position.x; VR_Init_Pos[2] = Right_Controller.transform.position.y; //Debug.Log(VR_Init_Pos[0] + " " + VR_Init_Pos[1] + " " + VR_Init_Pos[2]); }
int Factor_LM = 400; //400 void Start() { RoboDK RDK = new RoboDK(); Variables.ROBOT = RDK.ItemUserPick("Select a robot", RoboDK.ITEM_TYPE_ROBOT); // if (Variables.ROBOT.Connect()) // { // RDK.setRunMode(RoboDK.RUNMODE_RUN_ROBOT); // } // else // { // RDK.setRunMode(RoboDK.RUNMODE_SIMULATE); // } RDK.setRunMode(RoboDK.RUNMODE_SIMULATE); //Variables.ROBOT.MoveJ(home_joints); Mat frame = Variables.ROBOT.PoseFrame(); //Mat tool = Variables.ROBOT.PoseTool(); Mat pose_ref = Variables.ROBOT.Pose(); Variables.target_pose = Variables.ROBOT.Pose(); Variables.xyz_ref = Variables.target_pose.Pos(); Variables.ROBOT.MoveJ(pose_ref); Variables.ROBOT.setPoseFrame(frame); // set the reference frame //Variables.ROBOT.setPoseTool(tool); // set the tool frame: important for Online Programming Variables.ROBOT.setSpeed(500); // Set Speed to 100 mm/s Variables.ROBOT.setZoneData(5); // set the rounding instruction //Variables.ROBOT.MoveL(pose_ref); }