Prototype | SetSpeed(vel) |
Description | Set global speed |
Mandatory parameter |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.23. Setting robot acceleration
New in version python: SDK-v2.0.4
Prototype | SetOaccScale(acc) |
Description | Setting the robot acceleration |
Mandatory parameter |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.24. Getting the default speed
Prototype | GetDefaultTransVel() |
Description | Get Default Speed |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value |
|
6.25. Setting the end load weight
Prototype | SetLoadWeight(loadNum, weight) |
Description | Set the end load weight, incorrect load weight setting may cause the robot to go out of control in drag mode |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.26. Setting the end load center of mass coordinates
Prototype | SetLoadCoord(x,y,z,loadNum = 0) |
Description | Set end-load center of mass coordinates, incorrect load center of mass setting may cause robot to go out of control in drag mode |
Mandatory parameter |
|
Default parameters |
|
Return Value | Error Code Success-0 Failure- errcode |
6.27. Get the weight of the current load
Prototype | GetTargetPayload(flag=1) |
Description | Get the quality of the current load |
Mandatory parameters | NULL |
Default parameters | flag: 0-blocking, 1-non-blocking Default 1 |
Return Value |
|
6.28. Get the center of mass of the current load
Prototype | GetTargetPayloadCog(flag=1) |
Description | Get the center of mass of the current load |
Mandatory parameters | NULL |
Default parameters | flag: 0-blocking, 1-non-blocking Default 1 |
Return Value |
|
6.29. Setting the robot mounting method - fixed mounting
Prototype | SetRobotInstallPos(method) |
description | set robot mounting method - fixed mounting, wrong mounting method setting can cause robot to lose control in drag mode |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.30. Setting the robot mounting angle - free mounting
Prototype | SetRobotInstallAngle(yangle,zangle) |
Description | Setting the robot mounting angle - free mounting, wrong mounting angle setting can cause the robot to go out of control in drag mode |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.31. Getting the robot mounting angle
Prototype | GetRobotInstallAngle() |
Description | Get robot mounting angle |
Mandatory parameters | NULL |
Default parameters | NULL |
Return Value |
|
6.32. Setting system variable values
Prototype | SetSysVarValue(id,value) |
Description | Setting System Variables |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.33. Getting system variable values
Prototype | GetSysVarValue(id) |
Description | Get system variable values |
Mandatory parameters |
|
Default parameters | NULL |
Return Value |
|
6.34. Robot common setup code examples
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')
for i in range(1, 100):
robot.SetSpeed(i)
robot.SetOaccScale(i)
time.sleep(0.03)
error,defaultVel = robot.GetDefaultTransVel()
print(f"GetDefaultTransVel is {defaultVel}")
for i in range(1, 21):
robot.SetSysVarValue(i, i + 0.5)
time.sleep(0.1)
for i in range(1, 21):
value = robot.GetSysVarValue(i)
print(f"sys value {i} is: {value}")
time.sleep(0.1)
robot.SetLoadWeight(0, 2.5)
robot.SetLoadCoord(3.0,4.0,5.0)
time.sleep(1)
error,getLoad = robot.GetTargetPayload(0)
error,getLoadTran = robot.GetTargetPayloadCog(0)
print(f"get load is {getLoad}; get load cog is {getLoadTran[0]} {getLoadTran[1]} {getLoadTran[2]}")
robot.SetRobotInstallPos(0)
robot.SetRobotInstallAngle(15.0, 25.0)
error,[anglex, angley] = robot.GetRobotInstallAngle()
print(f"GetRobotInstallAngle x: {anglex}; y: {angley}")
robot.CloseRPC()
6.35. Joint Friction Compensation Switch
Prototype | FrictionCompensationOnOff(state) |
Description | Joint Friction Compensation Switch |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.36. Setting the joint friction compensation coefficients - positive loading
Prototype | SetFrictionValue_level(coeff) |
Description | Setting the joint friction compensation coefficient - Fixed mounting - Positive mounting |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.37. Setting the joint friction compensation coefficient - side mounting
Prototype | SetFrictionValue_wall(coeff) |
Description | Setting the joint friction compensation coefficient - fixed mounting - side mounting |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.38. Setting the Joint Friction Compensation Factor - Inverted
Prototype | SetFrictionValue_ceiling(coeff) |
Description | Setting the joint friction compensation coefficient - fixed mounting - inverted mounting |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |
6.39. Setting the joint friction compensation factor - free mounting
Prototype | SetFrictionValue_freedom(coeff) |
Description | Setting the joint friction compensation factor - free mounting |
Mandatory parameters |
|
Default parameters | NULL |
Return Value | Error Code Success-0 Failure- errcode |