3.1. Instantiated Robot
Prototype | RPC(ip) |
Description | Instantiating a robot object |
Required parameter |
|
Optional parameter | NULL |
Return value |
|
3.2. Close the RPC connection
Prototype | CloseRPC() |
Description | Close RPC connection |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value | NULL |
3.3. Query SDK version number
prototype | GetSDKVersion() |
Description | Query SDK version number |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value |
|
3.4. Get controller IP
Prototype | GetControllerIP() |
Description | Query Controller IP |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value |
|
3.5. Controlling the robot into and out of drag-and-drop instructor mode
Prototype | DragTeachSwitch(state) |
Description | Controls the robot into and out of drag-and-drop demonstration mode. |
Mandatory parameter |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
3.6. Queries whether the robot is in drag mode
Prototype | IsInDragTeach() |
Description | Queries whether the robot is in drag-and-drop demonstration mode. |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value |
|
3.7. Control robot up-enable or down-enable
prototype | RobotEnable(state) |
Description | Control robot up-enable or down-enable |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
3.8. Control of robot hand-automatic mode switching
prototype | Mode(state) |
description | control robot hand auto mode switching |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
3.9. Shut down the robot operating system
New in version python: SDK-v2.1.1
Prototype | ShutDownRobotOS() |
Description | Shut down the robot operating system |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
3.10. Initialize the log parameters
New in version python: SDK-v2.1.1
Prototype | LoggerInit(output_model=1, file_path=", file_num=5) |
Description | Initialize the log parameters |
Mandatory parameters | NULL |
Default parameters |
|
Return Value | Error Code Success-0 Failure- errcode |
3.11. Setting the log filter level
New in version python: SDK-v2.0.2
Prototype | SetLoggerLevel(lvl=1) |
Description | Set log filter level |
Mandatory parameters | NULL |
Default Parameters |
|
Return Value | Error Code Success-0 Failure- errcode |
3.12. Robot base control code example
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')
error,version = robot.GetSDKVersion()
print(f"SDK version: {version}")
error,ip = robot.GetControllerIP()
print(f"controller ip: {ip}")
robot.Mode(1)
time.sleep(1)
robot.DragTeachSwitch(state=1)
time.sleep(1)
error,state = robot.IsInDragTeach()
print(f"drag state: {state}")
time.sleep(3)
robot.DragTeachSwitch(state=0)
time.sleep(1)
error,state = robot.IsInDragTeach()
print(f"drag state: {state}")
time.sleep(3)
robot.RobotEnable(0)
time.sleep(3)
robot.RobotEnable(1)
robot.Mode(0)
time.sleep(1)
robot.Mode(1)
robot.CloseRPC()
3.13. Get the software version of the robot
New in version python: SDK-v2.0.1
Prototype | GetSoftwareVersion() |
Description | Get the software version of the robot |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value |
|
3.14. Getting robot hardware version information
New in version python: SDK-v2.0.1
Prototype | GetSlaveHardVersion() |
Description | Get robot hardware version information |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value |
|
3.15. Getting robot firmware version information
New in version python: SDK-v2.0.1
Prototype | GetSlaveFirmVersion() |
Description | Get information about the robot’s firmware version. |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value |
|
3.16. Get the robot software firmware version code sample
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')
rtn,robotModel, webversion, controllerVersion = robot.GetSoftwareVersion()
print(f"Getsoftwareversion rtn is: {rtn}")
print(f"robotmodel is: {robotModel}, webversion is: {webversion}, controllerVersion is: {controllerVersion}\n")
rtn,ctrlBoxBoardversion, driver1version, driver2version,driver3version, driver4version, driver5version,driver6version, endBoardversion = robot.GetHardwareversion()
print(f"GetHardwareversion rtn is: {rtn}")
print(f"GetHardwareversion get hardware version is: {ctrlBoxBoardversion}, {driver1version}, {driver2version}, "
f"{driver3version}, {driver4version}, {driver5version}, {driver6version}, {endBoardversion}\n")
rtn,ctrlBoxBoardversion, driver1version, driver2version,driver3version, driver4version, driver5version,driver6version, endBoardversion = robot.GetFirmwareVersion()
print(f"GetFirmwareversion rtn is: {rtn}")
print(f"GetFirmwareversion get firmware version is: {ctrlBoxBoardversion}, {driver1version}, {driver2version}, "
f"{driver3version}, {driver4version}, {driver5version}, {driver6version}, {endBoardversion}\n")
robot.CloseRPC()