16. Altre Interfacce

16.1. Ottenere la chiave pubblica SSH

1/**
2* @brief Ottiene la chiave pubblica SSH
3* @param [out] keygen Chiave pubblica
4* @return Codice di errore
5*/
6errno_t GetSSHKeygen(char keygen[1024]);

16.2. Inviare comando SCP

 1/**
 2* @brief Invia comando SCP
 3* @param [in] mode 0-Upload (computer->controller), 1-Download (controller->computer)
 4* @param [in] sshname Nome utente computer
 5* @param [in] sship Indirizzo IP computer
 6* @param [in] usr_file_url Percorso file computer
 7* @param [in] robot_file_url Percorso file controller robot
 8* @return Codice di errore
 9*/
10errno_t SetSSHScpCmd(int mode, char sshname[32], char sship[32], char usr_file_url[128], char robot_file_url[128]);

16.3. Calcolare il valore MD5 del file nel percorso specificato

1/**
2* @brief Calcola il valore MD5 del file nel percorso specificato
3* @param [in] file_path Percorso file incluso nome file, percorso cartella Traj predefinito: "/fruser/traj/", es. "/fruser/traj/trajHelix_aima_1.txt"
4* @param [out] md5 Valore MD5 file
5* @return Codice di errore
6*/
7errno_t ComputeFileMD5(char file_path[256], char md5[256]);

16.4. Esempio di codice per comandi SSH e MD5 del robot

 1int TestSSHMd5(void)
 2{
 3  ROBOT_STATE_PKG pkg = {};
 4  FRRobot robot;
 5  robot.LoggerInit();
 6  robot.SetLoggerLevel(1);
 7  int rtn = robot.RPC("192.168.58.2");
 8  if (rtn != 0)
 9  {
10    return -1;
11  }
12  robot.SetReConnectParam(true, 30000, 500);
13  char file_path[256] = "/fruser/airlab.lua";
14  char md5[256] = { 0 };
15  uint8_t emerg_state = 0;
16  uint8_t si0_state = 0;
17  uint8_t si1_state = 0;
18  int sdk_com_state = 0;
19  char ssh_keygen[1024] = { 0 };
20  int retval = robot.GetSSHKeygen(ssh_keygen);
21  printf("GetSSHKeygen retval is: %d\n", retval);
22  printf("ssh key is: %s \n", ssh_keygen);
23  char ssh_name[32] = "fr";
24  char ssh_ip[32] = "192.168.58.45";
25  char ssh_route[128] = "/home/fr";
26  char ssh_robot_url[128] = "/root/robot/dhpara.config";
27  retval = robot.SetSSHScpCmd(1, ssh_name, ssh_ip, ssh_route, ssh_robot_url);
28  printf("SetSSHScpCmd retval is: %d\n", retval);
29  printf("robot url is: %s\n", ssh_robot_url);
30  robot.ComputeFileMD5(file_path, md5);
31  printf("md5 is: %s \n", md5);
32  robot.CloseRPC();
33  return 0;
34}

16.5. Impostare il periodo di feedback della porta 20004 del robot

Nuovo nella versione C++SDK-v2.1.5.0.

1/**
2* @brief Imposta il periodo di feedback della porta 20004 del robot
3* @param [in] period Periodo di feedback porta 20004 del robot (ms)
4* @return Codice di errore
5*/
6errno_t SetRobotRealtimeStateSamplePeriod(int period);

16.6. Ottenere il periodo di feedback della porta 20004 del robot

Nuovo nella versione C++SDK-v2.1.5.0.

1/**
2* @brief Ottiene il periodo di feedback della porta 20004 del robot
3* @param [out] period Periodo di feedback porta 20004 del robot (ms)
4* @return Codice di errore
5*/
6errno_t GetRobotRealtimeStateSamplePeriod(int& period);

16.7. Esempio di codice per configurazione periodo feedback stato in tempo reale porta 20004 robot

 1int TestRealtimePeriod(void)
 2{
 3  ROBOT_STATE_PKG pkg = {};
 4  FRRobot robot;
 5  robot.LoggerInit();
 6  robot.SetLoggerLevel(1);
 7  int rtn = robot.RPC("192.168.58.2");
 8  if (rtn != 0)
 9  {
10    return -1;
11  }
12  robot.SetReConnectParam(true, 30000, 500);
13  robot.SetRobotRealtimeStateSamplePeriod(10);
14  int getPeriod = 0;
15  robot.GetRobotRealtimeStateSamplePeriod(getPeriod);
16  cout << "period is " << getPeriod << endl;
17  robot.Sleep(1000);
18  robot.CloseRPC();
19  return 0;
20}

16.8. Aggiornamento software del robot

Nuovo nella versione C++SDK-v2.1.5.0.

1/**
2* @brief Aggiornamento software del robot
3* @param [in] filePath Percorso completo pacchetto aggiornamento software
4* @param [in] block Se bloccare fino al completamento aggiornamento true: bloccante; false: non bloccante
5* @return Codice di errore
6*/
7errno_t SoftwareUpgrade(std::string filePath, bool block);

16.9. Ottenere lo stato dell’aggiornamento software del robot

Nuovo nella versione C++SDK-v2.1.5.0.

1/**
2* @brief Ottiene lo stato dell'aggiornamento software del robot
3* @param [out] state Stato aggiornamento pacchetto software robot (0-Inattivo o caricamento pacchetto aggiornamento; 1~100: percentuale completamento aggiornamento; -1: aggiornamento software fallito; -2: verifica fallita; -3: verifica versione fallita; -4: decompressione fallita; -5: aggiornamento configurazione utente fallito; -6: aggiornamento configurazione periferiche fallito; -7: aggiornamento configurazione assi estesi fallito; -8: aggiornamento configurazione robot fallito; -9: aggiornamento parametri DH fallito)
4* @return Codice di errore
5*/
6errno_t GetSoftwareUpgradeState(int &state);

16.10. Esempio di codice per aggiornamento software robot

 1int TestUpgrade(void)
 2{
 3  ROBOT_STATE_PKG pkg = {};
 4  FRRobot robot;
 5  robot.LoggerInit();
 6  robot.SetLoggerLevel(3);
 7  int rtn = robot.RPC("192.168.58.2");
 8  if (rtn != 0)
 9  {
10    return -1;
11  }
12  robot.SetReConnectParam(true, 30000, 500);
13  robot.SoftwareUpgrade("D://zUP/QNX/software.tar.gz", false);
14  while (true)
15  {
16    int curState = -1;
17    robot.GetSoftwareUpgradeState(curState);
18    printf("upgrade state is %d\n", curState);
19    robot.Sleep(300);
20  }
21  robot.CloseRPC();
22  return 0;
23}

16.11. Download database tabella punti

Nuovo nella versione C++SDK-v2.1.1.0.

1/**
2* @brief Download database tabella punti
3* @param [in] pointTableName Nome tabella punti da scaricare    pointTable1.db
4* @param [in] saveFilePath Percorso di salvataggio tabella punti scaricata   C://test/
5* @return Codice di errore
6*/
7errno_t PointTableDownLoad(const std::string &pointTableName, const std::string &saveFilePath);

16.12. Upload database tabella punti

Nuovo nella versione C++SDK-v2.1.1.0.

1/**
2* @brief Upload database tabella punti
3* @param [in] pointTableFilePath Nome percorso completo tabella punti da caricare   C://test/pointTable1.db
4* @return Codice di errore
5*/
6errno_t PointTableUpLoad(const std::string &pointTableFilePath);

16.13. Aggiornamento file Lua tabella punti

Nuovo nella versione C++SDK-v2.1.1.0.

1/**
2* @brief Aggiornamento file Lua tabella punti
3* @param [in] pointTableName Nome tabella punti da attivare   "pointTable1.db", quando la tabella punti è vuota, cioè "", significa aggiornare il programma Lua al programma iniziale senza tabella punti applicata
4* @param [in] luaFileName Nome file Lua da aggiornare   "testPointTable.lua"
5* @param [out] errorStr Informazioni errore attivazione tabella punti
6* @return Codice di errore
7*/
8errno_t PointTableUpdateLua(const std::string &pointTableName, const std::string &luaFileName);

16.14. Esempio di codice per operazioni tabella punti robot

 1int TestPointTable(void)
 2{
 3  ROBOT_STATE_PKG pkg = {};
 4  FRRobot robot;
 5  robot.LoggerInit();
 6  robot.SetLoggerLevel(1);
 7  int rtn = robot.RPC("192.168.58.2");
 8  if (rtn != 0)
 9  {
10    return -1;
11  }
12  robot.SetReConnectParam(true, 30000, 500);
13  string save_path = "D://zDOWN/";
14  string point_table_name = "point_table_FR5.db";
15  rtn = robot.PointTableDownLoad(point_table_name, save_path);
16  cout << "download : " << point_table_name << " fail: " << rtn << endl;
17  string upload_path = "D://zUP/point_table_FR5.db";
18  rtn = robot.PointTableUpLoad(upload_path);
19  cout << "retval is: " << rtn << endl;
20  string point_tablename = "point_table_FR5.db";
21  string lua_name = "airlab.lua";
22  rtn = robot.PointTableUpdateLua(point_tablename, lua_name);
23  cout << "retval is: " << rtn << endl;
24  robot.CloseRPC();
25  return 0;
26}

16.15. Download log controller

Nuovo nella versione C++SDK-v2.2.1-3.8.1.

1/**
2* @brief Download log controller
3* @param [in] savePath Percorso salvataggio file "D://zDown/"
4* @return Codice di errore
5*/
6errno_t RbLogDownload(std::string savePath);

16.16. Download tutte le sorgenti dati

Nuovo nella versione C++SDK-v2.2.1-3.8.1.

1/**
2* @brief Download tutte le sorgenti dati
3* @param [in] savePath Percorso salvataggio file "D://zDown/"
4* @return Codice di errore
5*/
6errno_t AllDataSourceDownload(std::string savePath);

16.17. Download pacchetto backup dati

Nuovo nella versione C++SDK-v2.2.1-3.8.1.

1/**
2* @brief Download pacchetto backup dati
3* @param [in] savePath Percorso salvataggio file "D://zDown/"
4* @return Codice di errore
5*/
6errno_t DataPackageDownload(std::string savePath);

16.18. Esempio di codice per download dati controller

 1int TestDownLoadRobotData(void)
 2{
 3  ROBOT_STATE_PKG pkg = {};
 4  FRRobot robot;
 5  robot.LoggerInit();
 6  robot.SetLoggerLevel(1);
 7  int rtn = robot.RPC("192.168.58.2");
 8  if (rtn != 0)
 9  {
10    return -1;
11  }
12  robot.SetReConnectParam(true, 30000, 500);
13  rtn = robot.RbLogDownload("D://zDOWN/");
14  cout << "RbLogDownload rtn is " << rtn << endl;
15  rtn = robot.AllDataSourceDownload("D://zDOWN/");
16  cout << "AllDataSourceDownload rtn is " << rtn << endl;
17  rtn = robot.DataPackageDownload("D://zDOWN/");
18  cout << "DataPackageDownload rtn is " << rtn << endl;
19  robot.CloseRPC();
20  return 0;
21}

16.19. Impostare aggiornamento firmware giunti

1/**
2* @brief Imposta aggiornamento firmware giunti
3* @param [in] type Tipo file aggiornamento; 1-Aggiornamento firmware (prima dell'uso, far entrare il robot in modalità boot); 2-Aggiornamento file configurazione slave (prima dell'uso, disabilitare il robot)
4* @param [in] path Percorso completo pacchetto aggiornamento locale (D://zUP/XXXXX.bin)
5* @return Codice di errore
6*/
7errno_t SetJointFirmwareUpgrade(int type, std::string path);

16.20. Impostare aggiornamento firmware scatola di controllo

1/**
2* @brief Imposta aggiornamento firmware scatola di controllo
3* @param [in] type Tipo file aggiornamento; 1-Aggiornamento firmware (prima dell'uso, far entrare il robot in modalità boot); 2-Aggiornamento file configurazione slave (prima dell'uso, disabilitare il robot)
4* @param [in] path Percorso completo pacchetto aggiornamento locale (D://zUP/XXXXX.bin)
5* @return Codice di errore
6*/
7errno_t SetCtrlFirmwareUpgrade(int type, std::string path);

16.21. Impostare aggiornamento firmware terminale

1/**
2* @brief Imposta aggiornamento firmware terminale
3* @param [in] type Tipo file aggiornamento; 1-Aggiornamento firmware (prima dell'uso, far entrare il robot in modalità boot); 2-Aggiornamento file configurazione slave (prima dell'uso, disabilitare il robot)
4* @param [in] path Percorso completo pacchetto aggiornamento locale (D://zUP/XXXXX.bin)
5* @return Codice di errore
6*/
7errno_t SetEndFirmwareUpgrade(int type, std::string path);

16.22. Aggiornamento file configurazione parametri completi giunti

1/**
2* @brief Aggiornamento file configurazione parametri completi giunti (prima dell'uso, disabilitare il robot)
3* @param [in] path Percorso completo pacchetto aggiornamento locale (D://zUP/XXXXX.bin)
4* @return Codice di errore
5*/
6errno_t JointAllParamUpgrade(std::string path);

16.23. Esempio di codice per aggiornamento firmware slave robot

 1int TestFirmWareUpgrade()
 2{
 3ROBOT_STATE_PKG pkg = {};
 4FRRobot robot;
 5robot.LoggerInit();
 6robot.SetLoggerLevel(1);
 7int rtn = robot.RPC("192.168.58.2");
 8if (rtn != 0)
 9{
10return -1;
11}
12robot.SetReConnectParam(true, 30000, 500);
13robot.RobotEnable(0);
14robot.Sleep(200);
15rtn = robot.JointAllParamUpgrade("D://zUP/upgrade/jointallparameters.db");
16printf("robot JointAllParamUpgrade rtn is %d\n", rtn);
17rtn = robot.SetCtrlFirmwareUpgrade(2, "D://zUP/upgrade/FAIR_Cobot_Cbd_Asix_V2.0.bin");
18printf("robot SetCtrlFirmwareUpgrade config param rtn is %d\n", rtn);
19rtn = robot.SetEndFirmwareUpgrade(2, "D://zUP/upgrade/FAIR_Cobot_Axle_Asix_V2.4.bin");
20printf("robot SetEndFirmwareUpgrade config param rtn is %d\n", rtn);
21robot.SetSysServoBootMode();
22rtn = robot.SetCtrlFirmwareUpgrade(1, "D://zUP/upgrade/FR_CTRL_PRIMCU_FV201212_MAIN_U4_T01_20250428(MT).bin");
23printf("robot SetCtrlFirmwareUpgrade rtn is %d\n", rtn);
24rtn = robot.SetEndFirmwareUpgrade(1, "D://zUP/upgrade/FR_END_FV201009_MAIN_U1_T01_20250428.bin");
25printf("robot SetEndFirmwareUpgrade rtn is %d\n", rtn);
26rtn = robot.SetJointFirmwareUpgrade(1, "D://zUP/upgrade/FR_SERVO_FV504214_MAIN_U7_T07_20250519.bin");
27printf("robot SetJointFirmwareUpgrade rtn is %d\n", rtn);
28robot.CloseRPC();
29return 0;
30}

16.24. Aggiornamento sistema operativo robot (Scatola di controllo LA)

Nuovo nella versione C++SDK-v3.8.6.

1/**
2* @brief Aggiornamento sistema operativo robot (Scatola di controllo LA)
3* @param [in] filePath Percorso completo pacchetto aggiornamento sistema operativo
4* @return Codice di errore
5*/
6errno_t KernelUpgrade(std::string filePath);

16.25. Ottenere risultato aggiornamento sistema operativo robot (Scatola di controllo LA)

Nuovo nella versione C++SDK-v3.8.6.

1/**
2* @brief Ottiene risultato aggiornamento sistema operativo robot (Scatola di controllo LA)
3* @param [out] result Risultato aggiornamento: 0: successo; -1: fallito
4* @return Codice di errore
5*/
6errno_t GetKernelUpgradeResult(int& result);

16.26. Generazione log MCU robot

1/**
2* @brief Generazione log MCU robot
3* @return Codice di errore
4*/
5errno_t RobotMCULogCollect();

16.27. Imposta l’arresto del robot quando la comunicazione della porta è disconnessa

1/**
2* @brief Imposta l'arresto del robot quando la comunicazione della porta è disconnessa
3* @param [in] portID Numero porta 0-8080; 1-8083; 2-20002; 3-20004
4* @param [in] enable 0-disabilitato; 1-abilitato
5* @param [in] confirmTime Durata conferma interruzione comunicazione (ms)[0-5000]
6* @return Codice di errore
7*/
8errno_t SetRobotStopOnComDisc(int portID, bool enable, int confirmTime);

16.28. Ottieni i parametri di arresto del robot alla disconnessione della comunicazione della porta

1/**
2* @brief Ottiene i parametri di arresto del robot alla disconnessione della comunicazione della porta
3* @param [in] portID Numero porta 0-8080; 1-8083; 2-20002; 3-20004
4* @param [out] enable 0-disabilitato; 1-abilitato
5* @param [out] confirmTime Durata conferma interruzione comunicazione (ms)[0-5000]
6* @return Codice di errore
7*/
8errno_t GetRobotStopOnComDisc(int portID, bool &enable, int &confirmTime);

16.29. Esempio di Codice per i Parametri di Arresto del Robot alla Disconnessione della Comunicazione della Porta

 1int TestRobotStopOnComDisc()
 2{
 3    ROBOT_STATE_PKG pkg = {};
 4    FRRobot robot;
 5    robot.LoggerInit();
 6    robot.SetLoggerLevel(1);
 7    int rtn = robot.RPC("192.168.58.2");
 8    if (rtn != 0)
 9    {
10        return -1;
11    }
12    robot.SetReConnectParam(true, 30000, 500);
13    bool enable = false;
14    int confirmTime = 0;
15    rtn = robot.SetRobotStopOnComDisc(0, true, 330);
16    rtn = robot.SetRobotStopOnComDisc(1, true, 550);
17    rtn = robot.SetRobotStopOnComDisc(2, true, 110);
18    rtn = robot.SetRobotStopOnComDisc(3, true, 220);
19    printf("SetRobotStopOnComDisc %d\n", rtn);
20    robot.GetRobotStopOnComDisc(0, enable, confirmTime);
21    printf("GetRobotStopOnComDisc 8080 rtn %d; enable is %d; confirm time is %d\n", rtn, enable, confirmTime);
22    robot.GetRobotStopOnComDisc(1, enable, confirmTime);
23    printf("GetRobotStopOnComDisc 80803 rtn %d; enable is %d; confirm time is %d\n", rtn, enable, confirmTime);
24    robot.GetRobotStopOnComDisc(2, enable, confirmTime);
25    printf("GetRobotStopOnComDisc 20002 rtn %d; enable is %d; confirm time is %d\n", rtn, enable, confirmTime);
26    robot.GetRobotStopOnComDisc(3, enable, confirmTime);
27    printf("GetRobotStopOnComDisc 20004 rtn %d; enable is %d; confirm time is %d\n", rtn, enable, confirmTime);
28    robot.CloseRPC();
29    robot.Sleep(1000);
30    return 0;
31}

16.30. Invia Frame di Istruzione UDP

1/**
2* @brief Invia frame di istruzione UDP
3* @param [in] frame Stringa del frame dati da inviare, es. /f/bIII20III303III7IIIMode(0)III/b/f
4* @return Codice di errore
5*/
6errno_t SendUDPFrame(std::string frame);

16.31. Imposta la Funzione di Callback per i Risultati di Esecuzione delle Istruzioni Inviate da SDK tramite UDP

1/**
2* @brief Imposta la funzione di callback per i risultati di esecuzione delle istruzioni inviate da SDK tramite UDP
3* @param [in] CallBack Funzione di callback; comType-tipo di risposta comunicazione risultato istruzione 0-TCP, 1-UDP; count-conteggio frame di risposta istruzione; cmdID-ID istruzione; contentLen-lunghezza dati; content-contenuto dati
4* @return Codice di errore
5*/
6errno_t SetCmdRpyCallback(void (*CallBack)(int comType, int count, int cmdID, int contentLen, std::string content));

16.32. Esempio di Codice per Invio Istruzioni UDP

 1int TestSendUDPFrame()
 2{
 3    ROBOT_STATE_PKG pkg = {};
 4    FRRobot robot;
 5    robot.LoggerInit();
 6    robot.SetLoggerLevel(1);
 7    int rtn = robot.SetCmdRpyCallback(UDPFrameCallBack);
 8    printf("SetCmdRpyCallback rtn is %d\n", rtn);
 9    rtn = robot.RPC("192.168.58.2");
10    if (rtn != 0)
11    {
12        return -1;
13    }
14    robot.SetReConnectParam(true, 30000, 500);
15    rtn = robot.SendUDPFrame("/f/bIII20III303III7IIIMode(0)III/b/f");
16    printf("SendUDPFrame Mode(0) rtn is %d\n", rtn);
17    robot.Sleep(1000);
18    rtn = robot.SendUDPFrame("/f/bIII21III303III7IIIMode(1)III/b/f");
19    printf("SendUDPFrame Mode(1) rtn is %d\n", rtn);
20    robot.Sleep(1000);
21    rtn = robot.SendUDPFrame("/f/bIII49III201III184IIIMoveJ(-15.625, -82.680, 101.654, -110.950, -88.290, 0.017, -383.012, -2.325, 242.655, -178.024, 1.710, 74.416, 0, 0, 100, 100, 100, 0.000, 0.000, 0.000, 0.000, -1, 0, 0, 0, 0, 0, 0, 0)III/b/f");
22    printf("SendUDPFrame MoveJ(-15.625 rtn is %d\n", rtn);
23    robot.Sleep(1000);
24    rtn = robot.SendUDPFrame("/f/bIII48III203III199IIIMoveL(-75.622, -82.680, 101.654, -110.950, -88.290, 0.017, -193.537, 330.525, 242.657, -178.024, 1.710, 14.420, 0, 0, 100, 100, 100, -1, 0, 0.000, 0.000, 0.000, 0.000, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0)III/b/f");
25    printf("SendUDPFrame MoveL(-75.622 rtn is %d\n", rtn);
26    robot.Sleep(1000);
27    rtn = robot.SendUDPFrame("/f/bIII4III905III20IIIGetSoftwareVersion()III/b/f");
28    printf("SendUDPFrame GetSoftwareVersion() rtn is %d\n", rtn);
29    robot.Sleep(1000);
30    rtn = robot.SendUDPFrame("/f/bIII20III303III7IIIMode(0)III/b/f");
31    printf("SendUDPFrame rtn is %d\n", rtn);
32    rtn = robot.SendUDPFrame("III20III303III7IIIMode(0)III/b/f");
33    printf("SendUDPFrame rtn is %d\n", rtn);
34    rtn = robot.SendUDPFrame("/f/bIII20III303III7IIIMode(0)");
35    printf("SendUDPFrame rtn is %d\n", rtn);
36    rtn = robot.SendUDPFrame("/f/bIII20III303III6IIIMode(0)III/b/f");
37    printf("SendUDPFrame rtn is %d\n", rtn);
38    rtn = robot.SendUDPFrame("/f/b|||20|||303|||7|||Mode(0)|||/b/f");
39    printf("SendUDPFrame rtn is %d\n", rtn);
40    rtn = robot.SendUDPFrame("/f/bII20II303II7IIMode(0)II/b/f");
41    printf("SendUDPFrame rtn is %d\n", rtn);
42    robot.CloseRPC();
43    robot.Sleep(1000);
44    return 0;
45}

16.33. Imposta il Colore LED Personalizzato dell’End-Effector del Robot

1/**
2* @brief Imposta il colore LED personalizzato dell'end-effector del robot
3* @param [in] r Controllo LED rosso dell'end-effector; 0-spento; 1-acceso
4* @param [in] g Controllo LED verde dell'end-effector; 0-spento; 1-acceso
5* @param [in] b Controllo LED blu dell'end-effector; 0-spento; 1-acceso
6* @return Codice di errore
7*/
8errno_t SetUserLEDColor(bool r, bool g, bool b);

16.34. Esempio di Codice per Impostare il Colore LED Personalizzato dell’End-Effector del Robot

 1int TestUserLedColor()
 2{
 3    ROBOT_STATE_PKG pkg = {};
 4    FRRobot robot;
 5    robot.LoggerInit();
 6    robot.SetLoggerLevel(1);
 7    int rtn = robot.RPC("192.168.58.2");
 8    if (rtn != 0)
 9    {
10        return 0;
11    }
12    robot.SetReConnectParam(true, 30000, 500);
13    robot.SetUserLEDColor(true, true, true);
14    robot.Sleep(1000);
15    robot.SetUserLEDColor(false, false, false);
16    robot.Sleep(1000);
17    robot.SetUserLEDColor(true, false, false);
18    robot.Sleep(1000);
19    robot.SetUserLEDColor(false, true, false);
20    robot.Sleep(1000);
21    robot.SetUserLEDColor(false, false, true);
22    robot.Sleep(1000);
23    robot.CloseRPC();
24    robot.Sleep(1000);
25    return 0;
26}