6. Impostazioni comuni del robot

6.1. Impostazione punti di riferimento utensile - Metodo a sei punti

1/**
2* @brief Imposta il punto di riferimento utensile - Metodo a sei punti
3* @param [in] point_num Numero del punto, intervallo [1~6]
4* @return Codice di errore
5*/
6int SetToolPoint(int point_num);

6.2. Calcolo sistema di coordinate utensile - Metodo a sei punti

1/**
2* @brief Calcola il sistema di coordinate utensile
3* @param [out] tcp_pose Sistema di coordinate utensile
4* @return Codice di errore
5*/
6int ComputeTool(DescPose tcp_pose);

6.3. Impostazione punti di riferimento utensile - Metodo a quattro punti

1/**
2* @brief Imposta il punto di riferimento utensile - Metodo a quattro punti
3* @param [in] point_num Numero del punto, intervallo [1~4]
4* @return Codice di errore
5*/
6int SetTcp4RefPoint(int point_num);

6.4. Calcolo sistema di coordinate utensile - Metodo a quattro punti

1/**
2* @brief Calcola il sistema di coordinate utensile
3* @param [out] tcp_pose Sistema di coordinate utensile
4* @return Codice di errore
5*/
6int ComputeTcp4(DescPose tcp_pose);

6.5. Calcolo sistema di coordinate utensile in base alle informazioni dei punti

1/**
2* @brief Calcola il sistema di coordinate utensile in base alle informazioni dei punti
3* @param [in] method Metodo di calcolo; 0-Metodo a quattro punti; 1-Metodo a sei punti
4* @param [in] pos Gruppo di posizioni articolari, lunghezza array 4 per metodo a 4 punti, 6 per metodo a 6 punti
5* @param [out] tool_pose Sistema di coordinate utensile in output
6* @return Codice di errore
7*/
8int ComputeToolCoordWithPoints(int method, JointPos[] pos,DescPose tool_pose);

6.6. Impostazione sistema di coordinate utensile

 1/**
 2* @brief Imposta il sistema di coordinate utensile
 3* @param [in] id Numero sistema di coordinate, intervallo [0~14]
 4* @param [in] coord  Posa del centro utensile rispetto al centro della flangia terminale
 5* @param [in] type  0-Sistema di coordinate utensile, 1-Sistema di coordinate sensore
 6* @param [in] install Posizione installazione, 0-Terminale robot, 1-Esterno robot
 7* @param [in] toolID  ID utensile
 8* @param [in] loadNum  Numero carico
 9* @return Codice di errore
10*/
11int SetToolCoord(int id, DescPose coord, int type, int install, int toolID, int loadNum);

6.7. Impostazione lista sistemi di coordinate utensile

 1/**
 2* @brief  Imposta la lista dei sistemi di coordinate utensile
 3* @param  [in] id Numero sistema di coordinate, intervallo [0~14]
 4* @param  [in] coord  Posa del centro utensile rispetto al centro della flangia terminale
 5* @param  [in] type  0-Sistema di coordinate utensile, 1-Sistema di coordinate sensore
 6* @param  [in] install Posizione installazione, 0-Terminale robot, 1-Esterno robot
 7* @param  [in] loadNum Numero carico
 8* @return  Codice di errore
 9*/
10int SetToolList(int id, DescPose coord, int type, int install, int loadNum);

6.8. Ottenimento sistema di coordinate utensile corrente

1/**
2* @brief  Ottiene il sistema di coordinate utensile corrente
3* @param  [in] flag 0-Bloccante, 1-Non bloccante
4* @param  [out] desc_pos Posa del sistema di coordinate utensile
5* @return  Codice di errore
6*/
7int GetTCPOffset(int flag, DescPose desc_pos);

6.9. Esempio di codice operazioni sistema di coordinate utensile robot

 1public static int TestTCPCompute(Robot robot)
 2{
 3    DescPose p1Desc=new DescPose(186.331, 487.913, 209.850, 149.030, 0.688, -114.347);
 4    JointPos p1Joint=new JointPos(-127.876, -75.341, 115.417, -122.741, -59.820, 74.300);
 5
 6    DescPose p2Desc=new DescPose(69.721, 535.073, 202.882, -144.406, -14.775, -89.012);
 7    JointPos p2Joint=new JointPos(-101.780, -69.828, 110.917, -125.740, -127.841, 74.300);
 8
 9    DescPose p3Desc=new DescPose(146.861, 578.426, 205.598, 175.997, -36.178, -93.437);
10    JointPos p3Joint=new JointPos(-112.851, -60.191, 86.566, -80.676, -97.463, 74.300);
11
12    DescPose p4Desc=new DescPose(136.284, 509.876, 225.613, 178.987, 1.372, -100.696);
13    JointPos p4Joint=new JointPos(-116.397, -76.281, 113.845, -128.611, -88.654, 74.299);
14
15    DescPose p5Desc=new DescPose(138.395, 505.972, 298.016, 179.134, 2.147, -101.110);
16    JointPos p5Joint=new JointPos(-116.814, -82.333, 109.162, -118.662, -88.585, 74.302);
17
18    DescPose p6Desc=new DescPose(105.553, 454.325, 232.017, -179.426, 0.444, -99.952);
19    JointPos p6Joint=new JointPos(-115.649, -84.367, 122.447, -128.663, -90.432, 74.303);
20
21    ExaxisPos exaxisPos=new ExaxisPos(0, 0, 0, 0);
22    DescPose offdese=new DescPose(0, 0, 0, 0, 0, 0);
23
24    JointPos[] posJ = { p1Joint , p2Joint , p3Joint , p4Joint , p5Joint , p6Joint };
25    DescPose coordRtn =new DescPose() {};
26    int rtn = robot.ComputeToolCoordWithPoints(1, posJ, coordRtn);
27
28    robot.MoveJ(p1Joint, p1Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
29    robot.SetToolPoint(1);
30    robot.MoveJ(p2Joint, p2Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
31    robot.SetToolPoint(2);
32    robot.MoveJ(p3Joint, p3Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
33    robot.SetToolPoint(3);
34    robot.MoveJ(p4Joint, p4Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
35    robot.SetToolPoint(4);
36    robot.MoveJ(p5Joint, p5Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
37    robot.SetToolPoint(5);
38    robot.MoveJ(p6Joint, p6Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
39    robot.SetToolPoint(6);
40    rtn = robot.ComputeTool(coordRtn);
41    robot.SetToolList(3, coordRtn, 0, 0, 0);
42
43    robot.MoveJ(p1Joint, p1Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
44    robot.SetTcp4RefPoint(1);
45    robot.MoveJ(p2Joint, p2Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
46    robot.SetTcp4RefPoint(2);
47    robot.MoveJ(p3Joint, p3Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
48    robot.SetTcp4RefPoint(3);
49    robot.MoveJ(p4Joint, p4Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
50    robot.SetTcp4RefPoint(4);
51    rtn = robot.ComputeTcp4(coordRtn);
52
53    robot.SetToolCoord(4, coordRtn, 0, 0, 1, 0);
54
55    DescPose getCoord = new DescPose(){};
56    rtn = robot.GetTCPOffset(0, getCoord);
57    return 0;
58}

6.10. Impostazione punti di riferimento utensile esterno - Metodo a sei punti

1/**
2* @brief Imposta il punto di riferimento utensile esterno - Metodo a tre punti
3* @param [in] point_num Numero del punto, intervallo [1~3]
4* @return Codice di errore
5*/
6int SetExTCPPoint(int point_num);

6.11. Calcolo sistema di coordinate utensile esterno - Metodo a sei punti

1/**
2* @brief Calcola il sistema di coordinate utensile esterno - Metodo a tre punti
3* @param [out] tcp_pose Sistema di coordinate utensile esterno
4* @return Codice di errore
5*/
6int ComputeExTCF(DescPose tcp_pose);

6.12. Impostazione sistema di coordinate utensile esterno

1/**
2* @brief Imposta il sistema di coordinate utensile esterno
3* @param [in] id Numero sistema di coordinate, intervallo [0~14]
4* @param [in] etcp  Posa del centro utensile rispetto al centro della flangia terminale
5* @param [in] etool  Da determinare
6* @return Codice di errore
7*/
8int SetExToolCoord(int id, DescPose etcp, DescPose etool);

6.13. Impostazione lista sistemi di coordinate utensile esterno

1/**
2* @brief  Imposta la lista dei sistemi di coordinate utensile esterno
3* @param  [in] id Numero sistema di coordinate, intervallo [0~14]
4* @param  [in] etcp  Posa del centro utensile rispetto al centro della flangia terminale
5* @param  [in] etool  Da determinare
6* @return  Codice di errore
7*/
8int SetExToolList(int id, DescPose etcp, DescPose etool);

6.14. Esempio di codice operazioni sistema di coordinate utensile esterno robot

 1public static int TestExtCoord(Robot robot)
 2{
 3    DescPose p1Desc=new DescPose(-89.606, 779.517, 193.516, 178.000, 0.476, -92.484);
 4    JointPos p1Joint=new JointPos(-108.145, -50.137, 85.818, -125.599, -87.946, 74.329);
 5
 6    DescPose p2Desc=new DescPose(-24.656, 850.384, 191.361, 177.079, -2.058, -95.355);
 7    JointPos p2Joint=new JointPos(-111.024, -41.538, 69.222, -114.913, -87.743, 74.329);
 8
 9    DescPose p3Desc=new DescPose(-99.813, 766.661, 241.878, -176.817, 1.917, -91.604);
10    JointPos p3Joint=new JointPos(-107.266, -56.116, 85.971, -122.560, -92.548, 74.331);
11
12    robot.GetForwardKin(p1Joint,p1Desc);
13    robot.GetForwardKin(p2Joint,p2Desc);
14    robot.GetForwardKin(p3Joint,p3Desc);
15
16    ExaxisPos exaxisPos=new ExaxisPos(0, 0, 0, 0);
17    DescPose offdese=new DescPose(0, 0, 0, 0, 0, 0);
18
19    DescPose[] posTCP = { p1Desc , p2Desc , p3Desc };
20    DescPose coordRtn = new DescPose();
21
22    robot.MoveJ(p1Joint, p1Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
23    robot.SetExTCPPoint(1);
24    robot.MoveJ(p2Joint, p2Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
25    robot.SetExTCPPoint(2);
26    robot.MoveJ(p3Joint, p3Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
27    robot.SetExTCPPoint(3);
28    int rtn = robot.ComputeExTCF(coordRtn);
29
30    robot.SetExToolCoord(1, coordRtn, offdese);
31    robot.SetExToolList(1, coordRtn, offdese);
32    return 0;
33}

6.15. Impostazione punti di riferimento sistema di coordinate pezzo - Metodo a tre punti

1/**
2* @brief Imposta il punto di riferimento pezzo - Metodo a tre punti
3* @param [in] point_num Numero del punto, intervallo [1~3]
4* @return Codice di errore
5*/
6int SetWObjCoordPoint(int point_num);

6.16. Calcolo sistema di coordinate pezzo

1/**
2* @brief Calcola il sistema di coordinate pezzo
3* @param [in]  method Metodo di calcolo 0: Origine-Asse X-Asse Z  1: Origine-Asse X-Piano XY
4* @param [in]  refFrame Sistema di coordinate di riferimento
5* @param [out]  wobj_pose Sistema di coordinate pezzo
6* @return Codice di errore
7*/
8int ComputeWObjCoord(int method, int refFrame, DescPose wobj_pose);

6.17. Impostazione sistema di coordinate pezzo

1/**
2* @brief  Imposta il sistema di coordinate pezzo
3* @param  [in] id Numero sistema di coordinate, intervallo [1~15]
4* @param  [in] coord  Posa del sistema di coordinate pezzo rispetto al centro della flangia terminale
5* @param  [in] refFrame Sistema di coordinate di riferimento
6* @return  Codice di errore
7*/
8int SetWObjCoord(int id, DescPose coord, int refFrame);

6.18. Impostazione lista sistemi di coordinate pezzo

1/**
2* @brief  Imposta la lista dei sistemi di coordinate pezzo
3* @param  [in] id Numero sistema di coordinate, intervallo [1~15]
4* @param  [in] coord  Posa del sistema di coordinate pezzo rispetto al centro della flangia terminale
5* @param  [in] refFrame Sistema di coordinate di riferimento
6* @return  Codice di errore
7*/
8int SetWObjList(int id, DescPose coord, int refFrame);

6.19. Calcolo sistema di coordinate pezzo in base alle informazioni dei punti

1/**
2* @brief Calcola il sistema di coordinate pezzo in base alle informazioni dei punti
3* @param [in] method Metodo di calcolo; 0: Origine-Asse X-Asse Z  1: Origine-Asse X-Piano XY
4* @param [in] pos Tre gruppi di posizioni TCP
5* @param [in] refFrame Sistema di coordinate di riferimento
6* @param [in] tcp_pose Sistema di coordinate pezzo in output
7* @return Codice di errore
8*/
9int ComputeWObjCoordWithPoints(int method, DescPose[] pos, int refFrame,DescPose tcp_pose);

6.20. Ottenimento sistema di coordinate pezzo corrente

1/**
2* @brief  Ottiene il sistema di coordinate pezzo corrente
3* @param  [in] flag 0-Bloccante, 1-Non bloccante
4* @param  [out] desc_pos Posa del sistema di coordinate pezzo
5* @return  Codice di errore
6*/
7int GetWObjOffset(int flag, DescPose desc_pos);

6.21. Esempio di codice operazioni sistema di coordinate pezzo robot

 1public static int TestWobjCoord(Robot robot)
 2{
 3    DescPose p1Desc=new DescPose(-89.606, 779.517, 193.516, 178.000, 0.476, -92.484);
 4    JointPos p1Joint=new JointPos(-108.145, -50.137, 85.818, -125.599, -87.946, 74.329);
 5
 6    DescPose p2Desc=new DescPose(-24.656, 850.384, 191.361, 177.079, -2.058, -95.355);
 7    JointPos p2Joint=new JointPos(-111.024, -41.538, 69.222, -114.913, -87.743, 74.329);
 8
 9    DescPose p3Desc=new DescPose(-99.813, 766.661, 241.878, -176.817, 1.917, -91.604);
10    JointPos p3Joint=new JointPos(-107.266, -56.116, 85.971, -122.560, -92.548, 74.331);
11
12    robot.GetForwardKin(p1Joint,p1Desc);
13    robot.GetForwardKin(p2Joint,p2Desc);
14    robot.GetForwardKin(p3Joint,p3Desc);
15
16    ExaxisPos exaxisPos=new ExaxisPos(0, 0, 0, 0);
17    DescPose offdese=new DescPose(0, 0, 0, 0, 0, 0);
18
19    DescPose[] posTCP =new DescPose[]{p1Desc , p2Desc , p3Desc };
20    DescPose coordRtn =new DescPose();
21    int rtn = robot.ComputeWObjCoordWithPoints(1, posTCP, 0, coordRtn);
22
23    robot.MoveJ(p1Joint, p1Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
24    robot.SetWObjCoordPoint(1);
25    robot.MoveJ(p2Joint, p2Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
26    robot.SetWObjCoordPoint(2);
27    robot.MoveJ(p3Joint, p3Desc, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
28    robot.SetWObjCoordPoint(3);
29    rtn = robot.ComputeWObjCoord(1, 0, coordRtn);
30
31    robot.SetWObjCoord(1, coordRtn, 0);
32    robot.SetWObjList(1, coordRtn, 0);
33
34    DescPose getWobjDesc = new DescPose();
35    rtn = robot.GetWObjOffset(0, getWobjDesc);
36    return 0;
37}

6.22. Impostazione velocità globale

1/**
2* @brief  Imposta la velocità globale
3* @param  [in]  vel  Percentuale velocità, intervallo [0~100]
4* @return  Codice di errore
5*/
6int SetSpeed(int vel);

6.23. Impostazione accelerazione robot

1/**
2* @brief Imposta l'accelerazione del robot
3* @param [in] acc Percentuale accelerazione robot
4* @return Codice di errore
5*/
6int SetOaccScale(double acc);

6.24. Ottenimento velocità predefinita robot

1/**
2* @brief  Ottiene la velocità predefinita del robot
3* @return  List[0]:int Codice errore; List[1]: double vel Velocità, unità mm/s
4*/
5List<Number> GetDefaultTransVel();

6.25. Impostazione peso carico terminale

1/**
2* @brief  Imposta il peso del carico terminale
3* @param  [in] loadNum Numero carico
4* @param  [in] weight  Peso carico, unità kg
5* @return  Codice di errore
6*/
7int SetLoadWeight(int loadNum,double weight);

6.26. Impostazione coordinate centro di massa carico terminale

1/**
2* @brief  Imposta le coordinate del centro di massa del carico terminale
3* @param  [in] coord Coordinate centro di massa, unità mm
4* @return  Codice di errore
5*/
6int SetLoadCoord(DescTran coord);

6.27. Impostazione coordinate centro di massa carico terminale

1/**
2 * @brief  Imposta le coordinate del centro di massa del carico terminale
3 * @param  [in] loadNum Numero carico
4 * @param  [in] coord Coordinate centro di massa, unità mm
5 * @return  Codice di errore
6 */
7public int SetLoadCoord(int loadNum, DescTran coord)

6.28. Ottenimento peso carico corrente

1/**
2* @brief  Ottiene il peso del carico corrente
3* @param  [in] flag 0-Bloccante, 1-Non bloccante
4* @return  List[0]:int Codice errore; List[1]: double weight  Peso carico, unità kg
5*/
6List<Number> GetTargetPayload(int flag);

6.29. Ottenimento centro di massa carico corrente

1/**
2* @brief  Ottiene il centro di massa del carico corrente
3* @param  [in] flag 0-Bloccante, 1-Non bloccante
4* @param  [out] cog Centro di massa carico, unità mm
5* @return  Codice di errore
6*/
7int GetTargetPayloadCog(int flag, DescTran cog);

6.30. Impostazione modalità installazione robot

1/**
2* @brief  Imposta la modalità di installazione del robot
3* @param  [in]  install  Modalità installazione, 0-Montaggio normale, 1-Montaggio laterale, 2-Montaggio a soffitto
4* @return  Codice di errore
5*/
6int SetRobotInstallPos(int install);

6.31. Impostazione angolo installazione robot

1/**
2* @brief  Imposta l'angolo di installazione del robot, installazione libera
3* @param  [in] yangle  Angolo inclinazione
4* @param  [in] zangle  Angolo rotazione
5* @return  Codice di errore
6*/
7int SetRobotInstallAngle(double yangle, double zangle);

6.32. Ottenimento angolo installazione robot

1/**
2* @brief  Ottiene l'angolo di installazione del robot
3* @return  List[0]:Codice errore; List[1]:double yangle Angolo inclinazione; List[2]:double zangle Angolo rotazione
4*/
5public List<Number> GetRobotInstallAngle()

6.33. Impostazione valore variabile di sistema

1/**
2* @brief  Imposta il valore della variabile di sistema
3* @param  [in]  id  Numero variabile, intervallo [1~20]
4* @param  [in]  value Valore variabile
5* @return  Codice di errore
6*/
7int SetSysVarValue(int id, double value);

6.34. Ottenimento valore variabile di sistema

1/**
2* @brief  Ottiene il valore della variabile di sistema
3* @param  [in] id Numero variabile di sistema, intervallo [1~20]
4* @return  List[0]:Codice errore; List[1]:double value Valore variabile di sistema
5*/
6List<Number> GetSysVarValue(int id);

6.35. Esempio di codice impostazioni comuni robot

 1public static int TestLoadInstall(Robot robot)
 2{
 3    for (int i = 1; i < 100; i++)
 4    {
 5        robot.SetSpeed(i);
 6        robot.SetOaccScale(i);
 7        robot.Sleep(30);
 8    }
 9
10    List<Number> defaultVel=new ArrayList<>();
11
12    defaultVel=robot.GetDefaultTransVel();
13    System.out.println("GetDefaultTransVel is:"+ defaultVel.get(1));
14
15    for (int i = 1; i < 21; i++)
16    {
17        robot.SetSysVarValue(i, i + 0.5);
18        robot.Sleep(100);
19    }
20
21    for (int i = 1; i < 21; i++)
22    {
23        float value = 0;
24        defaultVel=robot.GetSysVarValue(i);
25        System.out.println("sys value :"+i+", is :"+defaultVel.get(1));
26        robot.Sleep(100);
27    }
28
29    robot.SetLoadWeight(0, 2.5);
30
31    DescTran loadCoord = new DescTran();
32    loadCoord.x = 3.0;
33    loadCoord.y = 4.0;
34    loadCoord.z = 5.0;
35    robot.SetLoadCoord(loadCoord);
36
37    robot.Sleep(1000);
38
39    List<Number> getLoad = new ArrayList<>();
40
41    getLoad=robot.GetTargetPayload(0);
42
43    DescTran getLoadTran =new DescTran();
44    robot.GetTargetPayloadCog(0, getLoadTran);
45    System.out.println("get load is:"+getLoad.get(1)+", get load cog is: "+getLoadTran.x+","+getLoadTran.y+","+getLoadTran.z);
46
47    robot.SetRobotInstallPos(0);
48    robot.SetRobotInstallAngle(15.0, 25.0);
49
50    List<Number> angle=new ArrayList<>();
51    angle=robot.GetRobotInstallAngle();
52    System.out.println("GetRobotInstallAngle x:"+angle.get(1)+";  y:"+angle.get(2));
53
54    robot.CloseRPC();
55    return 0;
56}

6.36. Interruttore compensazione attrito giunti

1/**
2* @brief Interruttore compensazione attrito giunti
3* @param [in] state  0-Spegnimento, 1-Accensione
4* @return Codice di errore
5*/
6int FrictionCompensationOnOff(int state);

6.37. Impostazione coefficiente compensazione attrito giunti - Montaggio normale

1/**
2* @brief  Imposta il coefficiente di compensazione attrito giunti - Montaggio normale
3* @param  [in]  coeff Sei coefficienti compensazione giunti, intervallo [0~1]
4* @return  Codice di errore
5*/
6int SetFrictionValue_level(Object[] coeff);

6.38. Impostazione coefficiente compensazione attrito giunti - Montaggio laterale

1/**
2* @brief  Imposta il coefficiente di compensazione attrito giunti - Montaggio laterale
3* @param  [in]  coeff Sei coefficienti compensazione giunti, intervallo [0~1]
4* @return  Codice di errore
5*/
6int SetFrictionValue_wall(Object[] coeff);

6.39. Impostazione coefficiente compensazione attrito giunti - Montaggio a soffitto

1/**
2* @brief  Imposta il coefficiente di compensazione attrito giunti - Montaggio a soffitto
3* @param  [in]  coeff Sei coefficienti compensazione giunti, intervallo [0~1]
4* @return  Codice di errore
5*/
6int SetFrictionValue_ceiling(Object[] coeff);

6.40. Impostazione coefficiente compensazione attrito giunti - Installazione libera

1/**
2* @brief  Imposta il coefficiente di compensazione attrito giunti - Installazione libera
3* @param  [in]  coeff Sei coefficienti compensazione giunti, intervallo [0~1]
4* @return  Codice di errore
5*/
6int SetFrictionValue_freedom(Object[] coeff);

6.41. Esempio di codice impostazione compensazione attrito giunti robot

 1public static int TestFriction(Robot robot)
 2{
 3
 4    Object[] lcoeff = { 0.9,0.9,0.9,0.9,0.9,0.9 };
 5    Object[] wcoeff = { 0.4,0.4,0.4,0.4,0.4,0.4 };
 6    Object[] ccoeff = { 0.6,0.6,0.6,0.6,0.6,0.6 };
 7    Object[] fcoeff = { 0.5,0.5,0.5,0.5,0.5,0.5 };
 8
 9    int rtn = robot.FrictionCompensationOnOff(1);
10    System.out.println("FrictionCompensationOnOff rtn is:"+ rtn);
11
12    rtn = robot.SetFrictionValue_level(lcoeff);
13    System.out.println("SetFrictionValue_level rtn is:"+ rtn);
14
15    rtn = robot.SetFrictionValue_wall(wcoeff);
16    System.out.println("SetFrictionValue_wall rtn is:"+ rtn);
17
18    rtn = robot.SetFrictionValue_ceiling(ccoeff);
19    System.out.println("SetFrictionValue_ceiling rtn is:"+ rtn);
20
21    rtn = robot.SetFrictionValue_freedom(fcoeff);
22    System.out.println("SetFrictionValue_freedom rtn is:"+ rtn);
23
24    robot.CloseRPC();
25    return 0;
26}

6.42. Query codice errore robot

1/**
2 * @brief  Query codice errore robot
3 * @param  [out]  maincode  Codice errore principale
4 * @param  [out]  subcode   Codice errore secondario
5 * @return  Codice di errore
6 */
7int GetRobotErrorCode(int[] maincode, int[] subcode);

6.43. Cancellazione stato errore

1/**
2* @brief  Cancellazione stato errore
3* @return  Codice di errore
4*/
5int ResetAllError();

6.44. Esempio di codice ottenimento stato guasto robot e cancellazione errori

 1public static int TestGetError(Robot robot)
 2{
 3    int[] maincode={0}, subcode={0};
 4    robot.GetRobotErrorCode(maincode, subcode);
 5
 6    robot.ResetAllError();
 7
 8    robot.Sleep(1000);
 9
10    robot.GetRobotErrorCode(maincode, subcode);
11    return 0;
12}

6.45. Impostazione parametri monitoraggio temperatura e velocità ventilatore quadro controllo tensione larga

Nuovo nella versione Java: SDK-v1.0.6-3.8.3

1/**
2* @brief Imposta i parametri di monitoraggio temperatura e velocità ventilatore quadro controllo tensione larga
3* @param [in] enable 0-Disabilita monitoraggio; 1-Abilita monitoraggio
4* @param [in] period Periodo monitoraggio (s), intervallo 1-100
5* @return Codice di errore
6*/
7int SetWideBoxTempFanMonitorParam(int enable, int period);

6.46. Ottenimento parametri monitoraggio temperatura e velocità ventilatore quadro controllo tensione larga

Nuovo nella versione Java: SDK-v1.0.6-3.8.3

1/**
2* @brief Ottiene i parametri di monitoraggio temperatura e velocità ventilatore quadro controllo tensione larga
3* @return List[0]-Codice errore,List[1]-enable 0-Disabilita monitoraggio; 1-Abilita monitoraggio,List[2]-period Periodo monitoraggio (s), intervallo 1-100
4*/
5List<Number> GetWideBoxTempFanMonitorParam()

6.47. Esempio di codice ottenimento stato temperatura e corrente ventilatore quadro controllo tensione larga

 1public static void TestWideVoltageCtrlBoxtemp(Robot robot)
 2{
 3    robot.SetWideBoxTempFanMonitorParam(1, 2);
 4    List<Number> list=robot.GetWideBoxTempFanMonitorParam();
 5    System.out.println("GetWideBoxTempFanMonitorParam enable is:"+list.get(1)+", period is:"+list.get(2));
 6    ROBOT_STATE_PKG pkg=new ROBOT_STATE_PKG();
 7    for (int i = 0; i < 100; i++)
 8    {
 9        pkg=robot.GetRobotRealTimeState();
10        System.out.println("robot ctrl box temp is:"+pkg.wideVoltageCtrlBoxTemp+",fan current is:"+pkg.wideVoltageCtrlBoxFanCurrent);
11        robot.Sleep(100);
12    }
13
14    int rtn = robot.SetWideBoxTempFanMonitorParam(0, 2);
15
16    list=robot.GetWideBoxTempFanMonitorParam();
17    for (int i = 0; i < 100; i++)
18    {
19        pkg=robot.GetRobotRealTimeState();
20        System.out.println("robot ctrl box temp is:"+pkg.wideVoltageCtrlBoxTemp+" ,fan current is:"+pkg.wideVoltageCtrlBoxFanCurrent);
21        robot.Sleep(100);
22    }
23
24    robot.CloseRPC();
25    robot.Sleep(2000);
26    return 0;
27}

6.48. Impostazione punto calibrazione fuoco

Nuovo nella versione Java: SDK-v1.0.7-3.8.4

1/**
2* @brief Imposta il punto di calibrazione fuoco
3* @param [in] pointNum Numero punto calibrazione fuoco 1-8
4* @param [in] point    Coordinate punto calibrazione
5* @return Codice di errore
6*/
7int SetFocusCalibPoint(int pointNum, DescPose point)

6.49. Calcolo risultato calibrazione fuoco

Nuovo nella versione Java: SDK-v1.0.7-3.8.4

1/**
2* @brief Calcola il risultato della calibrazione fuoco
3* @param [in] pointNum  Numero punti calibrazione
4* @param [in] resultPos Risultato calibrazione XYZ
5* @param [out] accuracy  Errore accuratezza calibrazione
6* @return Codice di errore
7*/
8int ComputeFocusCalib(int pointNum, DescTran resultPos, double[] accuracy)

6.50. Avvio inseguimento fuoco

Nuovo nella versione Java: SDK-v1.0.7-3.8.4

 1/**
 2* @brief Avvia l'inseguimento fuoco
 3* @param [in] kp       Parametro proporzionale, default 50.0
 4* @param [in] kpredict Parametro feedforward, default 19.0
 5* @param [in] aMax     Limite massima accelerazione angolare, default 1440°/s^2
 6* @param [in] vMax     Limite massima velocità angolare, default 180°/s
 7* @param [in] type     Blocco direzione asse X (0-Vettore input riferimento; 1-Orizzontale; 2-Verticale)
 8* @return Codice di errore
 9*/
10int FocusStart(double kp, double kpredict, double aMax, double vMax, int type)

6.51. Arresto inseguimento fuoco

Nuovo nella versione Java: SDK-v1.0.7-3.8.4

1/**
2* @brief Arresta l'inseguimento fuoco
3* @return Codice di errore
4*/
5int FocusEnd()

6.52. Impostazione coordinate fuoco

Nuovo nella versione Java: SDK-v1.0.7-3.8.4

1/**
2* @brief Imposta le coordinate del fuoco
3* @param pos Coordinate fuoco XYZ
4* @return Codice di errore
5*/
6public int SetFocusPosition(DescTran pos)

6.53. Esempio di codice inseguimento fuoco

 1public static void TestFocus(Robot robot){
 2    DescPose p1Desc=new DescPose(186.331, 487.913, 209.850, 149.030, 0.688, -114.347);
 3    JointPos p1Joint = new JointPos(-127.876, -75.341, 115.417, -122.741, -59.820, 74.300);
 4
 5    DescPose p2Desc = new DescPose(69.721, 535.073, 202.882, -144.406, -14.775, -89.012);
 6    JointPos p2Joint = new JointPos(-101.780, -69.828, 110.917, -125.740, -127.841, 74.300);
 7
 8    DescPose p3Desc = new DescPose(146.861, 578.426, 205.598, 175.997, -36.178, -93.437);
 9    JointPos p3Joint = new JointPos(-112.851, -60.191, 86.566, -80.676, -97.463, 74.300);
10
11    DescPose p4Desc = new DescPose(136.284, 509.876, 225.613, 178.987, 1.372, -100.696);
12    JointPos p4Joint = new JointPos(-116.397, -76.281, 113.845, -128.611, -88.654, 74.299);
13
14    DescPose p5Desc = new DescPose(138.395, 505.972, 298.016, 179.134, 2.147, -101.110);
15    JointPos p5Joint = new JointPos(-116.814, -82.333, 109.162, -118.662, -88.585, 74.302);
16
17    DescPose p6Desc = new DescPose(105.553, 454.325, 232.017, -179.426, 0.444, -99.952);
18    JointPos p6Joint = new JointPos(-115.649, -84.367, 122.447, -128.663, -90.432, 74.303);
19
20    ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
21    DescPose offdese = new DescPose(0, 0, 100, 0, 0, 0);
22
23    robot.GetForwardKin(p1Joint, p1Desc);
24    robot.GetForwardKin(p2Joint,  p2Desc);
25    robot.GetForwardKin(p3Joint,  p3Desc);
26    robot.GetForwardKin(p4Joint,  p4Desc);
27    robot.GetForwardKin(p5Joint,  p5Desc);
28    robot.GetForwardKin(p6Joint,  p6Desc);
29
30    robot.MoveJ(p1Joint, p1Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
31    robot.SetTcp4RefPoint(1);
32    robot.MoveJ(p2Joint, p2Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
33    robot.SetTcp4RefPoint(2);
34    robot.MoveJ(p3Joint, p3Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
35    robot.SetTcp4RefPoint(3);
36    robot.MoveJ(p4Joint, p4Desc, 0, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
37    robot.SetTcp4RefPoint(4);
38
39    DescPose coordRtn = new DescPose(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
40    int rtn = robot.ComputeTcp4( coordRtn);
41
42    robot.SetToolCoord(1, coordRtn, 0, 0, 1, 0);
43
44    robot.GetForwardKin(p1Joint, p1Desc);
45    robot.GetForwardKin(p2Joint, p2Desc);
46    robot.GetForwardKin(p3Joint, p3Desc);
47
48    robot.SetFocusCalibPoint(1, p1Desc);
49    robot.SetFocusCalibPoint(2, p2Desc);
50    robot.SetFocusCalibPoint(3, p3Desc);
51
52    DescTran resultPos = new DescTran(0.0, 0.0, 0.0);
53    double[] accuracy = {0.0};
54    rtn = robot.ComputeFocusCalib(3,  resultPos,  accuracy);
55    rtn = robot.SetFocusPosition(resultPos);
56
57    robot.GetForwardKin(p5Joint,  p5Desc);
58    robot.GetForwardKin(p6Joint,  p6Desc);
59
60    robot.MoveL(p5Joint, p5Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese,0,100);
61    robot.MoveL(p6Joint, p6Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese,0,100);
62
63    robot.FocusStart(50, 19, 710, 90, 0);
64    robot.MoveL(p5Joint, p5Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese,0,100);
65    robot.MoveL(p6Joint, p6Desc, 1, 0, 10, 100, 100, -1, 0, exaxisPos, 0, 1, offdese,0,100);
66    robot.FocusEnd();
67}

6.54. Abilitazione funzione calibrazione sensibilità sensore coppia giunti

1/**
2* @brief Abilita la funzione di calibrazione sensibilità sensore coppia giunti
3* @param status 0-Disabilita; 1-Abilita
4* @return Codice di errore
5*/
6public int JointSensitivityEnable(int status)

6.55. Raccolta dati sensibilità sensore coppia giunti

1/**
2* @brief Raccolta dati sensibilità sensore coppia giunti
3* @return Codice di errore
4*/
5public int JointSensitivityCollect()

6.56. Ottenimento risultato calibrazione sensibilità sensore coppia giunti

1/**
2* @brief Ottiene il risultato della calibrazione sensibilità sensore coppia giunti
3* @param calibResult Sensibilità giunti j1~j6 [0-1]
4* @param linearityn Linearità giunti j1~j6 [0-1]
5* @return Codice di errore
6*/
7public int JointSensitivityCalibration(double calibResult[6], double linearity[6])

6.57. Ottenimento errore isteresi sensore coppia giunti

1/**
2* @brief Ottiene l'errore di isteresi del sensore coppia giunti
3* @param hysteresisError Errore isteresi giunti j1~j6
4* @return Codice di errore
5*/
6public int JointHysteresisError(double[] hysteresisError);

6.58. Ottenimento ripetibilità sensore coppia giunti

1/**
2* @brief Ottiene la ripetibilità del sensore coppia giunti
3* @param repeatability Ripetibilità sensore coppia giunti j1~j6
4* @return Codice di errore
5*/
6public int JointRepeatability(double[] repeatability);

6.59. Impostazione parametri sensore forza giunti

 1/**
 2* @brief Imposta i parametri del sensore forza giunti
 3* @param  Parametro obbligatorio M Coefficiente massa J1-J6[]
 4* @param  Parametro obbligatorio B Coefficiente smorzamento J1-J6[]
 5* @param  Parametro obbligatorio K Coefficiente rigidezza J1-J6[]
 6* @param  Parametro default threshold Soglia controllo forza, Nm
 7* @param  Parametro default sensitivity Sensibilità, Nm/V,[]
 8* @param  Parametro default setZeroFlag Flag abilitazione funzione; 0-Disabilita; 1-Abilita; 2-Registra zero posizione1; 3-Registra zero posizione2
 9* @return Codice di errore
10*/
11public int SetAdmittanceParams(double[] M, double[] B, double[] K, double[] threshold, double[] sensitivity, int setZeroFlag);

6.60. Esempio di codice calibrazione automatica sensibilità sensore coppia giunti

  1public static void TestSensitivityCalib(Robot robot)
  2{
  3    int rtn = robot.JointSensitivityEnable(0);
  4    rtn = robot.JointSensitivityEnable(1);
  5    System.out.printf("JointSensitivityEnable rtn is %d\n", rtn);
  6    JointPos curJPos = new JointPos();
  7    robot.GetActualJointPosDegree(curJPos);
  8    ExaxisPos epos = new ExaxisPos(0,0,0,0);
  9    DescPose offset_pos =new DescPose(0,0,0,0,0,0 );
 10    JointPos jointPos1 = new JointPos(curJPos.J1, 0, 0, -90, 0.02, curJPos.J6);
 11    DescPose descPos1 = new DescPose();
 12    robot.GetForwardKin(jointPos1, descPos1);
 13    robot.MoveJ(jointPos1, descPos1, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
 14    robot.Sleep(200);
 15    rtn = robot.JointSensitivityCollect();
 16    System.out.printf("JointSensitivityCollect 1 rtn is %d\n", rtn);
 17    robot.Sleep(100);
 18    JointPos jointPos2 =new JointPos( curJPos.J1, -30, 0, -90, 0.02, curJPos.J6 );
 19    DescPose descPos2 =new DescPose();
 20    robot.GetForwardKin(jointPos2, descPos2);
 21    robot.MoveJ(jointPos2, descPos2, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
 22    robot.Sleep(100);
 23    rtn = robot.JointSensitivityCollect();
 24    System.out.printf("JointSensitivityCollect 2 rtn is %d\n", rtn);
 25    robot.Sleep(100);
 26    JointPos jointPos3 = new JointPos( curJPos.J1, -60, 0, -90, 0.02, curJPos.J6 );
 27    DescPose descPos3 =new DescPose();
 28    robot.GetForwardKin(jointPos3, descPos3);
 29    robot.MoveJ(jointPos3, descPos3, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
 30    robot.Sleep(100);
 31    rtn = robot.JointSensitivityCollect();
 32    System.out.printf("JointSensitivityCollect 3 rtn is %d\n", rtn);
 33    robot.Sleep(100);
 34    JointPos jointPos4 = new JointPos(curJPos.J1, -90, 0, -90, 0.02, curJPos.J6);
 35    DescPose descPos4 = new DescPose();
 36    robot.GetForwardKin(jointPos4, descPos4);
 37    robot.MoveJ(jointPos4, descPos4, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
 38    robot.Sleep(100);
 39    rtn = robot.JointSensitivityCollect();
 40    System.out.printf("JointSensitivityCollect 4 rtn is %d\n", rtn);
 41    robot.Sleep(100);
 42    JointPos jointPos5 = new JointPos(curJPos.J1, -120, 0, -90, 0.02, curJPos.J6);
 43    DescPose descPos5 = new DescPose();
 44    robot.GetForwardKin(jointPos5, descPos5);
 45    robot.MoveJ(jointPos5, descPos5, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
 46    robot.Sleep(100);
 47    rtn = robot.JointSensitivityCollect();
 48    System.out.printf("JointSensitivityCollect 5 rtn is %d\n", rtn);
 49    robot.Sleep(100);
 50    JointPos jointPos6 = new JointPos(curJPos.J1, -150, 0, -90, 0.02, curJPos.J6);
 51    DescPose descPos6 = new DescPose();
 52    robot.GetForwardKin(jointPos6, descPos6);
 53    robot.MoveJ(jointPos6, descPos6, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
 54    robot.Sleep(100);
 55    rtn = robot.JointSensitivityCollect();
 56    System.out.printf("JointSensitivityCollect 6 rtn is %d\n", rtn);
 57    robot.Sleep(100);
 58    JointPos jointPos7 = new JointPos(curJPos.J1, -180, 0, -90, 0.02, curJPos.J6);
 59    DescPose descPos7 = new DescPose();
 60    robot.GetForwardKin(jointPos7, descPos7);
 61    robot.MoveJ(jointPos7, descPos7, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
 62    robot.Sleep(100);
 63    rtn = robot.JointSensitivityCollect();
 64    System.out.printf("JointSensitivityCollect 7 rtn is %d\n", rtn);
 65    robot.Sleep(100);
 66    //Corsa inversa
 67    robot.MoveJ(jointPos6, descPos6, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
 68    robot.Sleep(100);
 69    rtn = robot.JointSensitivityCollect();
 70    System.out.printf("JointSensitivityCollect 8 rtn is %d\n", rtn);
 71    robot.Sleep(100);
 72    robot.MoveJ(jointPos5, descPos5, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
 73    robot.Sleep(100);
 74    rtn = robot.JointSensitivityCollect();
 75    System.out.printf("JointSensitivityCollect 9 rtn is %d\n", rtn);
 76    robot.Sleep(100);
 77    robot.MoveJ(jointPos4, descPos4, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
 78    robot.Sleep(100);
 79    rtn = robot.JointSensitivityCollect();
 80    System.out.printf("JointSensitivityCollect 10 rtn is %d\n", rtn);
 81    robot.Sleep(100);
 82    robot.MoveJ(jointPos3, descPos3, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
 83    robot.Sleep(100);
 84    rtn = robot.JointSensitivityCollect();
 85    System.out.printf("JointSensitivityCollect 11 rtn is %d\n", rtn);
 86    robot.Sleep(100);
 87    robot.MoveJ(jointPos2, descPos2, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
 88    robot.Sleep(100);
 89    rtn = robot.JointSensitivityCollect();
 90    System.out.printf("JointSensitivityCollect 12 rtn is %d\n", rtn);
 91    robot.Sleep(100);
 92    robot.MoveJ(jointPos1, descPos1, 0, 0, 100, 100, 100, epos, -1, 0, offset_pos);
 93    robot.Sleep(200);
 94    rtn = robot.JointSensitivityCollect();
 95    System.out.printf("JointSensitivityCollect 13 rtn is %d\n", rtn);
 96    robot.Sleep(100);
 97    double[] calibResult =new double[6];
 98    double[] linearity = new double[6];
 99    rtn = robot.JointSensitivityCalibration(calibResult, linearity);
100    System.out.printf("JointSensitivityCalibration rtn is %d\n", rtn);
101    rtn = robot.JointSensitivityEnable(0);
102    System.out.printf("JointSensitivityEnable rtn is %d\n", rtn);
103    System.out.printf("jointSensor Calib result is %f %f %f %f %f %f\njointSensor linearity is %f %f %f %f %f %f\n",
104            calibResult[0], calibResult[1], calibResult[2],
105            calibResult[3], calibResult[4], calibResult[5],
106            linearity[0], linearity[1], linearity[2],
107            linearity[3], linearity[4], linearity[5]);
108    double[] hysteresisError = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
109    rtn = robot.JointHysteresisError(hysteresisError);
110    System.out.printf("JointHysteresisError result is %f %f %f %f %f %f\n",
111            hysteresisError[0], hysteresisError[1], hysteresisError[2],
112            hysteresisError[3], hysteresisError[4], hysteresisError[5]);
113    double[] repeatability = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
114    rtn = robot.JointRepeatability(repeatability);
115    System.out.printf("JointRepeatability result is %f %f %f %f %f %f\n",
116            repeatability[0], repeatability[1], repeatability[2],
117            repeatability[3], repeatability[4], repeatability[5]);
118    double[] M = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
119    double[] B = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
120    double[] K = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
121    double[] threshold = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
122    int setZeroFlag = 1;
123    rtn = robot.SetAdmittanceParams(M, B, K, threshold, calibResult, setZeroFlag);
124    System.out.printf("SetAdmittanceParams rtn is %d\n", rtn);
125}

6.61. Ottenimento conteggio frame errore 8 porte slave robot

 1/**
 2* @brief Ottiene il conteggio frame errore 8 porte slave robot
 3* @param  inRecvErr Conteggio frame errore ricezione input
 4* @param  inCRCErr Conteggio frame errore CRC input
 5* @param  inTransmitErr Conteggio frame errore trasmissione input
 6* @param  inLinkErr Conteggio frame errore collegamento input
 7* @param  outRecvErr Conteggio frame errore ricezione output
 8* @param  outCRCErr Conteggio frame errore CRC output
 9* @param  outTransmitErr Conteggio frame errore trasmissione output
10* @param  outLinkErr Conteggio frame errore collegamento output
11* @return Codice di errore
12*/
13public int GetSlavePortErrCounter(int[] inRecvErr, int[] inCRCErr, int[] inTransmitErr, int[] inLinkErr, int[] outRecvErr, int[] outCRCErr, int[] outTransmitErr, int[] outLinkErr)

6.62. Azzera conteggio frame errore porte slave

1/**
2* @brief Azzera il conteggio frame errore porte slave
3* @param slaveID Numero slave 0~7
4* @return Codice di errore
5*/
6public int SlavePortErrCounterClear(int slaveID)

6.63. Esempio di codice ottenimento conteggio frame errore porte slave

 1public static void TestSlavePortErr(Robot robot)
 2{
 3    ROBOT_STATE_PKG pkg =new ROBOT_STATE_PKG();
 4    int[] inRecvErr =new int[8];
 5    int[] inCRCErr =new int[8];
 6    int[] inTransmitErr =new int[8];
 7    int[] inLinkErr =new int[8];
 8    int[] outRecvErr =new int[8];
 9    int[] outCRCErr =new int[8];
10    int[] outTransmitErr =new int[8];
11    int[] outLinkErr =new int[8];
12    robot.GetSlavePortErrCounter(inRecvErr,  inCRCErr, inTransmitErr, inLinkErr,
13            outRecvErr, outCRCErr, outTransmitErr, outLinkErr);
14    for (int i = 0; i < 8; i++)
15    {
16        if (inRecvErr[i] != 0)
17        {
18            System.out.printf("inRecvErr %d is %d\n", i, inRecvErr[i]);
19        }
20        if (inCRCErr[i] != 0)
21        {
22            System.out.printf("inRecvErr %d is %d\n", i, inCRCErr[i]);
23        }
24        if (inTransmitErr[i] != 0)
25        {
26            System.out.printf("inRecvErr %d is %d\n", i, inTransmitErr[i]);
27        }
28        if (inLinkErr[i] != 0)
29        {
30            System.out.printf("inRecvErr %d is %d\n", i, inLinkErr[i]);
31        }
32        if (outRecvErr[i] != 0)
33        {
34            System.out.printf("outRecvErr %d is %d\n", i, outRecvErr[i]);
35        }
36        if (outCRCErr[i] != 0)
37        {
38            System.out.printf("outCRCErr %d is %d\n", i, outCRCErr[i]);
39        }
40        if (outTransmitErr[i] != 0)
41        {
42            System.out.printf("outTransmitErr %d is %d\n", i, outTransmitErr[i]);
43        }
44        if (outLinkErr[i] != 0)
45        {
46            System.out.printf("outLinkErr %d is %d\n", i, outLinkErr[i]);
47        }
48    }
49    System.out.printf("others has no err!\n");
50    for (int i = 0; i < 8; i++)
51    {
52        robot.SlavePortErrCounterClear(i);
53    }
54    robot.CloseRPC();
55}

6.64. Impostazione coefficiente feedforward velocità assi

1/**
2* @brief Imposta il coefficiente feedforward velocità assi
3* @param  radio Coefficiente feedforward velocità assi
4* @return Codice di errore
5*/
6public int SetVelFeedForwardRatio(double[] radio)

6.65. Ottenimento coefficiente feedforward velocità assi

1/**
2* @brief Ottiene il coefficiente feedforward velocità assi
3* @param  radio Coefficiente feedforward velocità assi
4* @return Codice di errore
5*/
6public int GetVelFeedForwardRatio(double[] radio)

6.66. Esempio di codice coefficiente feedforward velocità robot

1public static void TestVelFeedForwardRatio(Robot robot)
2{
3    double[] setRadio =new double[] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
4    robot.SetVelFeedForwardRatio(setRadio);
5    double[] getRadio = new double[]{ 0.0 };
6    robot.GetVelFeedForwardRatio(getRadio);
7    System.out.printf(" %f %f %f %f %f %f\n", getRadio[0], getRadio[1], getRadio[2], getRadio[3], getRadio[4], getRadio[5]);
8    robot.CloseRPC();
9}

6.67. Calibrazione TCP Sensore Fotoelettrico - Calcola RPY Utensile

 1/**
 2* @brief Calibrazione TCP sensore fotoelettrico - calcola RPY utensile
 3* @param  Btool Posizione cartesiana robot
 4* @param  Etool Valore coefficiente sistema coordinate utensile corrente
 5* @param  sensor Valore coefficiente sistema coordinate sensore corrente (non ancora disponibile)
 6* @param  radius Raggio movimento circolare mm (non ancora disponibile)
 7* @param  dz Distanza movimento lungo la direzione negativa dell'asse Z del sistema di coordinate base; quando dz = 10000, la funzione restituisce direttamente RPY utensile
 8* @param  TCPRPY Valore RPY utensile
 9* @return Codice errore
10*/
11public int TCPComputeRPY(DescPose Btool, DescPose Etool, DescPose sensor, double radius, double dz, Rpy TCPRPY)

6.68. Calibrazione TCP Sensore Fotoelettrico - Calcola XYZ Utensile

 1/**
 2* @brief Calibrazione TCP sensore fotoelettrico - calcola XYZ utensile
 3* @param  select 0-Calcola TCP utensile; 1-Calcola origine sensore; 2-Calcola orientamento sensore; 3-Restituisce direttamente TCP utensile; 4-Registra sistema coordinate pezzo e sistema coordinate utensile corrente
 4* @param  originDirection 0-Direzione X; 1-Direzione Y; 2-Direzione Z
 5* @param  pos1 Posizione cartesiana robot 1
 6* @param  pos2 Posizione cartesiana robot 2
 7* @param  pos3 Posizione cartesiana robot 3
 8* @param  pos4 Posizione cartesiana robot 4
 9* @param  TCP Valore XYZ utensile
10* @return Codice errore
11*/
12public int TCPComputeXYZ(int select, double originDirection, DescTran pos1, DescTran pos2, DescTran pos3, DescTran pos4, DescTran TCP)

6.69. Calibrazione TCP Sensore Fotoelettrico - Inizia Registrazione Posizione Centro Flangia

1/**
2* @brief Calibrazione TCP sensore fotoelettrico - inizia registrazione posizione centro flangia
3* @return Codice errore
4*/
5public int TCPRecordFlangePosStart()

6.70. Calibrazione TCP Sensore Fotoelettrico - Interrompi Registrazione Posizione Centro Flangia

1/**
2* @brief Calibrazione TCP sensore fotoelettrico - interrompi registrazione posizione centro flangia
3* @return Codice errore
4*/
5public int TCPRecordFlangePosEnd()

6.71. Calibrazione TCP Sensore Fotoelettrico - Ottieni Posizione Punto Centro Utensile

1/**
2* @brief Calibrazione TCP sensore fotoelettrico - ottieni posizione punto centro utensile
3* @param  TCP Posizione punto centro utensile (x,y,z)
4* @return Codice errore
5*/
6public int TCPGetRecordFlangePos(DescTran TCP)

6.72. Calibrazione TCP Sensore Fotoelettrico

1/**
2* @brief Calibrazione TCP sensore fotoelettrico
3* @param luaPath Percorso programma Lua calibrazione automatica: robot versione QX - "/fruser/FR_CalibrateTheToolTcp.lua"; robot versione LA - "/usr/local/etc/controller/lua/FR_CalibrateTheToolTcp.lua"
4* @param offset Offset punto di insegnamento (x,y,z) mm
5* @param TCP Sistema coordinate utensile calibrato (x,y,z,rx,ry,rz)
6* @return Codice errore
7*/
8public int PhotoelectricSensorTCPCalibration(String luaPath, DescTran offset, DescPose TCP)

6.73. Esempio Codice Calibrazione TCP Sensore Fotoelettrico

1public static void TestPhotoelectricSensorTCPCalib(Robot robot)
2{
3    DescTran offset = new DescTran(10.0, 10.0, 3.0 );
4    DescPose TCP = new DescPose();
5    int rtn = robot.PhotoelectricSensorTCPCalibration("/fruser/FR_CalibrateTheToolTcp.lua", offset, TCP);
6    System.out.printf("PhotoelectricSensorTCPCalibration rtn is %d %f %f %f %f %f %f \n", rtn, TCP.tran.x, TCP.tran.y, TCP.tran.z, TCP.rpy.rx, TCP.rpy.ry, TCP.rpy.rz);
7    robot.CloseRPC();
8    robot.Sleep(9999999);
9}