Primo commit Completo

This commit is contained in:
2019-10-21 10:02:06 +02:00
parent 595af0738d
commit 84e9328d7c
3180 changed files with 600831 additions and 0 deletions

View File

@@ -0,0 +1,114 @@
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from ur_msgs/Analog.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class Analog(genpy.Message):
_md5sum = "341541c8828d055b6dcc443d40207a7d"
_type = "ur_msgs/Analog"
_has_header = False #flag to mark the presence of a Header object
_full_text = """uint8 pin
float32 state
"""
__slots__ = ['pin','state']
_slot_types = ['uint8','float32']
def __init__(self, *args, **kwds):
"""
Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments.
The available fields are:
pin,state
:param args: complete set of field values, in .msg order
:param kwds: use keyword arguments corresponding to message field names
to set specific fields.
"""
if args or kwds:
super(Analog, self).__init__(*args, **kwds)
#message fields cannot be None, assign default values for those that are
if self.pin is None:
self.pin = 0
if self.state is None:
self.state = 0.
else:
self.pin = 0
self.state = 0.
def _get_types(self):
"""
internal API method
"""
return self._slot_types
def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
_x = self
buff.write(_get_struct_Bf().pack(_x.pin, _x.state))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize(self, str):
"""
unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str``
"""
try:
end = 0
_x = self
start = end
end += 5
(_x.pin, _x.state,) = _get_struct_Bf().unpack(str[start:end])
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
def serialize_numpy(self, buff, numpy):
"""
serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module
"""
try:
_x = self
buff.write(_get_struct_Bf().pack(_x.pin, _x.state))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize_numpy(self, str, numpy):
"""
unpack serialized message in str into this message instance using numpy for array types
:param str: byte array of serialized message, ``str``
:param numpy: numpy python module
"""
try:
end = 0
_x = self
start = end
end += 5
(_x.pin, _x.state,) = _get_struct_Bf().unpack(str[start:end])
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
_struct_I = genpy.struct_I
def _get_struct_I():
global _struct_I
return _struct_I
_struct_Bf = None
def _get_struct_Bf():
global _struct_Bf
if _struct_Bf is None:
_struct_Bf = struct.Struct("<Bf")
return _struct_Bf

View File

@@ -0,0 +1,116 @@
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from ur_msgs/Digital.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class Digital(genpy.Message):
_md5sum = "83707be3fa18d2ffe57381ea034aa262"
_type = "ur_msgs/Digital"
_has_header = False #flag to mark the presence of a Header object
_full_text = """uint8 pin
bool state
"""
__slots__ = ['pin','state']
_slot_types = ['uint8','bool']
def __init__(self, *args, **kwds):
"""
Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments.
The available fields are:
pin,state
:param args: complete set of field values, in .msg order
:param kwds: use keyword arguments corresponding to message field names
to set specific fields.
"""
if args or kwds:
super(Digital, self).__init__(*args, **kwds)
#message fields cannot be None, assign default values for those that are
if self.pin is None:
self.pin = 0
if self.state is None:
self.state = False
else:
self.pin = 0
self.state = False
def _get_types(self):
"""
internal API method
"""
return self._slot_types
def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
_x = self
buff.write(_get_struct_2B().pack(_x.pin, _x.state))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize(self, str):
"""
unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str``
"""
try:
end = 0
_x = self
start = end
end += 2
(_x.pin, _x.state,) = _get_struct_2B().unpack(str[start:end])
self.state = bool(self.state)
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
def serialize_numpy(self, buff, numpy):
"""
serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module
"""
try:
_x = self
buff.write(_get_struct_2B().pack(_x.pin, _x.state))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize_numpy(self, str, numpy):
"""
unpack serialized message in str into this message instance using numpy for array types
:param str: byte array of serialized message, ``str``
:param numpy: numpy python module
"""
try:
end = 0
_x = self
start = end
end += 2
(_x.pin, _x.state,) = _get_struct_2B().unpack(str[start:end])
self.state = bool(self.state)
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
_struct_I = genpy.struct_I
def _get_struct_I():
global _struct_I
return _struct_I
_struct_2B = None
def _get_struct_2B():
global _struct_2B
if _struct_2B is None:
_struct_2B = struct.Struct("<2B")
return _struct_2B

View File

@@ -0,0 +1,317 @@
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from ur_msgs/IOStates.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import ur_msgs.msg
class IOStates(genpy.Message):
_md5sum = "0a5c7b73e3189e9a2caf8583d1bae2e2"
_type = "ur_msgs/IOStates"
_has_header = False #flag to mark the presence of a Header object
_full_text = """Digital[] digital_in_states
Digital[] digital_out_states
Digital[] flag_states
Analog[] analog_in_states
Analog[] analog_out_states
================================================================================
MSG: ur_msgs/Digital
uint8 pin
bool state
================================================================================
MSG: ur_msgs/Analog
uint8 pin
float32 state
"""
__slots__ = ['digital_in_states','digital_out_states','flag_states','analog_in_states','analog_out_states']
_slot_types = ['ur_msgs/Digital[]','ur_msgs/Digital[]','ur_msgs/Digital[]','ur_msgs/Analog[]','ur_msgs/Analog[]']
def __init__(self, *args, **kwds):
"""
Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments.
The available fields are:
digital_in_states,digital_out_states,flag_states,analog_in_states,analog_out_states
:param args: complete set of field values, in .msg order
:param kwds: use keyword arguments corresponding to message field names
to set specific fields.
"""
if args or kwds:
super(IOStates, self).__init__(*args, **kwds)
#message fields cannot be None, assign default values for those that are
if self.digital_in_states is None:
self.digital_in_states = []
if self.digital_out_states is None:
self.digital_out_states = []
if self.flag_states is None:
self.flag_states = []
if self.analog_in_states is None:
self.analog_in_states = []
if self.analog_out_states is None:
self.analog_out_states = []
else:
self.digital_in_states = []
self.digital_out_states = []
self.flag_states = []
self.analog_in_states = []
self.analog_out_states = []
def _get_types(self):
"""
internal API method
"""
return self._slot_types
def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
length = len(self.digital_in_states)
buff.write(_struct_I.pack(length))
for val1 in self.digital_in_states:
_x = val1
buff.write(_get_struct_2B().pack(_x.pin, _x.state))
length = len(self.digital_out_states)
buff.write(_struct_I.pack(length))
for val1 in self.digital_out_states:
_x = val1
buff.write(_get_struct_2B().pack(_x.pin, _x.state))
length = len(self.flag_states)
buff.write(_struct_I.pack(length))
for val1 in self.flag_states:
_x = val1
buff.write(_get_struct_2B().pack(_x.pin, _x.state))
length = len(self.analog_in_states)
buff.write(_struct_I.pack(length))
for val1 in self.analog_in_states:
_x = val1
buff.write(_get_struct_Bf().pack(_x.pin, _x.state))
length = len(self.analog_out_states)
buff.write(_struct_I.pack(length))
for val1 in self.analog_out_states:
_x = val1
buff.write(_get_struct_Bf().pack(_x.pin, _x.state))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize(self, str):
"""
unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str``
"""
try:
if self.digital_in_states is None:
self.digital_in_states = None
if self.digital_out_states is None:
self.digital_out_states = None
if self.flag_states is None:
self.flag_states = None
if self.analog_in_states is None:
self.analog_in_states = None
if self.analog_out_states is None:
self.analog_out_states = None
end = 0
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
self.digital_in_states = []
for i in range(0, length):
val1 = ur_msgs.msg.Digital()
_x = val1
start = end
end += 2
(_x.pin, _x.state,) = _get_struct_2B().unpack(str[start:end])
val1.state = bool(val1.state)
self.digital_in_states.append(val1)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
self.digital_out_states = []
for i in range(0, length):
val1 = ur_msgs.msg.Digital()
_x = val1
start = end
end += 2
(_x.pin, _x.state,) = _get_struct_2B().unpack(str[start:end])
val1.state = bool(val1.state)
self.digital_out_states.append(val1)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
self.flag_states = []
for i in range(0, length):
val1 = ur_msgs.msg.Digital()
_x = val1
start = end
end += 2
(_x.pin, _x.state,) = _get_struct_2B().unpack(str[start:end])
val1.state = bool(val1.state)
self.flag_states.append(val1)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
self.analog_in_states = []
for i in range(0, length):
val1 = ur_msgs.msg.Analog()
_x = val1
start = end
end += 5
(_x.pin, _x.state,) = _get_struct_Bf().unpack(str[start:end])
self.analog_in_states.append(val1)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
self.analog_out_states = []
for i in range(0, length):
val1 = ur_msgs.msg.Analog()
_x = val1
start = end
end += 5
(_x.pin, _x.state,) = _get_struct_Bf().unpack(str[start:end])
self.analog_out_states.append(val1)
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
def serialize_numpy(self, buff, numpy):
"""
serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module
"""
try:
length = len(self.digital_in_states)
buff.write(_struct_I.pack(length))
for val1 in self.digital_in_states:
_x = val1
buff.write(_get_struct_2B().pack(_x.pin, _x.state))
length = len(self.digital_out_states)
buff.write(_struct_I.pack(length))
for val1 in self.digital_out_states:
_x = val1
buff.write(_get_struct_2B().pack(_x.pin, _x.state))
length = len(self.flag_states)
buff.write(_struct_I.pack(length))
for val1 in self.flag_states:
_x = val1
buff.write(_get_struct_2B().pack(_x.pin, _x.state))
length = len(self.analog_in_states)
buff.write(_struct_I.pack(length))
for val1 in self.analog_in_states:
_x = val1
buff.write(_get_struct_Bf().pack(_x.pin, _x.state))
length = len(self.analog_out_states)
buff.write(_struct_I.pack(length))
for val1 in self.analog_out_states:
_x = val1
buff.write(_get_struct_Bf().pack(_x.pin, _x.state))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize_numpy(self, str, numpy):
"""
unpack serialized message in str into this message instance using numpy for array types
:param str: byte array of serialized message, ``str``
:param numpy: numpy python module
"""
try:
if self.digital_in_states is None:
self.digital_in_states = None
if self.digital_out_states is None:
self.digital_out_states = None
if self.flag_states is None:
self.flag_states = None
if self.analog_in_states is None:
self.analog_in_states = None
if self.analog_out_states is None:
self.analog_out_states = None
end = 0
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
self.digital_in_states = []
for i in range(0, length):
val1 = ur_msgs.msg.Digital()
_x = val1
start = end
end += 2
(_x.pin, _x.state,) = _get_struct_2B().unpack(str[start:end])
val1.state = bool(val1.state)
self.digital_in_states.append(val1)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
self.digital_out_states = []
for i in range(0, length):
val1 = ur_msgs.msg.Digital()
_x = val1
start = end
end += 2
(_x.pin, _x.state,) = _get_struct_2B().unpack(str[start:end])
val1.state = bool(val1.state)
self.digital_out_states.append(val1)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
self.flag_states = []
for i in range(0, length):
val1 = ur_msgs.msg.Digital()
_x = val1
start = end
end += 2
(_x.pin, _x.state,) = _get_struct_2B().unpack(str[start:end])
val1.state = bool(val1.state)
self.flag_states.append(val1)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
self.analog_in_states = []
for i in range(0, length):
val1 = ur_msgs.msg.Analog()
_x = val1
start = end
end += 5
(_x.pin, _x.state,) = _get_struct_Bf().unpack(str[start:end])
self.analog_in_states.append(val1)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
self.analog_out_states = []
for i in range(0, length):
val1 = ur_msgs.msg.Analog()
_x = val1
start = end
end += 5
(_x.pin, _x.state,) = _get_struct_Bf().unpack(str[start:end])
self.analog_out_states.append(val1)
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
_struct_I = genpy.struct_I
def _get_struct_I():
global _struct_I
return _struct_I
_struct_Bf = None
def _get_struct_Bf():
global _struct_Bf
if _struct_Bf is None:
_struct_Bf = struct.Struct("<Bf")
return _struct_Bf
_struct_2B = None
def _get_struct_2B():
global _struct_2B
if _struct_2B is None:
_struct_2B = struct.Struct("<2B")
return _struct_2B

View File

@@ -0,0 +1,181 @@
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from ur_msgs/MasterboardDataMsg.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class MasterboardDataMsg(genpy.Message):
_md5sum = "807af5dc427082b111fa23d1fd2cd585"
_type = "ur_msgs/MasterboardDataMsg"
_has_header = False #flag to mark the presence of a Header object
_full_text = """# This data structure contains the MasterboardData structure
# used by the Universal Robots controller
#
# MasterboardData is part of the data structure being send on the
# secondary client communications interface
#
# This data structure is send at 10 Hz on TCP port 30002
#
# Documentation can be found on the Universal Robots Support site, article
# number 16496.
uint32 digital_input_bits
uint32 digital_output_bits
int8 analog_input_range0
int8 analog_input_range1
float64 analog_input0
float64 analog_input1
int8 analog_output_domain0
int8 analog_output_domain1
float64 analog_output0
float64 analog_output1
float32 masterboard_temperature
float32 robot_voltage_48V
float32 robot_current
float32 master_io_current
uint8 master_safety_state
uint8 master_onoff_state
"""
__slots__ = ['digital_input_bits','digital_output_bits','analog_input_range0','analog_input_range1','analog_input0','analog_input1','analog_output_domain0','analog_output_domain1','analog_output0','analog_output1','masterboard_temperature','robot_voltage_48V','robot_current','master_io_current','master_safety_state','master_onoff_state']
_slot_types = ['uint32','uint32','int8','int8','float64','float64','int8','int8','float64','float64','float32','float32','float32','float32','uint8','uint8']
def __init__(self, *args, **kwds):
"""
Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments.
The available fields are:
digital_input_bits,digital_output_bits,analog_input_range0,analog_input_range1,analog_input0,analog_input1,analog_output_domain0,analog_output_domain1,analog_output0,analog_output1,masterboard_temperature,robot_voltage_48V,robot_current,master_io_current,master_safety_state,master_onoff_state
:param args: complete set of field values, in .msg order
:param kwds: use keyword arguments corresponding to message field names
to set specific fields.
"""
if args or kwds:
super(MasterboardDataMsg, self).__init__(*args, **kwds)
#message fields cannot be None, assign default values for those that are
if self.digital_input_bits is None:
self.digital_input_bits = 0
if self.digital_output_bits is None:
self.digital_output_bits = 0
if self.analog_input_range0 is None:
self.analog_input_range0 = 0
if self.analog_input_range1 is None:
self.analog_input_range1 = 0
if self.analog_input0 is None:
self.analog_input0 = 0.
if self.analog_input1 is None:
self.analog_input1 = 0.
if self.analog_output_domain0 is None:
self.analog_output_domain0 = 0
if self.analog_output_domain1 is None:
self.analog_output_domain1 = 0
if self.analog_output0 is None:
self.analog_output0 = 0.
if self.analog_output1 is None:
self.analog_output1 = 0.
if self.masterboard_temperature is None:
self.masterboard_temperature = 0.
if self.robot_voltage_48V is None:
self.robot_voltage_48V = 0.
if self.robot_current is None:
self.robot_current = 0.
if self.master_io_current is None:
self.master_io_current = 0.
if self.master_safety_state is None:
self.master_safety_state = 0
if self.master_onoff_state is None:
self.master_onoff_state = 0
else:
self.digital_input_bits = 0
self.digital_output_bits = 0
self.analog_input_range0 = 0
self.analog_input_range1 = 0
self.analog_input0 = 0.
self.analog_input1 = 0.
self.analog_output_domain0 = 0
self.analog_output_domain1 = 0
self.analog_output0 = 0.
self.analog_output1 = 0.
self.masterboard_temperature = 0.
self.robot_voltage_48V = 0.
self.robot_current = 0.
self.master_io_current = 0.
self.master_safety_state = 0
self.master_onoff_state = 0
def _get_types(self):
"""
internal API method
"""
return self._slot_types
def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
_x = self
buff.write(_get_struct_2I2b2d2b2d4f2B().pack(_x.digital_input_bits, _x.digital_output_bits, _x.analog_input_range0, _x.analog_input_range1, _x.analog_input0, _x.analog_input1, _x.analog_output_domain0, _x.analog_output_domain1, _x.analog_output0, _x.analog_output1, _x.masterboard_temperature, _x.robot_voltage_48V, _x.robot_current, _x.master_io_current, _x.master_safety_state, _x.master_onoff_state))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize(self, str):
"""
unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str``
"""
try:
end = 0
_x = self
start = end
end += 62
(_x.digital_input_bits, _x.digital_output_bits, _x.analog_input_range0, _x.analog_input_range1, _x.analog_input0, _x.analog_input1, _x.analog_output_domain0, _x.analog_output_domain1, _x.analog_output0, _x.analog_output1, _x.masterboard_temperature, _x.robot_voltage_48V, _x.robot_current, _x.master_io_current, _x.master_safety_state, _x.master_onoff_state,) = _get_struct_2I2b2d2b2d4f2B().unpack(str[start:end])
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
def serialize_numpy(self, buff, numpy):
"""
serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module
"""
try:
_x = self
buff.write(_get_struct_2I2b2d2b2d4f2B().pack(_x.digital_input_bits, _x.digital_output_bits, _x.analog_input_range0, _x.analog_input_range1, _x.analog_input0, _x.analog_input1, _x.analog_output_domain0, _x.analog_output_domain1, _x.analog_output0, _x.analog_output1, _x.masterboard_temperature, _x.robot_voltage_48V, _x.robot_current, _x.master_io_current, _x.master_safety_state, _x.master_onoff_state))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize_numpy(self, str, numpy):
"""
unpack serialized message in str into this message instance using numpy for array types
:param str: byte array of serialized message, ``str``
:param numpy: numpy python module
"""
try:
end = 0
_x = self
start = end
end += 62
(_x.digital_input_bits, _x.digital_output_bits, _x.analog_input_range0, _x.analog_input_range1, _x.analog_input0, _x.analog_input1, _x.analog_output_domain0, _x.analog_output_domain1, _x.analog_output0, _x.analog_output1, _x.masterboard_temperature, _x.robot_voltage_48V, _x.robot_current, _x.master_io_current, _x.master_safety_state, _x.master_onoff_state,) = _get_struct_2I2b2d2b2d4f2B().unpack(str[start:end])
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
_struct_I = genpy.struct_I
def _get_struct_I():
global _struct_I
return _struct_I
_struct_2I2b2d2b2d4f2B = None
def _get_struct_2I2b2d2b2d4f2B():
global _struct_2I2b2d2b2d4f2B
if _struct_2I2b2d2b2d4f2B is None:
_struct_2I2b2d2b2d4f2B = struct.Struct("<2I2b2d2b2d4f2B")
return _struct_2I2b2d2b2d4f2B

View File

@@ -0,0 +1,159 @@
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from ur_msgs/RobotModeDataMsg.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class RobotModeDataMsg(genpy.Message):
_md5sum = "867308ca39e2cc0644b50db27deb661f"
_type = "ur_msgs/RobotModeDataMsg"
_has_header = False #flag to mark the presence of a Header object
_full_text = """# This data structure contains the RobotModeData structure
# used by the Universal Robots controller
#
# This data structure is send at 10 Hz on TCP port 30002
#
# Note: this message does not carry all fields from the RobotModeData structure as broadcast by the robot controller, but a subset.
uint64 timestamp
bool is_robot_connected
bool is_real_robot_enabled
bool is_power_on_robot
bool is_emergency_stopped
bool is_protective_stopped
bool is_program_running
bool is_program_paused
"""
__slots__ = ['timestamp','is_robot_connected','is_real_robot_enabled','is_power_on_robot','is_emergency_stopped','is_protective_stopped','is_program_running','is_program_paused']
_slot_types = ['uint64','bool','bool','bool','bool','bool','bool','bool']
def __init__(self, *args, **kwds):
"""
Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments.
The available fields are:
timestamp,is_robot_connected,is_real_robot_enabled,is_power_on_robot,is_emergency_stopped,is_protective_stopped,is_program_running,is_program_paused
:param args: complete set of field values, in .msg order
:param kwds: use keyword arguments corresponding to message field names
to set specific fields.
"""
if args or kwds:
super(RobotModeDataMsg, self).__init__(*args, **kwds)
#message fields cannot be None, assign default values for those that are
if self.timestamp is None:
self.timestamp = 0
if self.is_robot_connected is None:
self.is_robot_connected = False
if self.is_real_robot_enabled is None:
self.is_real_robot_enabled = False
if self.is_power_on_robot is None:
self.is_power_on_robot = False
if self.is_emergency_stopped is None:
self.is_emergency_stopped = False
if self.is_protective_stopped is None:
self.is_protective_stopped = False
if self.is_program_running is None:
self.is_program_running = False
if self.is_program_paused is None:
self.is_program_paused = False
else:
self.timestamp = 0
self.is_robot_connected = False
self.is_real_robot_enabled = False
self.is_power_on_robot = False
self.is_emergency_stopped = False
self.is_protective_stopped = False
self.is_program_running = False
self.is_program_paused = False
def _get_types(self):
"""
internal API method
"""
return self._slot_types
def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
_x = self
buff.write(_get_struct_Q7B().pack(_x.timestamp, _x.is_robot_connected, _x.is_real_robot_enabled, _x.is_power_on_robot, _x.is_emergency_stopped, _x.is_protective_stopped, _x.is_program_running, _x.is_program_paused))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize(self, str):
"""
unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str``
"""
try:
end = 0
_x = self
start = end
end += 15
(_x.timestamp, _x.is_robot_connected, _x.is_real_robot_enabled, _x.is_power_on_robot, _x.is_emergency_stopped, _x.is_protective_stopped, _x.is_program_running, _x.is_program_paused,) = _get_struct_Q7B().unpack(str[start:end])
self.is_robot_connected = bool(self.is_robot_connected)
self.is_real_robot_enabled = bool(self.is_real_robot_enabled)
self.is_power_on_robot = bool(self.is_power_on_robot)
self.is_emergency_stopped = bool(self.is_emergency_stopped)
self.is_protective_stopped = bool(self.is_protective_stopped)
self.is_program_running = bool(self.is_program_running)
self.is_program_paused = bool(self.is_program_paused)
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
def serialize_numpy(self, buff, numpy):
"""
serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module
"""
try:
_x = self
buff.write(_get_struct_Q7B().pack(_x.timestamp, _x.is_robot_connected, _x.is_real_robot_enabled, _x.is_power_on_robot, _x.is_emergency_stopped, _x.is_protective_stopped, _x.is_program_running, _x.is_program_paused))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize_numpy(self, str, numpy):
"""
unpack serialized message in str into this message instance using numpy for array types
:param str: byte array of serialized message, ``str``
:param numpy: numpy python module
"""
try:
end = 0
_x = self
start = end
end += 15
(_x.timestamp, _x.is_robot_connected, _x.is_real_robot_enabled, _x.is_power_on_robot, _x.is_emergency_stopped, _x.is_protective_stopped, _x.is_program_running, _x.is_program_paused,) = _get_struct_Q7B().unpack(str[start:end])
self.is_robot_connected = bool(self.is_robot_connected)
self.is_real_robot_enabled = bool(self.is_real_robot_enabled)
self.is_power_on_robot = bool(self.is_power_on_robot)
self.is_emergency_stopped = bool(self.is_emergency_stopped)
self.is_protective_stopped = bool(self.is_protective_stopped)
self.is_program_running = bool(self.is_program_running)
self.is_program_paused = bool(self.is_program_paused)
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
_struct_I = genpy.struct_I
def _get_struct_I():
global _struct_I
return _struct_I
_struct_Q7B = None
def _get_struct_Q7B():
global _struct_Q7B
if _struct_Q7B is None:
_struct_Q7B = struct.Struct("<Q7B")
return _struct_Q7B

View File

@@ -0,0 +1,520 @@
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from ur_msgs/RobotStateRTMsg.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class RobotStateRTMsg(genpy.Message):
_md5sum = "ce6feddd3ccb4ca7dbcd0ff105b603c7"
_type = "ur_msgs/RobotStateRTMsg"
_has_header = False #flag to mark the presence of a Header object
_full_text = """# Data structure for the realtime communications interface (aka Matlab interface)
# used by the Universal Robots controller
#
# This data structure is send at 125 Hz on TCP port 30003
#
# Dokumentation can be found on the Universal Robots Support Wiki
# (http://wiki03.lynero.net/Technical/RealTimeClientInterface?rev=9)
float64 time
float64[] q_target
float64[] qd_target
float64[] qdd_target
float64[] i_target
float64[] m_target
float64[] q_actual
float64[] qd_actual
float64[] i_actual
float64[] tool_acc_values
float64[] tcp_force
float64[] tool_vector
float64[] tcp_speed
float64 digital_input_bits
float64[] motor_temperatures
float64 controller_timer
float64 test_value
float64 robot_mode
float64[] joint_modes
"""
__slots__ = ['time','q_target','qd_target','qdd_target','i_target','m_target','q_actual','qd_actual','i_actual','tool_acc_values','tcp_force','tool_vector','tcp_speed','digital_input_bits','motor_temperatures','controller_timer','test_value','robot_mode','joint_modes']
_slot_types = ['float64','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64[]','float64','float64[]','float64','float64','float64','float64[]']
def __init__(self, *args, **kwds):
"""
Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments.
The available fields are:
time,q_target,qd_target,qdd_target,i_target,m_target,q_actual,qd_actual,i_actual,tool_acc_values,tcp_force,tool_vector,tcp_speed,digital_input_bits,motor_temperatures,controller_timer,test_value,robot_mode,joint_modes
:param args: complete set of field values, in .msg order
:param kwds: use keyword arguments corresponding to message field names
to set specific fields.
"""
if args or kwds:
super(RobotStateRTMsg, self).__init__(*args, **kwds)
#message fields cannot be None, assign default values for those that are
if self.time is None:
self.time = 0.
if self.q_target is None:
self.q_target = []
if self.qd_target is None:
self.qd_target = []
if self.qdd_target is None:
self.qdd_target = []
if self.i_target is None:
self.i_target = []
if self.m_target is None:
self.m_target = []
if self.q_actual is None:
self.q_actual = []
if self.qd_actual is None:
self.qd_actual = []
if self.i_actual is None:
self.i_actual = []
if self.tool_acc_values is None:
self.tool_acc_values = []
if self.tcp_force is None:
self.tcp_force = []
if self.tool_vector is None:
self.tool_vector = []
if self.tcp_speed is None:
self.tcp_speed = []
if self.digital_input_bits is None:
self.digital_input_bits = 0.
if self.motor_temperatures is None:
self.motor_temperatures = []
if self.controller_timer is None:
self.controller_timer = 0.
if self.test_value is None:
self.test_value = 0.
if self.robot_mode is None:
self.robot_mode = 0.
if self.joint_modes is None:
self.joint_modes = []
else:
self.time = 0.
self.q_target = []
self.qd_target = []
self.qdd_target = []
self.i_target = []
self.m_target = []
self.q_actual = []
self.qd_actual = []
self.i_actual = []
self.tool_acc_values = []
self.tcp_force = []
self.tool_vector = []
self.tcp_speed = []
self.digital_input_bits = 0.
self.motor_temperatures = []
self.controller_timer = 0.
self.test_value = 0.
self.robot_mode = 0.
self.joint_modes = []
def _get_types(self):
"""
internal API method
"""
return self._slot_types
def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
buff.write(_get_struct_d().pack(self.time))
length = len(self.q_target)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.q_target))
length = len(self.qd_target)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.qd_target))
length = len(self.qdd_target)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.qdd_target))
length = len(self.i_target)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.i_target))
length = len(self.m_target)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.m_target))
length = len(self.q_actual)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.q_actual))
length = len(self.qd_actual)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.qd_actual))
length = len(self.i_actual)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.i_actual))
length = len(self.tool_acc_values)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.tool_acc_values))
length = len(self.tcp_force)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.tcp_force))
length = len(self.tool_vector)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.tool_vector))
length = len(self.tcp_speed)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.tcp_speed))
buff.write(_get_struct_d().pack(self.digital_input_bits))
length = len(self.motor_temperatures)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.motor_temperatures))
_x = self
buff.write(_get_struct_3d().pack(_x.controller_timer, _x.test_value, _x.robot_mode))
length = len(self.joint_modes)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(struct.pack(pattern, *self.joint_modes))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize(self, str):
"""
unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str``
"""
try:
end = 0
start = end
end += 8
(self.time,) = _get_struct_d().unpack(str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.q_target = struct.unpack(pattern, str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.qd_target = struct.unpack(pattern, str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.qdd_target = struct.unpack(pattern, str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.i_target = struct.unpack(pattern, str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.m_target = struct.unpack(pattern, str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.q_actual = struct.unpack(pattern, str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.qd_actual = struct.unpack(pattern, str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.i_actual = struct.unpack(pattern, str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.tool_acc_values = struct.unpack(pattern, str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.tcp_force = struct.unpack(pattern, str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.tool_vector = struct.unpack(pattern, str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.tcp_speed = struct.unpack(pattern, str[start:end])
start = end
end += 8
(self.digital_input_bits,) = _get_struct_d().unpack(str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.motor_temperatures = struct.unpack(pattern, str[start:end])
_x = self
start = end
end += 24
(_x.controller_timer, _x.test_value, _x.robot_mode,) = _get_struct_3d().unpack(str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.joint_modes = struct.unpack(pattern, str[start:end])
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
def serialize_numpy(self, buff, numpy):
"""
serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module
"""
try:
buff.write(_get_struct_d().pack(self.time))
length = len(self.q_target)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.q_target.tostring())
length = len(self.qd_target)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.qd_target.tostring())
length = len(self.qdd_target)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.qdd_target.tostring())
length = len(self.i_target)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.i_target.tostring())
length = len(self.m_target)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.m_target.tostring())
length = len(self.q_actual)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.q_actual.tostring())
length = len(self.qd_actual)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.qd_actual.tostring())
length = len(self.i_actual)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.i_actual.tostring())
length = len(self.tool_acc_values)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.tool_acc_values.tostring())
length = len(self.tcp_force)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.tcp_force.tostring())
length = len(self.tool_vector)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.tool_vector.tostring())
length = len(self.tcp_speed)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.tcp_speed.tostring())
buff.write(_get_struct_d().pack(self.digital_input_bits))
length = len(self.motor_temperatures)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.motor_temperatures.tostring())
_x = self
buff.write(_get_struct_3d().pack(_x.controller_timer, _x.test_value, _x.robot_mode))
length = len(self.joint_modes)
buff.write(_struct_I.pack(length))
pattern = '<%sd'%length
buff.write(self.joint_modes.tostring())
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize_numpy(self, str, numpy):
"""
unpack serialized message in str into this message instance using numpy for array types
:param str: byte array of serialized message, ``str``
:param numpy: numpy python module
"""
try:
end = 0
start = end
end += 8
(self.time,) = _get_struct_d().unpack(str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.q_target = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.qd_target = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.qdd_target = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.i_target = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.m_target = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.q_actual = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.qd_actual = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.i_actual = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.tool_acc_values = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.tcp_force = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.tool_vector = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.tcp_speed = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
start = end
end += 8
(self.digital_input_bits,) = _get_struct_d().unpack(str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.motor_temperatures = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
_x = self
start = end
end += 24
(_x.controller_timer, _x.test_value, _x.robot_mode,) = _get_struct_3d().unpack(str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
pattern = '<%sd'%length
start = end
end += struct.calcsize(pattern)
self.joint_modes = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
_struct_I = genpy.struct_I
def _get_struct_I():
global _struct_I
return _struct_I
_struct_d = None
def _get_struct_d():
global _struct_d
if _struct_d is None:
_struct_d = struct.Struct("<d")
return _struct_d
_struct_3d = None
def _get_struct_3d():
global _struct_3d
if _struct_3d is None:
_struct_3d = struct.Struct("<3d")
return _struct_3d

View File

@@ -0,0 +1,160 @@
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from ur_msgs/ToolDataMsg.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class ToolDataMsg(genpy.Message):
_md5sum = "404fc266f37d89f75b372d12fa94a122"
_type = "ur_msgs/ToolDataMsg"
_has_header = False #flag to mark the presence of a Header object
_full_text = """# This data structure contains the ToolData structure
# used by the Universal Robots controller
int8 ANALOG_INPUT_RANGE_CURRENT = 0
int8 ANALOG_INPUT_RANGE_VOLTAGE = 1
int8 analog_input_range2 # one of ANALOG_INPUT_RANGE_*
int8 analog_input_range3 # one of ANALOG_INPUT_RANGE_*
float64 analog_input2
float64 analog_input3
float32 tool_voltage_48v
uint8 tool_output_voltage
float32 tool_current
float32 tool_temperature
uint8 TOOL_BOOTLOADER_MODE = 249
uint8 TOOL_RUNNING_MODE = 253
uint8 TOOL_IDLE_MODE = 255
uint8 tool_mode # one of TOOL_*
"""
# Pseudo-constants
ANALOG_INPUT_RANGE_CURRENT = 0
ANALOG_INPUT_RANGE_VOLTAGE = 1
TOOL_BOOTLOADER_MODE = 249
TOOL_RUNNING_MODE = 253
TOOL_IDLE_MODE = 255
__slots__ = ['analog_input_range2','analog_input_range3','analog_input2','analog_input3','tool_voltage_48v','tool_output_voltage','tool_current','tool_temperature','tool_mode']
_slot_types = ['int8','int8','float64','float64','float32','uint8','float32','float32','uint8']
def __init__(self, *args, **kwds):
"""
Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments.
The available fields are:
analog_input_range2,analog_input_range3,analog_input2,analog_input3,tool_voltage_48v,tool_output_voltage,tool_current,tool_temperature,tool_mode
:param args: complete set of field values, in .msg order
:param kwds: use keyword arguments corresponding to message field names
to set specific fields.
"""
if args or kwds:
super(ToolDataMsg, self).__init__(*args, **kwds)
#message fields cannot be None, assign default values for those that are
if self.analog_input_range2 is None:
self.analog_input_range2 = 0
if self.analog_input_range3 is None:
self.analog_input_range3 = 0
if self.analog_input2 is None:
self.analog_input2 = 0.
if self.analog_input3 is None:
self.analog_input3 = 0.
if self.tool_voltage_48v is None:
self.tool_voltage_48v = 0.
if self.tool_output_voltage is None:
self.tool_output_voltage = 0
if self.tool_current is None:
self.tool_current = 0.
if self.tool_temperature is None:
self.tool_temperature = 0.
if self.tool_mode is None:
self.tool_mode = 0
else:
self.analog_input_range2 = 0
self.analog_input_range3 = 0
self.analog_input2 = 0.
self.analog_input3 = 0.
self.tool_voltage_48v = 0.
self.tool_output_voltage = 0
self.tool_current = 0.
self.tool_temperature = 0.
self.tool_mode = 0
def _get_types(self):
"""
internal API method
"""
return self._slot_types
def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
_x = self
buff.write(_get_struct_2b2dfB2fB().pack(_x.analog_input_range2, _x.analog_input_range3, _x.analog_input2, _x.analog_input3, _x.tool_voltage_48v, _x.tool_output_voltage, _x.tool_current, _x.tool_temperature, _x.tool_mode))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize(self, str):
"""
unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str``
"""
try:
end = 0
_x = self
start = end
end += 32
(_x.analog_input_range2, _x.analog_input_range3, _x.analog_input2, _x.analog_input3, _x.tool_voltage_48v, _x.tool_output_voltage, _x.tool_current, _x.tool_temperature, _x.tool_mode,) = _get_struct_2b2dfB2fB().unpack(str[start:end])
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
def serialize_numpy(self, buff, numpy):
"""
serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module
"""
try:
_x = self
buff.write(_get_struct_2b2dfB2fB().pack(_x.analog_input_range2, _x.analog_input_range3, _x.analog_input2, _x.analog_input3, _x.tool_voltage_48v, _x.tool_output_voltage, _x.tool_current, _x.tool_temperature, _x.tool_mode))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize_numpy(self, str, numpy):
"""
unpack serialized message in str into this message instance using numpy for array types
:param str: byte array of serialized message, ``str``
:param numpy: numpy python module
"""
try:
end = 0
_x = self
start = end
end += 32
(_x.analog_input_range2, _x.analog_input_range3, _x.analog_input2, _x.analog_input3, _x.tool_voltage_48v, _x.tool_output_voltage, _x.tool_current, _x.tool_temperature, _x.tool_mode,) = _get_struct_2b2dfB2fB().unpack(str[start:end])
return self
except struct.error as e:
raise genpy.DeserializationError(e) #most likely buffer underfill
_struct_I = genpy.struct_I
def _get_struct_I():
global _struct_I
return _struct_I
_struct_2b2dfB2fB = None
def _get_struct_2b2dfB2fB():
global _struct_2b2dfB2fB
if _struct_2b2dfB2fB is None:
_struct_2b2dfB2fB = struct.Struct("<2b2dfB2fB")
return _struct_2b2dfB2fB

View File

@@ -0,0 +1,7 @@
from ._Analog import *
from ._Digital import *
from ._IOStates import *
from ._MasterboardDataMsg import *
from ._RobotModeDataMsg import *
from ._RobotStateRTMsg import *
from ._ToolDataMsg import *