add support to realtime interface from firmware 5.1 and methods to get joint temperature, joint voltage, joint current, main voltage, robot voltage and robot current

This commit is contained in:
mustaffxx
2021-04-09 11:19:42 -03:00
committed by oroulet
parent 18fed61168
commit ddc511ea74
4 changed files with 187 additions and 15 deletions

View File

@ -0,0 +1,43 @@
import urx
import time
import logging
r = urx.Robot("192.168.111.134", use_rt=True, urFirm=5.1)
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
while 1:
try:
j_temp = r.get_joint_temperature()
j_voltage = r.get_joint_voltage()
j_current = r.get_joint_current()
main_voltage = r.get_main_voltage()
robot_voltage = r.get_robot_voltage()
robot_current = r.get_robot_current()
print("JOINT TEMPERATURE")
print(j_temp)
print("JOINT VOLTAGE")
print(j_voltage)
print("JOINT CURRENT")
print(j_current)
print("MAIN VOLTAGE")
print(main_voltage)
print("ROBOT VOLTAGE")
print(robot_voltage)
print("ROBOT CURRENT")
print(robot_current)
print("##########\t##########\t##########\t##########")
time.sleep(1)
except:
pass
r.close()