31 from cc_client
import CCClient
37 self._api.get_operation_permission()
40 return self._api.exec_program(path, param) == 0
43 return self._api.set_jspeed(speed) == 0
46 return self._api.set_posture(posture) == 0
50 result = self._api.get_posture(data)
52 return data[
'DA'][
'P']
56 def move(self, joint, speed=None):
60 params = joint + [speed]
61 return self._api.qjmove(*params) == 0
64 return self._api.abortm() == 0
68 result = self._api.syssts(stat_type, data)
70 return data[
'DA'][
'RE']
75 result = self._api.set_tool(x, y, z, rz, ry, rx)
85 io_list = map(to_char, data)
87 io_str =
''.join(io_list)
88 return self._api.set_io(addr, io_str) == 0
92 result = self._api.get_io(start_addr, end_addr, data)
94 io_str = data[
'DA'][
'SL']
95 io_list = list(io_str)
102 return self._api.set_adc(ch, mode) == 0
107 if __name__ ==
'__main__':
109 print ctl.set_speed(100)
110 print ctl.move([0, 0, 0, 0, 0, 0])
111 print ctl.move([22, 23, 24, 30, 33, 10])
112 print ctl.set_dio(0, [0, 0, 0, 0, 0])
113 print ctl.get_dio(0, 31)
114 print ctl.set_dio(0, [1, -1, 1, 0, 0])
115 print ctl.get_dio(0, 31)
116 print ctl.get_posture()
117 print ctl.set_posture(4)
118 print ctl.get_posture()
def set_posture(self, posture)
def move(self, joint, speed=None)
def set_adc_mode(self, ch, mode)
def __init__(self, permission=True)
def get_dio(self, start_addr, end_addr)
def set_dio(self, addr, data)
def set_tool_offset(self, x, y, z, rz, ry, rx)
def set_speed(self, speed)
def sys_stat(self, stat_type)
def exec_program(self, path, param='')