3. Robotics Basics
3.1. Instantiated Robot
Prototype |
|
|---|---|
Description |
Instantiating a robot object |
Required parameter |
|
Optional parameter |
NULL |
Return value |
|
3.2. Close the RPC connection
Prototype |
|
|---|---|
Description |
Close RPC connection |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
NULL |
3.3. Query SDK version number
prototype |
|
|---|---|
Description |
Query SDK version number |
Mandatory parameters |
NULL |
Default parameters |
NULL |
Return Value |
|
3.4. Get controller IP
Prototype |
|
|---|---|
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 |
|
|---|---|
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 |
|
|---|---|
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 |
|
|---|---|
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 |
|
|---|---|
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 |
|
|---|---|
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 |
|
|---|---|
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 |
|
|---|---|
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
1from fairino import Robot
2# Establish a connection with the robot controller and return a robot object if the connection is successful
3robot = Robot.RPC('192.168.58.2')
4error,version = robot.GetSDKVersion()
5print(f"SDK version: {version}")
6error,ip = robot.GetControllerIP()
7print(f"controller ip: {ip}")
8robot.Mode(1)
9time.sleep(1)
10robot.DragTeachSwitch(state=1)
11time.sleep(1)
12error,state = robot.IsInDragTeach()
13print(f"drag state: {state}")
14time.sleep(3)
15robot.DragTeachSwitch(state=0)
16time.sleep(1)
17error,state = robot.IsInDragTeach()
18print(f"drag state: {state}")
19time.sleep(3)
20robot.RobotEnable(0)
21time.sleep(3)
22robot.RobotEnable(1)
23robot.Mode(0)
24time.sleep(1)
25robot.Mode(1)
26robot.CloseRPC()
3.13. Get the software version of the robot
New in version python: SDK-v2.0.1
Prototype |
|
|---|---|
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 |
|
|---|---|
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 |
|
|---|---|
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
1from fairino import Robot
2# Establish a connection with the robot controller and return a robot object if the connection is successful
3robot = Robot.RPC('192.168.58.2')
4rtn,robotModel, webversion, controllerVersion = robot.GetSoftwareVersion()
5print(f"Getsoftwareversion rtn is: {rtn}")
6print(f"robotmodel is: {robotModel}, webversion is: {webversion}, controllerVersion is: {controllerVersion}\n")
7rtn,ctrlBoxBoardversion, driver1version, driver2version,driver3version, driver4version, driver5version,driver6version, endBoardversion = robot.GetHardwareversion()
8print(f"GetHardwareversion rtn is: {rtn}")
9print(f"GetHardwareversion get hardware version is: {ctrlBoxBoardversion}, {driver1version}, {driver2version}, "
10 f"{driver3version}, {driver4version}, {driver5version}, {driver6version}, {endBoardversion}\n")
11rtn,ctrlBoxBoardversion, driver1version, driver2version,driver3version, driver4version, driver5version,driver6version, endBoardversion = robot.GetFirmwareVersion()
12print(f"GetFirmwareversion rtn is: {rtn}")
13print(f"GetFirmwareversion get firmware version is: {ctrlBoxBoardversion}, {driver1version}, {driver2version}, "
14 f"{driver3version}, {driver4version}, {driver5version}, {driver6version}, {endBoardversion}\n")
15robot.CloseRPC()