66_program_state : float = None
77_robot_mode : float = None
88_digital_outputs : list = None
9+ _digital_inputs : list = None
910
1011_q_act_base :float = None
1112_q_act_shoulder :float = None
@@ -33,7 +34,7 @@ def __init__():
3334:param status: status to unpack
3435'''
3536def unpack (data :bytes ):
36- global _program_state , _robot_mode ,_digital_outputs ,\
37+ global _program_state , _robot_mode ,_digital_outputs ,_digital_inputs , \
3738 _q_act_base ,_q_act_shoulder ,_q_act_elbow ,_q_act_wrist1 ,_q_act_wrist2 ,_q_act_wrist3 ,\
3839 _tool_act_x ,_tool_act_y ,_tool_act_z ,_tool_act_rx ,_tool_act_ry ,_tool_act_rz
3940
@@ -47,6 +48,9 @@ def unpack(data:bytes):
4748 # robot mode
4849 _robot_mode = (struct .unpack ('!d' , data [94 * 8 :95 * 8 ]))[0 ]
4950
51+ # digital inputs
52+ _digital_inputs = _double_to_8bit_list (struct .unpack ('!d' , data [85 * 8 :86 * 8 ])[0 ])
53+
5054 # digital outputs
5155 _digital_outputs = _double_to_8bit_list ((struct .unpack ('!d' , data [130 * 8 :131 * 8 ]))[0 ])
5256
@@ -67,6 +71,9 @@ def unpack(data:bytes):
6771 # robot mode
6872 _robot_mode = (struct .unpack ('!d' , data [94 * 8 :95 * 8 ]))[0 ]
6973
74+ # digital inputs
75+ _digital_inputs = _double_to_8bit_list (struct .unpack ('!d' , data [85 * 8 :86 * 8 ])[0 ])
76+
7077 # digital outputs
7178 _digital_outputs = _double_to_8bit_list (struct .unpack ('!d' , data [130 * 8 :131 * 8 ])[0 ])
7279
@@ -103,6 +110,10 @@ def get_digital_outputs():
103110 global _digital_outputs
104111 return _digital_outputs
105112
113+ def get_digital_inputs ():
114+ global _digital_inputs
115+ return _digital_inputs
116+
106117def get_robot_act_pose ():
107118 global _tool_act_x , _tool_act_y , _tool_act_z , _tool_act_rx , _tool_act_ry , _tool_act_rz
108119 return list [_tool_act_x , _tool_act_y , _tool_act_z , _tool_act_rx , _tool_act_ry , _tool_act_rz ]
0 commit comments