Others ================= .. toctree:: :maxdepth: 5 Get SSH public key ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``GetSSHKeygen()``" "description", "Get SSH public key" "Mandatory parameters", "NULL" "Default parameters", "NULL" "Return Value", "- errorcode Success-0 Failure- errcode - ``keygen``: public key" Issue the SCP command +++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.1.3 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``SetSSHScpCmd(mode, sshname, sship, usr_file_url, robot_file_url)``" "Description", "Issue the SCP command" "Mandatory parameters", "- ``mode``: 0- Upload (Host Computer -> Controller), 1- Download (Controller -> Host Computer - ``sshname``: User name of the upper computer - ``sship``: The ip address of the upper computer - ``usr_file_url``: File path of the upper computer - ``robot_file_url``: Robot controller file path" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode " Calculate the MD5 value of a file in a specified path ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``ComputeFileMD5(file_path)``" "Description", "Calculates the MD5 value of a file in the specified path." "Mandatory parameter","- ``file_path``: file path including filename, default Traj folder path is :/fruser/traj/, e.g. /fruser/traj/trajHelix_aima_1.txt" "Default parameters", "NULL" "Return Value", "- errorcode Success-0 Failure- errcode - ``md5``: the MD5 value of the file." Robot SSH, MD5 instruction code example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: python :linenos: from fairino import Robot import time # Establish a connection with the robot controller and return a robot object if the connection is successful robot = Robot.RPC('192.168.58.2') file_path = "/fruser/airlab.lua" md5 = "" emerg_state = 0 si0_state = 0 si1_state = 0 sdk_com_state = 0 ssh_keygen = "" retval,ssh_keygen = robot.GetSSHKeygen() print(f"GetSSHKeygen retval is: {retval}") print(f"ssh key is: {ssh_keygen}") ssh_name = "fr" ssh_ip = "192.168.58.45" ssh_route = "/home/fr" ssh_robot_url = "/root/robot/dhpara.config" retval = robot.SetSSHScpCmd(1, ssh_name, ssh_ip, ssh_route, ssh_robot_url) print(f"SetSSHScpCmd retval is: {retval}") print(f"robot url is: {ssh_robot_url}") error, md5 = robot.ComputeFileMD5(file_path) print(f"md5 is: {md5}") robot.CloseRPC() Setting the Robot 20004 Port Feedback Cycle ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.0.5 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``SetRobotRealtimeStateSamplePeriod(period)``" "Description", "Setting the robot 20004 port feedback cycle" "Mandatory parameter", "- ``period``: robot 20004 port feedback period (ms)" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode " Get robot 20004 port feedback cycle ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.0.5 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``GetRobotRealtimeStateSamplePeriod()``" "Description", "Get robot 20004 port feedback cycle" "Mandatory parameters", "NULL" "Default parameters", "NULL" "Return Value", "- errorcode Success-0 Failure- errcode - ``period``: robot 20004 port feedback period (ms)" Robot 20004 port state feedback cycle configuration code example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: python :linenos: from fairino import Robot import time # Establish a connection with the robot controller and return a robot object if the connection is successful robot = Robot.RPC('192.168.58.2') robot.SetRobotRealtimeStateSamplePeriod(10) error,getPeriod = robot.GetRobotRealtimeStateSamplePeriod() print(f"period is {getPeriod}") time.sleep(1) robot.CloseRPC() Robot software upgrade ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.0.5 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``SoftwareUpgrade(filePath, block)``" "Description", "Robot Software Upgrade" "Required parameters","- ``filePath``: full path of the software upgrade package - ``block``: whether to block until the upgrade is complete true:blocking; false:non-blocking" "Default parameters", "NULL" "Return Value", "- errcode Success-0 Failure- errcode " Get robot software upgrade status ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.0.5 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``GetSoftwareUpgradeState()``" "Description", "Get robot software upgrade status" "Mandatory parameters", "NULL" "Default parameters", "NULL" "Return Value", "- errorcode Success-0 Failure- errcode - ``state``: robot package upgrade status, 0: idle in progress or uploading upgrade package in progress, 1~100: percentage of upgrade completed, -1: upgrade software failure, -2: checksum failure, -3: version checksum failure, -4: unpacking failure, -5: user configuration upgrade failure, -6: peripheral configuration upgrade failure, -7: extended axis configuration upgrade failure, -8: robot configuration upgrade failure, -9: DH parameter configuration upgrade failure" Robot software upgrade code example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: python :linenos: from fairino import Robot import time # Establish a connection with the robot controller and return a robot object if the connection is successful robot = Robot.RPC('192.168.58.2') error = robot.SoftwareUpgrade("D://zUP/QNX382/software.tar.gz", False) print(f"SoftwareUpgrade error is {error}") while True: curState = robot.GetSoftwareUpgradeState() print(f"upgrade state is {curState}") time.sleep(3) robot.CloseRPC() Download Point Table Database +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.0.1 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``PointTableDownLoad(point_table_name, save_file_path)``" "Description", "Download Points Table Database" "Required Parameters", "- ``point_table_name``: name of the point table to be downloaded pointTable1.db; - ``save_file_path``: storage path to download the point table C://test/;" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode" Upload point table database +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.0.1 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``PointTableUpLoad(point_table_file_path)``" "Description", "Upload point table database" "Required Parameters", "- ``point_table_file_path``: full pathname of uploaded point table C://test/pointTable1.db" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode" Point table update lua file +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.0.1 .. csv-table:: :stub-columns: 1 :widths: 10 30 "prototype", "``PointTableUpdateLua(point_table_name, lua_file_name)``" "Description", "Point table update lua file" "Required Parameters","- ``point_table_name``: the name of the point table to be switched, pointTable1.db, when the point table is empty, i.e. "", it means updating the lua program to the initial program with no point table applied - ``lua_file_name``: name of the lua file to update testPointTable.lua" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode" Robot point table operation code example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: python :linenos: from fairino import Robot # Establish a connection with the robot controller and return a robot object if the connection is successful robot = Robot.RPC('192.168.58.2') save_path = "D://zDOWN/" point_table_name = "point_table_FR5.db" rtn = robot.PointTableDownLoad(point_table_name, save_path) print(f"download : {point_table_name} fail: {rtn}") upload_path = "D://zDOWN/point_table_FR5.db" rtn = robot.PointTableUpLoad(upload_path) print(f"retval is: {rtn}") point_tablename = "point_table_FR5.db" lua_name = "test0610.lua" rtn,error = robot.PointTableUpdateLua(point_tablename, lua_name) print(f"retval is: {rtn}") robot.CloseRPC() Controller log download +++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.1.1 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``RbLogDownload(savePath)``" "Description", "Controller log download" "Mandatory parameters", "- ``savePath``: Save the file path D://zDown/" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode " Download all data sources +++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.1.1 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``AllDataSourceDownload(savePath)``" "Description", "Download all data sources" "Mandatory parameters", "- ``savePath``: Save the file path D://zDown/" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode " Data backup package download +++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.1.1 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``DataPackageDownload(savePath)``" "Description", "Data backup package download" "Mandatory parameters", "- ``savePath``: Save the file path D://zDown/" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode " Download the controller data code example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: python :linenos: from fairino import Robot import time # Establish a connection with the robot controller and return a robot object if the connection is successful robot = Robot.RPC('192.168.58.2') rtn = robot.RbLogDownload("D://zDOWN/") print(f"RbLogDownload rtn is {rtn}") rtn = robot.AllDataSourceDownload("D://zDOWN/") print(f"AllDataSourceDownload rtn is {rtn}") rtn = robot.DataPackageDownload("D://zDOWN/") print(f"DataPackageDownload rtn is {rtn}") robot.CloseRPC() Set up encoder upgrade +++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.1.4 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``SetEncoderUpgrade(path)``" "Description", "Set up encoder upgrade" "Mandatory parameters", "- ``path``:Local upgrade package full path(D://zUP/XXXXX.bin)" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode " Set up joint firmware upgrade +++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.1.4 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``SetJointFirmwareUpgrade(type, path)``" "Description", "Set up joint firmware upgrade" "Mandatory parameters", "- ``type``:Updating file types 1- Upgrade firmware; 2- Upgrade the slave profile - ``path``:Local upgrade package full path(D://zUP/XXXXX.bin)" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode " Set up control box firmware upgrade +++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.1.4 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``SetCtrlFirmwareUpgrade(type, path)``" "Description", "Set up control box firmware upgrade" "Mandatory parameters", "- ``type``:Updating file types 1- Upgrade firmware; 2- Upgrade the slave profile - ``path``:Local upgrade package full path(D://zUP/XXXXX.bin)" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode " Set up the end firmware upgrade +++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.1.4 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``SetEndFirmwareUpgrade(type, path)``" "Description", "Set up the end firmware upgrade" "Mandatory parameters", "- ``type``:Updating file types 1- Upgrade firmware; 2- Upgrade the slave profile - ``path``:Local upgrade package full path(D://zUP/XXXXX.bin)" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode " Joint full parameter profile upgrade +++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.1.4 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``JointAllParamUpgrade(path)``" "Description", "Joint full parameter profile upgrade" "Mandatory parameters", "- ``path``:Local upgrade package full path(D://zUP/XXXXX.bin)" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode " Example of robot slave firmware upgrade code ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: python :linenos: from fairino import Robot import time # Establish a connection with the robot controller and return a robot object if the connection is successful robot = Robot.RPC('192.168.58.2') robot.RobotEnable(0) time.sleep(0.2) rtn = robot.JointAllParamUpgrade("D://zUP/MT/joint0603/jointallparameters.db") print(f"robot JointAllParamUpgrade rtn is {rtn}") rtn = robot.SetCtrlFirmwareUpgrade(2, "D://zUP/MT/FAIR_Cobot_Cbd_Asix_V2.0.bin") print(f"robot SetCtrlFirmwareUpgrade rtn is {rtn}") rtn = robot.SetEndFirmwareUpgrade(2, "D://zUP/MT/FAIR_Cobot_Axle_Asix_V2.4.bin") print(f"robot SetEndFirmwareUpgrade rtn is {rtn}") robot.SetSysServoBootMode() time.sleep(0.2) rtn = robot.SetCtrlFirmwareUpgrade(1, "D://zUP/MT/FR_CTRL_PRIMCU_FV201412_MAIN_U4_T01_20250630(MT).bin") print(f"robot SetCtrlFirmwareUpgrade rtn is {rtn}") rtn = robot.SetEndFirmwareUpgrade(1, "D://zUP/MT/FR_END_FV2010010_MAIN_U1_T01_20250603.bin") print(f"robot SetEndFirmwareUpgrade rtn is {rtn}") rtn = robot.SetJointFirmwareUpgrade(1, "D://zUP/MT/FR_SERVO_FV504215_MAIN_U7_T07_20250603.bin") print(f"robot SetJointFirmwareUpgrade rtn is {rtn}") robot.CloseRPC() Robot Operating System upgrade (LA control box) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.1.6 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``KernelUpgrade(filePath)``" "Description", "Robot Operating System upgrade (LA control box)" "Mandatory parameters", "- ``filePath``:Operating system upgrade package full path" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode " Obtain upgrade results of robot operating system (LA control box) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.1.6 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``GetKernelUpgradeResult()``" "Description", "Obtain upgrade results of robot operating system (LA control box)" "Mandatory parameters", "NULL" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode " Robot MCU log generation +++++++++++++++++++++++++++++++++++++++++++++ .. versionadded:: python SDK-v2.1.7 .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``RobotMCULogCollect()``" "Description", "Robot MCU log generation" "Mandatory parameters", "NULL" "Default parameters", "NULL" "Return Value", "Error Code Success-0 Failure- errcode " Set Robot to Stop Running When Port Communication is Disconnected +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``SetRobotStopOnComDisc(portID, enable, confirmTime)``" "Description", "Set robot to stop running when port communication is disconnected" "Required Parameters", " - ``portID``: Port number 0-8080; 1-8083; 2-20002; 3-20004 - ``enable``: 0-disable; 1-enable - ``confirmTime``: Communication disconnection confirmation duration (ms)[0-5000]" "Default Parameters", "None" "Return Value", "Error code Success-0 Failure-errcode" Get Robot Stop on Communication Disconnection Parameters ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``GetRobotStopOnComDisc(portID)``" "Description", "Get robot stop on communication disconnection parameters" "Required Parameters", " - ``portID``: Port number 0-8080; 1-8083; 2-20002; 3-20004 - ``enable``: 0-disable; 1-enable - ``confirmTime``: Communication disconnection confirmation duration (ms)[0-5000]" "Default Parameters", "None" "Return Value", "Error code Success-0 Failure-errcode" Robot Stop on Communication Disconnection Parameter Code Example ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: python :linenos: from time import sleep import time from fairino import Robot # Establish connection with robot controller robot = Robot.RPC('192.168.58.2') def test_robot_stop_on_com_disc(self): # Initialize parameters enable = False confirm_time = 0 # Set robot stop on communication disconnection rtn = robot.SetRobotStopOnComDisc(0, True, 330) print(f"SetRobotStopOnComDisc index0: {rtn}") rtn = robot.SetRobotStopOnComDisc(1, True, 550) print(f"SetRobotStopOnComDisc index1: {rtn}") rtn = robot.SetRobotStopOnComDisc(2, True, 110) print(f"SetRobotStopOnComDisc index2: {rtn}") rtn = robot.SetRobotStopOnComDisc(3, True, 220) print(f"SetRobotStopOnComDisc index3: {rtn}") # Get robot stop on communication disconnection settings rtn, enable, confirm_time = robot.GetRobotStopOnComDisc(0) print(f"GetRobotStopOnComDisc 8080 rtn {rtn}; enable is {enable}; confirm time is {confirm_time}") rtn, enable, confirm_time = robot.GetRobotStopOnComDisc(1) print(f"GetRobotStopOnComDisc 80803 rtn {rtn}; enable is {enable}; confirm time is {confirm_time}") rtn, enable, confirm_time = robot.GetRobotStopOnComDisc(2) print(f"GetRobotStopOnComDisc 20002 rtn {rtn}; enable is {enable}; confirm time is {confirm_time}") rtn, enable, confirm_time = robot.GetRobotStopOnComDisc(3) print(f"GetRobotStopOnComDisc 20004 rtn {rtn}; enable is {enable}; confirm time is {confirm_time}") # Close RPC connection robot.CloseRPC() return 0 test_robot_stop_on_com_disc(robot) Send UDP Instruction Frame +++++++++++++++++++++++++++++++++++++++++++++ .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``SendUDPFrame(frame)``" "Description", "Send UDP instruction frame" "Required Parameters", " - ``frame``: UDP data to send, transparent transmission, no encapsulation" "Default Parameters", "None" "Return Value", "Error code Success-0 Failure-errcode" UDP Communication-Based SDK Code Example +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: python :linenos: from time import sleep import time from fairino import Robot # Establish connection with robot controller robot = Robot.RPC('192.168.58.2') def TestSendUDPFrame(self): # Set callback def callback(src_type, count, cmd_id, data_len, content): print("Received reply: cmd_id={} count={} data_len={} content={}".format(cmd_id, count, data_len, content)) return 0 robot.SetUDPCmdRpyCallback(callback) rtn = robot.SendUDPFrame("/f/bIII20III303III7IIIMode(0)III/b/f") print(f"SendUDPFrame Mode(0) rtn is {rtn}") time.sleep(1) rtn = robot.SendUDPFrame("/f/bIII21III303III7IIIMode(1)III/b/f") print(f"SendUDPFrame Mode(1) rtn is {rtn}") time.sleep(1) 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") print(f"SendUDPFrame MoveJ(-15.625) rtn is {rtn}") time.sleep(1) 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") print(f"SendUDPFrame MoveL(-75.622) rtn is {rtn}") time.sleep(1) rtn = robot.SendUDPFrame("/f/bIII4III905III20IIIGetSoftwareVersion()III/b/f") print(f"SendUDPFrame GetSoftwareVersion() rtn is {rtn}") time.sleep(1) # Send UDP frame data validation test rtn = robot.SendUDPFrame("/f/bIII20III303III7IIIMode(0)III/b/f") print(f"SendUDPFrame rtn is {rtn}") rtn = robot.SendUDPFrame("III20III303III7IIIMode(0)III/b/f") print(f"SendUDPFrame rtn is {rtn}") rtn = robot.SendUDPFrame("/f/bIII20III303III7IIIMode(0)") print(f"SendUDPFrame rtn is {rtn}") rtn = robot.SendUDPFrame("/f/bIII20III303III6IIIMode(0)III/b/f") print(f"SendUDPFrame rtn is {rtn}") rtn = robot.SendUDPFrame("/f/b|||20|||303|||7|||Mode(0)|||/b/f") print(f"SendUDPFrame rtn is {rtn}") rtn = robot.SendUDPFrame("/f/bII20II303II7IIMode(0)II/b/f") print(f"SendUDPFrame rtn is {rtn}") robot.CloseRPC() time.sleep(1) TestSendUDPFrame(robot) Set User-Defined Robot End-Effector LED Color +++++++++++++++++++++++++++++++++++++++++++++ .. csv-table:: :stub-columns: 1 :widths: 10 30 "Prototype", "``SetUserLEDColor(r, g, b)``" "Description", "Set user-defined robot end-effector LED color" "Required Parameters", " - ``r``: End red LED control; 0-off; 1-on - ``g``: End green LED control; 0-off; 1-on - ``b``: End blue LED control; 0-off; 1-on - " "Default Parameters", "None" "Return Value", "Error code Success-0 Failure-errcode" SDK Code Example for Setting User-Defined Robot End-Effector LED Color +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code-block:: python :linenos: from time import sleep import time from fairino import Robot # Establish connection with robot controller robot = Robot.RPC('192.168.58.2') def testled(self): # Set user LED color # Parameter order: R, G, B (Red, Green, Blue) # White (all lights on) robot.SetUserLEDColor(True, True, True) time.sleep(1) # Turn off all lights robot.SetUserLEDColor(False, False, False) time.sleep(1) # Red (red light only) robot.SetUserLEDColor(True, False, False) time.sleep(1) # Green (green light only) robot.SetUserLEDColor(False, True, False) time.sleep(1) # Blue (blue light only) robot.SetUserLEDColor(False, False, True) # Close connection robot.CloseRPC() testled(robot)