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.header is None: self.header = std_msgs.msg.Header() if self.tslc is None: self.tslc = genpy.Duration() end = 0 _x = self start = end end += 12 ( _x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs, ) = _get_struct_3I().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.header.frame_id = str[start:end].decode('utf-8') else: self.header.frame_id = str[start:end] start = end end += 4 (self.ICAO_address, ) = _get_struct_I().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.callsign = str[start:end].decode('utf-8') else: self.callsign = str[start:end] _x = self start = end end += 46 ( _x.latitude, _x.longitude, _x.altitude, _x.heading, _x.hor_velocity, _x.ver_velocity, _x.altitude_type, _x.emitter_type, _x.tslc.secs, _x.tslc.nsecs, _x.flags, _x.squawk, ) = _get_struct_2d4f2B2i2H().unpack(str[start:end]) self.tslc.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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.header is None: self.header = std_msgs.msg.Header() if self.position is None: self.position = geometry_msgs.msg.Point() if self.outline_color is None: self.outline_color = std_msgs.msg.ColorRGBA() if self.fill_color is None: self.fill_color = std_msgs.msg.ColorRGBA() if self.lifetime is None: self.lifetime = genpy.Duration() if self.points is None: self.points = None if self.outline_colors is None: self.outline_colors = None end = 0 _x = self start = end end += 12 ( _x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs, ) = _struct_3I.unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.header.frame_id = str[start:end].decode('utf-8') else: self.header.frame_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.ns = str[start:end].decode('utf-8') else: self.ns = str[start:end] _x = self start = end end += 81 ( _x.id, _x.type, _x.action, _x.position.x, _x.position.y, _x.position.z, _x.scale, _x.outline_color.r, _x.outline_color.g, _x.outline_color.b, _x.outline_color.a, _x.filled, _x.fill_color.r, _x.fill_color.g, _x.fill_color.b, _x.fill_color.a, _x.lifetime.secs, _x.lifetime.nsecs, ) = _struct_3i3d5fB4f2i.unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.points = [] for i in range(0, length): val1 = geometry_msgs.msg.Point() _x = val1 start = end end += 24 ( _x.x, _x.y, _x.z, ) = _struct_3d.unpack(str[start:end]) self.points.append(val1) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.outline_colors = [] for i in range(0, length): val1 = std_msgs.msg.ColorRGBA() _x = val1 start = end end += 16 ( _x.r, _x.g, _x.b, _x.a, ) = _struct_4f.unpack(str[start:end]) self.outline_colors.append(val1) self.lifetime.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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.header is None: self.header = std_msgs.msg.Header() if self.goal is None: self.goal = None if self.initial_point is None: self.initial_point = ee_cart_imped_msgs.msg.StiffPoint() if self.desired is None: self.desired = ee_cart_imped_msgs.msg.StiffPoint() if self.actual_pose is None: self.actual_pose = ee_cart_imped_msgs.msg.StiffPoint() if self.running_time is None: self.running_time = genpy.Duration() end = 0 _x = self start = end end += 12 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.header.frame_id = str[start:end].decode('utf-8') else: self.header.frame_id = str[start:end] start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) self.goal = [] for i in range(0, length): val1 = ee_cart_imped_msgs.msg.StiffPoint() _v28 = val1.header start = end end += 4 (_v28.seq,) = _struct_I.unpack(str[start:end]) _v29 = _v28.stamp _x = _v29 start = end end += 8 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: _v28.frame_id = str[start:end].decode('utf-8') else: _v28.frame_id = str[start:end] _v30 = val1.pose _v31 = _v30.position _x = _v31 start = end end += 24 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) _v32 = _v30.orientation _x = _v32 start = end end += 32 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) _v33 = val1.wrench_or_stiffness _v34 = _v33.force _x = _v34 start = end end += 24 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) _v35 = _v33.torque _x = _v35 start = end end += 24 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) _x = val1 start = end end += 6 (_x.isForceX, _x.isForceY, _x.isForceZ, _x.isTorqueX, _x.isTorqueY, _x.isTorqueZ,) = _struct_6B.unpack(str[start:end]) val1.isForceX = bool(val1.isForceX) val1.isForceY = bool(val1.isForceY) val1.isForceZ = bool(val1.isForceZ) val1.isTorqueX = bool(val1.isTorqueX) val1.isTorqueY = bool(val1.isTorqueY) val1.isTorqueZ = bool(val1.isTorqueZ) _v36 = val1.time_from_start _x = _v36 start = end end += 8 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) self.goal.append(val1) _x = self start = end end += 12 (_x.initial_point.header.seq, _x.initial_point.header.stamp.secs, _x.initial_point.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.initial_point.header.frame_id = str[start:end].decode('utf-8') else: self.initial_point.header.frame_id = str[start:end] _x = self start = end end += 130 (_x.initial_point.pose.position.x, _x.initial_point.pose.position.y, _x.initial_point.pose.position.z, _x.initial_point.pose.orientation.x, _x.initial_point.pose.orientation.y, _x.initial_point.pose.orientation.z, _x.initial_point.pose.orientation.w, _x.initial_point.wrench_or_stiffness.force.x, _x.initial_point.wrench_or_stiffness.force.y, _x.initial_point.wrench_or_stiffness.force.z, _x.initial_point.wrench_or_stiffness.torque.x, _x.initial_point.wrench_or_stiffness.torque.y, _x.initial_point.wrench_or_stiffness.torque.z, _x.initial_point.isForceX, _x.initial_point.isForceY, _x.initial_point.isForceZ, _x.initial_point.isTorqueX, _x.initial_point.isTorqueY, _x.initial_point.isTorqueZ, _x.initial_point.time_from_start.secs, _x.initial_point.time_from_start.nsecs, _x.desired.header.seq, _x.desired.header.stamp.secs, _x.desired.header.stamp.nsecs,) = _struct_13d6B2i3I.unpack(str[start:end]) self.initial_point.isForceX = bool(self.initial_point.isForceX) self.initial_point.isForceY = bool(self.initial_point.isForceY) self.initial_point.isForceZ = bool(self.initial_point.isForceZ) self.initial_point.isTorqueX = bool(self.initial_point.isTorqueX) self.initial_point.isTorqueY = bool(self.initial_point.isTorqueY) self.initial_point.isTorqueZ = bool(self.initial_point.isTorqueZ) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.desired.header.frame_id = str[start:end].decode('utf-8') else: self.desired.header.frame_id = str[start:end] _x = self start = end end += 130 (_x.desired.pose.position.x, _x.desired.pose.position.y, _x.desired.pose.position.z, _x.desired.pose.orientation.x, _x.desired.pose.orientation.y, _x.desired.pose.orientation.z, _x.desired.pose.orientation.w, _x.desired.wrench_or_stiffness.force.x, _x.desired.wrench_or_stiffness.force.y, _x.desired.wrench_or_stiffness.force.z, _x.desired.wrench_or_stiffness.torque.x, _x.desired.wrench_or_stiffness.torque.y, _x.desired.wrench_or_stiffness.torque.z, _x.desired.isForceX, _x.desired.isForceY, _x.desired.isForceZ, _x.desired.isTorqueX, _x.desired.isTorqueY, _x.desired.isTorqueZ, _x.desired.time_from_start.secs, _x.desired.time_from_start.nsecs, _x.actual_pose.header.seq, _x.actual_pose.header.stamp.secs, _x.actual_pose.header.stamp.nsecs,) = _struct_13d6B2i3I.unpack(str[start:end]) self.desired.isForceX = bool(self.desired.isForceX) self.desired.isForceY = bool(self.desired.isForceY) self.desired.isForceZ = bool(self.desired.isForceZ) self.desired.isTorqueX = bool(self.desired.isTorqueX) self.desired.isTorqueY = bool(self.desired.isTorqueY) self.desired.isTorqueZ = bool(self.desired.isTorqueZ) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.actual_pose.header.frame_id = str[start:end].decode('utf-8') else: self.actual_pose.header.frame_id = str[start:end] _x = self start = end end += 126 (_x.actual_pose.pose.position.x, _x.actual_pose.pose.position.y, _x.actual_pose.pose.position.z, _x.actual_pose.pose.orientation.x, _x.actual_pose.pose.orientation.y, _x.actual_pose.pose.orientation.z, _x.actual_pose.pose.orientation.w, _x.actual_pose.wrench_or_stiffness.force.x, _x.actual_pose.wrench_or_stiffness.force.y, _x.actual_pose.wrench_or_stiffness.force.z, _x.actual_pose.wrench_or_stiffness.torque.x, _x.actual_pose.wrench_or_stiffness.torque.y, _x.actual_pose.wrench_or_stiffness.torque.z, _x.actual_pose.isForceX, _x.actual_pose.isForceY, _x.actual_pose.isForceZ, _x.actual_pose.isTorqueX, _x.actual_pose.isTorqueY, _x.actual_pose.isTorqueZ, _x.actual_pose.time_from_start.secs, _x.actual_pose.time_from_start.nsecs, _x.effort_sq_error,) = _struct_13d6B2id.unpack(str[start:end]) self.actual_pose.isForceX = bool(self.actual_pose.isForceX) self.actual_pose.isForceY = bool(self.actual_pose.isForceY) self.actual_pose.isForceZ = bool(self.actual_pose.isForceZ) self.actual_pose.isTorqueX = bool(self.actual_pose.isTorqueX) self.actual_pose.isTorqueY = bool(self.actual_pose.isTorqueY) self.actual_pose.isTorqueZ = bool(self.actual_pose.isTorqueZ) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) pattern = '<%sd'%length start = end end += struct.calcsize(pattern) self.requested_joint_efforts = 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.actual_joint_efforts = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) _x = self start = end end += 8 (_x.running_time.secs, _x.running_time.nsecs,) = _struct_2i.unpack(str[start:end]) self.running_time.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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: header,hardware_id,mcu_uptime,connection_uptime,drivers_active,driver_external_stop_present,driver_external_stop_stopped,measured_battery,measured_12v,measured_5v,drive_current,user_current,computer_current,total_current,total_current_peak,total_power_consumed :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(Status, self).__init__(*args, **kwds) #message fields cannot be None, assign default values for those that are if self.header is None: self.header = std_msgs.msg.Header() if self.hardware_id is None: self.hardware_id = '' if self.mcu_uptime is None: self.mcu_uptime = genpy.Duration() if self.connection_uptime is None: self.connection_uptime = genpy.Duration() if self.drivers_active is None: self.drivers_active = False if self.driver_external_stop_present is None: self.driver_external_stop_present = False if self.driver_external_stop_stopped is None: self.driver_external_stop_stopped = False if self.measured_battery is None: self.measured_battery = 0. if self.measured_12v is None: self.measured_12v = 0. if self.measured_5v is None: self.measured_5v = 0. if self.drive_current is None: self.drive_current = 0. if self.user_current is None: self.user_current = 0. if self.computer_current is None: self.computer_current = 0. if self.total_current is None: self.total_current = 0. if self.total_current_peak is None: self.total_current_peak = 0. if self.total_power_consumed is None: self.total_power_consumed = 0. else: self.header = std_msgs.msg.Header() self.hardware_id = '' self.mcu_uptime = genpy.Duration() self.connection_uptime = genpy.Duration() self.drivers_active = False self.driver_external_stop_present = False self.driver_external_stop_stopped = False self.measured_battery = 0. self.measured_12v = 0. self.measured_5v = 0. self.drive_current = 0. self.user_current = 0. self.computer_current = 0. self.total_current = 0. self.total_current_peak = 0. self.total_power_consumed = 0.
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: header,ns,id,type,action,pose,scale,color,lifetime,frame_locked,points,colors,text,mesh_resource,mesh_use_embedded_materials :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(Marker, self).__init__(*args, **kwds) #message fields cannot be None, assign default values for those that are if self.header is None: self.header = std_msgs.msg.Header() if self.ns is None: self.ns = '' if self.id is None: self.id = 0 if self.type is None: self.type = 0 if self.action is None: self.action = 0 if self.pose is None: self.pose = geometry_msgs.msg.Pose() if self.scale is None: self.scale = geometry_msgs.msg.Vector3() if self.color is None: self.color = std_msgs.msg.ColorRGBA() if self.lifetime is None: self.lifetime = genpy.Duration() if self.frame_locked is None: self.frame_locked = False if self.points is None: self.points = [] if self.colors is None: self.colors = [] if self.text is None: self.text = '' if self.mesh_resource is None: self.mesh_resource = '' if self.mesh_use_embedded_materials is None: self.mesh_use_embedded_materials = False else: self.header = std_msgs.msg.Header() self.ns = '' self.id = 0 self.type = 0 self.action = 0 self.pose = geometry_msgs.msg.Pose() self.scale = geometry_msgs.msg.Vector3() self.color = std_msgs.msg.ColorRGBA() self.lifetime = genpy.Duration() self.frame_locked = False self.points = [] self.colors = [] self.text = '' self.mesh_resource = '' self.mesh_use_embedded_materials = False
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.t is None: self.t = genpy.Time() if self.d is None: self.d = genpy.Duration() end = 0 start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.caller_id = str[start:end].decode('utf-8') else: self.caller_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.orig_caller_id = str[start:end].decode('utf-8') else: self.orig_caller_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.str = str[start:end].decode('utf-8') else: self.str = str[start:end] _x = self start = end end += 58 ( _x.b, _x.int16, _x.int32, _x.int64, _x.c, _x.uint16, _x.uint32, _x.uint64, _x.float32, _x.float64, _x.t.secs, _x.t.nsecs, _x.d.secs, _x.d.nsecs, ) = _struct_bhiqBHIQfd2I2i.unpack(str[start:end]) self.t.canon() self.d.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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.header is None: self.header = std_msgs.msg.Header() if self.capture_time is None: self.capture_time = genpy.Time() if self.timetrack is None: self.timetrack = genpy.Duration() if self.center is None: self.center = geometry_msgs.msg.Point() if self.keypoints is None: self.keypoints = None end = 0 _x = self start = end end += 12 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.header.frame_id = str[start:end].decode('utf-8') else: self.header.frame_id = str[start:end] start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.id = str[start:end].decode('utf-8') else: self.id = str[start:end] _x = self start = end end += 16 (_x.capture_time.secs, _x.capture_time.nsecs, _x.timetrack.secs, _x.timetrack.nsecs,) = _struct_2I2i.unpack(str[start:end]) start = end end += 16 self.bb = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=4) _x = self start = end end += 32 (_x.center.x, _x.center.y, _x.center.z, _x.size, _x.rotation,) = _struct_3d2f.unpack(str[start:end]) self.keypoints = [] for i in range(0, 5): val1 = geometry_msgs.msg.Point() _x = val1 start = end end += 24 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) self.keypoints.append(val1) start = end end += 4 (self.confidence,) = _struct_f.unpack(str[start:end]) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.name = str[start:end].decode('utf-8') else: self.name = str[start:end] self.capture_time.canon() self.timetrack.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
def deserialize(self, str): """ unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str`` """ try: if self.header is None: self.header = std_msgs.msg.Header() if self.goal is None: self.goal = None if self.initial_point is None: self.initial_point = ee_cart_imped_msgs.msg.StiffPoint() if self.desired is None: self.desired = ee_cart_imped_msgs.msg.StiffPoint() if self.actual_pose is None: self.actual_pose = ee_cart_imped_msgs.msg.StiffPoint() if self.actual_force is None: self.actual_force = geometry_msgs.msg.Wrench() if self.running_time is None: self.running_time = genpy.Duration() end = 0 _x = self start = end end += 12 ( _x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs, ) = _struct_3I.unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.header.frame_id = str[start:end].decode('utf-8') else: self.header.frame_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.goal = [] for i in range(0, length): val1 = ee_cart_imped_msgs.msg.StiffPoint() _v11 = val1.header start = end end += 4 (_v11.seq, ) = _struct_I.unpack(str[start:end]) _v12 = _v11.stamp _x = _v12 start = end end += 8 ( _x.secs, _x.nsecs, ) = _struct_2I.unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: _v11.frame_id = str[start:end].decode('utf-8') else: _v11.frame_id = str[start:end] _v13 = val1.pose _v14 = _v13.position _x = _v14 start = end end += 24 ( _x.x, _x.y, _x.z, ) = _struct_3d.unpack(str[start:end]) _v15 = _v13.orientation _x = _v15 start = end end += 32 ( _x.x, _x.y, _x.z, _x.w, ) = _struct_4d.unpack(str[start:end]) _v16 = val1.wrench_or_stiffness _v17 = _v16.force _x = _v17 start = end end += 24 ( _x.x, _x.y, _x.z, ) = _struct_3d.unpack(str[start:end]) _v18 = _v16.torque _x = _v18 start = end end += 24 ( _x.x, _x.y, _x.z, ) = _struct_3d.unpack(str[start:end]) _x = val1 start = end end += 6 ( _x.isForceX, _x.isForceY, _x.isForceZ, _x.isTorqueX, _x.isTorqueY, _x.isTorqueZ, ) = _struct_6B.unpack(str[start:end]) val1.isForceX = bool(val1.isForceX) val1.isForceY = bool(val1.isForceY) val1.isForceZ = bool(val1.isForceZ) val1.isTorqueX = bool(val1.isTorqueX) val1.isTorqueY = bool(val1.isTorqueY) val1.isTorqueZ = bool(val1.isTorqueZ) _v19 = val1.forceDirection _x = _v19 start = end end += 32 ( _x.x, _x.y, _x.z, _x.w, ) = _struct_4d.unpack(str[start:end]) _v20 = val1.time_from_start _x = _v20 start = end end += 8 ( _x.secs, _x.nsecs, ) = _struct_2i.unpack(str[start:end]) self.goal.append(val1) _x = self start = end end += 12 ( _x.initial_point.header.seq, _x.initial_point.header.stamp.secs, _x.initial_point.header.stamp.nsecs, ) = _struct_3I.unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.initial_point.header.frame_id = str[start:end].decode( 'utf-8') else: self.initial_point.header.frame_id = str[start:end] _x = self start = end end += 162 ( _x.initial_point.pose.position.x, _x.initial_point.pose.position.y, _x.initial_point.pose.position.z, _x.initial_point.pose.orientation.x, _x.initial_point.pose.orientation.y, _x.initial_point.pose.orientation.z, _x.initial_point.pose.orientation.w, _x.initial_point.wrench_or_stiffness.force.x, _x.initial_point.wrench_or_stiffness.force.y, _x.initial_point.wrench_or_stiffness.force.z, _x.initial_point.wrench_or_stiffness.torque.x, _x.initial_point.wrench_or_stiffness.torque.y, _x.initial_point.wrench_or_stiffness.torque.z, _x.initial_point.isForceX, _x.initial_point.isForceY, _x.initial_point.isForceZ, _x.initial_point.isTorqueX, _x.initial_point.isTorqueY, _x.initial_point.isTorqueZ, _x.initial_point.forceDirection.x, _x.initial_point.forceDirection.y, _x.initial_point.forceDirection.z, _x.initial_point.forceDirection.w, _x.initial_point.time_from_start.secs, _x.initial_point.time_from_start.nsecs, _x.desired.header.seq, _x.desired.header.stamp.secs, _x.desired.header.stamp.nsecs, ) = _struct_13d6B4d2i3I.unpack(str[start:end]) self.initial_point.isForceX = bool(self.initial_point.isForceX) self.initial_point.isForceY = bool(self.initial_point.isForceY) self.initial_point.isForceZ = bool(self.initial_point.isForceZ) self.initial_point.isTorqueX = bool(self.initial_point.isTorqueX) self.initial_point.isTorqueY = bool(self.initial_point.isTorqueY) self.initial_point.isTorqueZ = bool(self.initial_point.isTorqueZ) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.desired.header.frame_id = str[start:end].decode('utf-8') else: self.desired.header.frame_id = str[start:end] _x = self start = end end += 162 ( _x.desired.pose.position.x, _x.desired.pose.position.y, _x.desired.pose.position.z, _x.desired.pose.orientation.x, _x.desired.pose.orientation.y, _x.desired.pose.orientation.z, _x.desired.pose.orientation.w, _x.desired.wrench_or_stiffness.force.x, _x.desired.wrench_or_stiffness.force.y, _x.desired.wrench_or_stiffness.force.z, _x.desired.wrench_or_stiffness.torque.x, _x.desired.wrench_or_stiffness.torque.y, _x.desired.wrench_or_stiffness.torque.z, _x.desired.isForceX, _x.desired.isForceY, _x.desired.isForceZ, _x.desired.isTorqueX, _x.desired.isTorqueY, _x.desired.isTorqueZ, _x.desired.forceDirection.x, _x.desired.forceDirection.y, _x.desired.forceDirection.z, _x.desired.forceDirection.w, _x.desired.time_from_start.secs, _x.desired.time_from_start.nsecs, _x.actual_pose.header.seq, _x.actual_pose.header.stamp.secs, _x.actual_pose.header.stamp.nsecs, ) = _struct_13d6B4d2i3I.unpack(str[start:end]) self.desired.isForceX = bool(self.desired.isForceX) self.desired.isForceY = bool(self.desired.isForceY) self.desired.isForceZ = bool(self.desired.isForceZ) self.desired.isTorqueX = bool(self.desired.isTorqueX) self.desired.isTorqueY = bool(self.desired.isTorqueY) self.desired.isTorqueZ = bool(self.desired.isTorqueZ) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.actual_pose.header.frame_id = str[start:end].decode( 'utf-8') else: self.actual_pose.header.frame_id = str[start:end] _x = self start = end end += 206 ( _x.actual_pose.pose.position.x, _x.actual_pose.pose.position.y, _x.actual_pose.pose.position.z, _x.actual_pose.pose.orientation.x, _x.actual_pose.pose.orientation.y, _x.actual_pose.pose.orientation.z, _x.actual_pose.pose.orientation.w, _x.actual_pose.wrench_or_stiffness.force.x, _x.actual_pose.wrench_or_stiffness.force.y, _x.actual_pose.wrench_or_stiffness.force.z, _x.actual_pose.wrench_or_stiffness.torque.x, _x.actual_pose.wrench_or_stiffness.torque.y, _x.actual_pose.wrench_or_stiffness.torque.z, _x.actual_pose.isForceX, _x.actual_pose.isForceY, _x.actual_pose.isForceZ, _x.actual_pose.isTorqueX, _x.actual_pose.isTorqueY, _x.actual_pose.isTorqueZ, _x.actual_pose.forceDirection.x, _x.actual_pose.forceDirection.y, _x.actual_pose.forceDirection.z, _x.actual_pose.forceDirection.w, _x.actual_pose.time_from_start.secs, _x.actual_pose.time_from_start.nsecs, _x.actual_force.force.x, _x.actual_force.force.y, _x.actual_force.force.z, _x.actual_force.torque.x, _x.actual_force.torque.y, _x.actual_force.torque.z, _x.effort_sq_error, ) = _struct_13d6B4d2i7d.unpack(str[start:end]) self.actual_pose.isForceX = bool(self.actual_pose.isForceX) self.actual_pose.isForceY = bool(self.actual_pose.isForceY) self.actual_pose.isForceZ = bool(self.actual_pose.isForceZ) self.actual_pose.isTorqueX = bool(self.actual_pose.isTorqueX) self.actual_pose.isTorqueY = bool(self.actual_pose.isTorqueY) self.actual_pose.isTorqueZ = bool(self.actual_pose.isTorqueZ) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) pattern = '<%sd' % length start = end end += struct.calcsize(pattern) self.requested_joint_efforts = 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.actual_joint_efforts = struct.unpack(pattern, str[start:end]) _x = self start = end end += 8 ( _x.running_time.secs, _x.running_time.nsecs, ) = _struct_2i.unpack(str[start:end]) self.running_time.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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 """ if python3: codecs.lookup_error("rosmsg").msg_type = self._type try: if self.trajectory is None: self.trajectory = trajectory_msgs.msg.JointTrajectory() if self.path_tolerance is None: self.path_tolerance = None if self.goal_tolerance is None: self.goal_tolerance = None if self.goal_time_tolerance is None: self.goal_time_tolerance = genpy.Duration() end = 0 _x = self start = end end += 12 ( _x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs, ) = _get_struct_3I().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.trajectory.header.frame_id = str[start:end].decode( 'utf-8', 'rosmsg') else: self.trajectory.header.frame_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.trajectory.joint_names = [] for i in range(0, length): start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val1 = str[start:end].decode('utf-8', 'rosmsg') else: val1 = str[start:end] self.trajectory.joint_names.append(val1) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.trajectory.points = [] for i in range(0, length): val1 = trajectory_msgs.msg.JointTrajectoryPoint() start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) pattern = '<%sd' % length start = end s = struct.Struct(pattern) end += s.size val1.positions = 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 s = struct.Struct(pattern) end += s.size val1.velocities = 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 s = struct.Struct(pattern) end += s.size val1.accelerations = 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 s = struct.Struct(pattern) end += s.size val1.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) _v4 = val1.time_from_start _x = _v4 start = end end += 8 ( _x.secs, _x.nsecs, ) = _get_struct_2i().unpack(str[start:end]) self.trajectory.points.append(val1) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.path_tolerance = [] for i in range(0, length): val1 = control_msgs.msg.JointTolerance() start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val1.name = str[start:end].decode('utf-8', 'rosmsg') else: val1.name = str[start:end] _x = val1 start = end end += 24 ( _x.position, _x.velocity, _x.acceleration, ) = _get_struct_3d().unpack(str[start:end]) self.path_tolerance.append(val1) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.goal_tolerance = [] for i in range(0, length): val1 = control_msgs.msg.JointTolerance() start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val1.name = str[start:end].decode('utf-8', 'rosmsg') else: val1.name = str[start:end] _x = val1 start = end end += 24 ( _x.position, _x.velocity, _x.acceleration, ) = _get_struct_3d().unpack(str[start:end]) self.goal_tolerance.append(val1) _x = self start = end end += 8 ( _x.goal_time_tolerance.secs, _x.goal_time_tolerance.nsecs, ) = _get_struct_2i().unpack(str[start:end]) self.goal_time_tolerance.canon() return self except struct.error as e: raise genpy.DeserializationError(e) # most likely buffer underfill
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.time_from_start is None: self.time_from_start = genpy.Duration() end = 0 _x = self start = end end += 6 ( _x.group_number, _x.num_joints, _x.valid_fields, ) = _struct_3h.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.positions = 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.velocities = 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.accelerations = 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.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) _x = self start = end end += 8 ( _x.time_from_start.secs, _x.time_from_start.nsecs, ) = _struct_2i.unpack(str[start:end]) self.time_from_start.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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.time_from_start is None: self.time_from_start = genpy.Duration() end = 0 start = end end += 1 (self.type, ) = _get_struct_b().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.args = str[start:end].decode('utf-8') else: self.args = str[start:end] start = end end += 1 (self.wait, ) = _get_struct_B().unpack(str[start:end]) self.wait = bool(self.wait) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) pattern = '<%sd' % length start = end end += struct.calcsize(pattern) self.positions = 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.velocities = 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.accelerations = 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.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) _x = self start = end end += 8 ( _x.time_from_start.secs, _x.time_from_start.nsecs, ) = _get_struct_2i().unpack(str[start:end]) self.time_from_start.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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.transforms is None: self.transforms = None if self.velocities is None: self.velocities = None if self.accelerations is None: self.accelerations = None if self.time_from_start is None: self.time_from_start = genpy.Duration() end = 0 start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) self.transforms = [] for i in range(0, length): val1 = geometry_msgs.msg.Transform() _v19 = val1.translation _x = _v19 start = end end += 24 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) _v20 = val1.rotation _x = _v20 start = end end += 32 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) self.transforms.append(val1) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) self.velocities = [] for i in range(0, length): val1 = geometry_msgs.msg.Twist() _v21 = val1.linear _x = _v21 start = end end += 24 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) _v22 = val1.angular _x = _v22 start = end end += 24 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) self.velocities.append(val1) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) self.accelerations = [] for i in range(0, length): val1 = geometry_msgs.msg.Twist() _v23 = val1.linear _x = _v23 start = end end += 24 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) _v24 = val1.angular _x = _v24 start = end end += 24 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) self.accelerations.append(val1) _x = self start = end end += 8 (_x.time_from_start.secs, _x.time_from_start.nsecs,) = _struct_2i.unpack(str[start:end]) self.time_from_start.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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.command is None: self.command = pr2_msgs.msg.LaserTrajCmd() end = 0 _x = self start = end end += 12 ( _x.command.header.seq, _x.command.header.stamp.secs, _x.command.header.stamp.nsecs, ) = _get_struct_3I().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.command.header.frame_id = str[start:end].decode('utf-8') else: self.command.header.frame_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.command.profile = str[start:end].decode('utf-8') else: self.command.profile = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) pattern = '<%sd' % length start = end end += struct.calcsize(pattern) self.command.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.command.time_from_start = [] for i in range(0, length): val1 = genpy.Duration() _x = val1 start = end end += 8 ( _x.secs, _x.nsecs, ) = _get_struct_2i().unpack(str[start:end]) self.command.time_from_start.append(val1) _x = self start = end end += 16 ( _x.command.max_velocity, _x.command.max_acceleration, ) = _get_struct_2d().unpack(str[start:end]) return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
rosfield_typechecker.update({ # for time and duration we want to extract the slots # we want genpy to get the list of slots (rospy.Time doesnt have it) # NOTE : slots_types in genpy indicate int32 which is wrong for Time, but correct for Duration # Until this is fixed we will treat Time and Duration as "special" like genpy does... 'time': TypeChecker( Sanitizer(lambda v=None: genpy.Time( secs=rosfield_typechecker.get('uint32')(v.secs), nsecs=rosfield_typechecker.get('uint32')(v.nsecs)) if v is not None else genpy.Time()), Accepter({ 'secs': rosfield_typechecker.get('uint32'), 'nsecs': rosfield_typechecker.get('uint32') })), 'duration': TypeChecker( Sanitizer(lambda v=None: genpy.Duration( secs=rosfield_typechecker.get('int32')(v.secs), nsecs=rosfield_typechecker.get('int32')(v.nsecs)) if v is not None else genpy.Duration()), Accepter({ 'secs': rosfield_typechecker.get('int32'), 'nsecs': rosfield_typechecker.get('int32') })), }) # TODO : common message types with "special type" when we have to rely on custom typechecker construction: # - std_msgs/Header # -
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.window_start is None: self.window_start = genpy.Time() if self.window_stop is None: self.window_stop = genpy.Time() if self.period_mean is None: self.period_mean = genpy.Duration() if self.period_stddev is None: self.period_stddev = genpy.Duration() if self.period_max is None: self.period_max = genpy.Duration() if self.stamp_age_mean is None: self.stamp_age_mean = genpy.Duration() if self.stamp_age_stddev is None: self.stamp_age_stddev = genpy.Duration() if self.stamp_age_max is None: self.stamp_age_max = genpy.Duration() end = 0 start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.topic = str[start:end].decode('utf-8') else: self.topic = str[start:end] start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.node_pub = str[start:end].decode('utf-8') else: self.node_pub = str[start:end] start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.node_sub = str[start:end].decode('utf-8') else: self.node_sub = str[start:end] _x = self start = end end += 76 (_x.window_start.secs, _x.window_start.nsecs, _x.window_stop.secs, _x.window_stop.nsecs, _x.delivered_msgs, _x.dropped_msgs, _x.traffic, _x.period_mean.secs, _x.period_mean.nsecs, _x.period_stddev.secs, _x.period_stddev.nsecs, _x.period_max.secs, _x.period_max.nsecs, _x.stamp_age_mean.secs, _x.stamp_age_mean.nsecs, _x.stamp_age_stddev.secs, _x.stamp_age_stddev.nsecs, _x.stamp_age_max.secs, _x.stamp_age_max.nsecs,) = _struct_4I15i.unpack(str[start:end]) self.window_start.canon() self.window_stop.canon() self.period_mean.canon() self.period_stddev.canon() self.period_max.canon() self.stamp_age_mean.canon() self.stamp_age_stddev.canon() self.stamp_age_max.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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.timestamp is None: self.timestamp = genpy.Time() if self.max_time is None: self.max_time = genpy.Duration() if self.mean_time is None: self.mean_time = genpy.Duration() if self.variance_time is None: self.variance_time = genpy.Duration() if self.time_last_control_loop_overrun is None: self.time_last_control_loop_overrun = genpy.Time() end = 0 start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.name = str[start:end].decode('utf-8') else: self.name = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.type = str[start:end].decode('utf-8') else: self.type = str[start:end] _x = self start = end end += 45 ( _x.timestamp.secs, _x.timestamp.nsecs, _x.running, _x.max_time.secs, _x.max_time.nsecs, _x.mean_time.secs, _x.mean_time.nsecs, _x.variance_time.secs, _x.variance_time.nsecs, _x.num_control_loop_overruns, _x.time_last_control_loop_overrun.secs, _x.time_last_control_loop_overrun.nsecs, ) = _struct_2IB7i2I.unpack(str[start:end]) self.running = bool(self.running) self.timestamp.canon() self.max_time.canon() self.mean_time.canon() self.variance_time.canon() self.time_last_control_loop_overrun.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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: topic,node_pub,node_sub,window_start,window_stop,delivered_msgs,dropped_msgs,traffic,period_mean,period_stddev,period_max,stamp_age_mean,stamp_age_stddev,stamp_age_max :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(TopicStatistics, self).__init__(*args, **kwds) #message fields cannot be None, assign default values for those that are if self.topic is None: self.topic = '' if self.node_pub is None: self.node_pub = '' if self.node_sub is None: self.node_sub = '' if self.window_start is None: self.window_start = genpy.Time() if self.window_stop is None: self.window_stop = genpy.Time() if self.delivered_msgs is None: self.delivered_msgs = 0 if self.dropped_msgs is None: self.dropped_msgs = 0 if self.traffic is None: self.traffic = 0 if self.period_mean is None: self.period_mean = genpy.Duration() if self.period_stddev is None: self.period_stddev = genpy.Duration() if self.period_max is None: self.period_max = genpy.Duration() if self.stamp_age_mean is None: self.stamp_age_mean = genpy.Duration() if self.stamp_age_stddev is None: self.stamp_age_stddev = genpy.Duration() if self.stamp_age_max is None: self.stamp_age_max = genpy.Duration() else: self.topic = '' self.node_pub = '' self.node_sub = '' self.window_start = genpy.Time() self.window_stop = genpy.Time() self.delivered_msgs = 0 self.dropped_msgs = 0 self.traffic = 0 self.period_mean = genpy.Duration() self.period_stddev = genpy.Duration() self.period_max = genpy.Duration() self.stamp_age_mean = genpy.Duration() self.stamp_age_stddev = genpy.Duration() self.stamp_age_max = genpy.Duration()
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.header is None: self.header = std_msgs.msg.Header() if self.twists is None: self.twists = None end = 0 _x = self start = end end += 12 ( _x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs, ) = _get_struct_3I().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.header.frame_id = str[start:end].decode('utf-8') else: self.header.frame_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.twists = [] for i in range(0, length): val1 = dwb_msgs.msg.TrajectoryScore() _v7 = val1.traj _v8 = _v7.velocity _x = _v8 start = end end += 24 ( _x.x, _x.y, _x.theta, ) = _get_struct_3d().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) _v7.poses = [] for i in range(0, length): val3 = geometry_msgs.msg.Pose2D() _x = val3 start = end end += 24 ( _x.x, _x.y, _x.theta, ) = _get_struct_3d().unpack(str[start:end]) _v7.poses.append(val3) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) _v7.time_offsets = [] for i in range(0, length): val3 = genpy.Duration() _x = val3 start = end end += 8 ( _x.secs, _x.nsecs, ) = _get_struct_2i().unpack(str[start:end]) _v7.time_offsets.append(val3) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) val1.scores = [] for i in range(0, length): val2 = dwb_msgs.msg.CriticScore() start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val2.name = str[start:end].decode('utf-8') else: val2.name = str[start:end] _x = val2 start = end end += 8 ( _x.raw_score, _x.scale, ) = _get_struct_2f().unpack(str[start:end]) val1.scores.append(val2) start = end end += 4 (val1.total, ) = _get_struct_f().unpack(str[start:end]) self.twists.append(val1) _x = self start = end end += 4 ( _x.best_index, _x.worst_index, ) = _get_struct_2H().unpack(str[start:end]) return self except struct.error as e: raise genpy.DeserializationError(e) # most likely buffer underfill
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: caller_id,orig_caller_id,str,b,int16,int32,int64,c,uint16,uint32,uint64,float32,float64,t,d :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(TestPrimitives, self).__init__(*args, **kwds) #message fields cannot be None, assign default values for those that are if self.caller_id is None: self.caller_id = '' if self.orig_caller_id is None: self.orig_caller_id = '' if self.str is None: self.str = '' if self.b is None: self.b = 0 if self.int16 is None: self.int16 = 0 if self.int32 is None: self.int32 = 0 if self.int64 is None: self.int64 = 0 if self.c is None: self.c = 0 if self.uint16 is None: self.uint16 = 0 if self.uint32 is None: self.uint32 = 0 if self.uint64 is None: self.uint64 = 0 if self.float32 is None: self.float32 = 0. if self.float64 is None: self.float64 = 0. if self.t is None: self.t = genpy.Time() if self.d is None: self.d = genpy.Duration() else: self.caller_id = '' self.orig_caller_id = '' self.str = '' self.b = 0 self.int16 = 0 self.int32 = 0 self.int64 = 0 self.c = 0 self.uint16 = 0 self.uint32 = 0 self.uint64 = 0 self.float32 = 0. self.float64 = 0. self.t = genpy.Time() self.d = genpy.Duration()
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 """ codecs.lookup_error("rosmsg").msg_type = self._type try: if self.web_go_to is None: self.web_go_to = pal_web_msgs.msg.WebGoTo() if self.question_tts is None: self.question_tts = pal_interaction_msgs.msg.TtsGoal() if self.asr_timeout is None: self.asr_timeout = genpy.Duration() if self.retry_tts is None: self.retry_tts = pal_interaction_msgs.msg.TtsGoal() end = 0 start = end end += 1 (self.web_go_to.type, ) = _get_struct_B().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.web_go_to.value = str[start:end].decode('utf-8', 'rosmsg') else: self.web_go_to.value = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.question_tts.text.section = str[start:end].decode( 'utf-8', 'rosmsg') else: self.question_tts.text.section = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.question_tts.text.key = str[start:end].decode( 'utf-8', 'rosmsg') else: self.question_tts.text.key = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.question_tts.text.lang_id = str[start:end].decode( 'utf-8', 'rosmsg') else: self.question_tts.text.lang_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.question_tts.text.arguments = [] for i in range(0, length): val1 = pal_interaction_msgs.msg.I18nArgument() start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val1.section = str[start:end].decode('utf-8', 'rosmsg') else: val1.section = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val1.key = str[start:end].decode('utf-8', 'rosmsg') else: val1.key = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val1.expanded = str[start:end].decode('utf-8', 'rosmsg') else: val1.expanded = str[start:end] self.question_tts.text.arguments.append(val1) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.question_tts.rawtext.text = str[start:end].decode( 'utf-8', 'rosmsg') else: self.question_tts.rawtext.text = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.question_tts.rawtext.lang_id = str[start:end].decode( 'utf-8', 'rosmsg') else: self.question_tts.rawtext.lang_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.question_tts.speakerName = str[start:end].decode( 'utf-8', 'rosmsg') else: self.question_tts.speakerName = str[start:end] start = end end += 8 (self.question_tts.wait_before_speaking, ) = _get_struct_d().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.valid_asr_inputs = [] for i in range(0, length): start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val1 = str[start:end].decode('utf-8', 'rosmsg') else: val1 = str[start:end] self.valid_asr_inputs.append(val1) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.asr_language = str[start:end].decode('utf-8', 'rosmsg') else: self.asr_language = str[start:end] _x = self start = end end += 9 ( _x.asr_timeout.secs, _x.asr_timeout.nsecs, _x.retry_asr, ) = _get_struct_2iB().unpack(str[start:end]) self.retry_asr = bool(self.retry_asr) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.retry_tts.text.section = str[start:end].decode( 'utf-8', 'rosmsg') else: self.retry_tts.text.section = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.retry_tts.text.key = str[start:end].decode( 'utf-8', 'rosmsg') else: self.retry_tts.text.key = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.retry_tts.text.lang_id = str[start:end].decode( 'utf-8', 'rosmsg') else: self.retry_tts.text.lang_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.retry_tts.text.arguments = [] for i in range(0, length): val1 = pal_interaction_msgs.msg.I18nArgument() start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val1.section = str[start:end].decode('utf-8', 'rosmsg') else: val1.section = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val1.key = str[start:end].decode('utf-8', 'rosmsg') else: val1.key = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val1.expanded = str[start:end].decode('utf-8', 'rosmsg') else: val1.expanded = str[start:end] self.retry_tts.text.arguments.append(val1) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.retry_tts.rawtext.text = str[start:end].decode( 'utf-8', 'rosmsg') else: self.retry_tts.rawtext.text = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.retry_tts.rawtext.lang_id = str[start:end].decode( 'utf-8', 'rosmsg') else: self.retry_tts.rawtext.lang_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.retry_tts.speakerName = str[start:end].decode( 'utf-8', 'rosmsg') else: self.retry_tts.speakerName = str[start:end] _x = self start = end end += 9 ( _x.retry_tts.wait_before_speaking, _x.wait_for_interaction, ) = _get_struct_dB().unpack(str[start:end]) self.wait_for_interaction = bool(self.wait_for_interaction) self.asr_timeout.canon() return self except struct.error as e: raise genpy.DeserializationError(e) # most likely buffer underfill
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.header is None: self.header = std_msgs.msg.Header() if self.mcu_uptime is None: self.mcu_uptime = genpy.Duration() if self.connection_uptime is None: self.connection_uptime = genpy.Duration() end = 0 _x = self start = end end += 12 ( _x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs, ) = _get_struct_3I().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.header.frame_id = str[start:end].decode('utf-8') else: self.header.frame_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.hardware_id = str[start:end].decode('utf-8') else: self.hardware_id = str[start:end] _x = self start = end end += 59 ( _x.mcu_uptime.secs, _x.mcu_uptime.nsecs, _x.connection_uptime.secs, _x.connection_uptime.nsecs, _x.drivers_active, _x.driver_external_stop_present, _x.driver_external_stop_stopped, _x.measured_battery, _x.measured_12v, _x.measured_5v, _x.drive_current, _x.user_current, _x.computer_current, _x.total_current, _x.total_current_peak, _x.total_power_consumed, ) = _get_struct_4i3B8fd().unpack(str[start:end]) self.drivers_active = bool(self.drivers_active) self.driver_external_stop_present = bool( self.driver_external_stop_present) self.driver_external_stop_stopped = bool( self.driver_external_stop_stopped) self.mcu_uptime.canon() self.connection_uptime.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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.source_time is None: self.source_time = genpy.Time() if self.timeout is None: self.timeout = genpy.Duration() if self.target_time is None: self.target_time = genpy.Time() end = 0 start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.target_frame = str[start:end].decode('utf-8') else: self.target_frame = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.source_frame = str[start:end].decode('utf-8') else: self.source_frame = str[start:end] _x = self start = end end += 24 ( _x.source_time.secs, _x.source_time.nsecs, _x.timeout.secs, _x.timeout.nsecs, _x.target_time.secs, _x.target_time.nsecs, ) = _struct_2I2i2I.unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.fixed_frame = str[start:end].decode('utf-8') else: self.fixed_frame = str[start:end] start = end end += 1 (self.advanced, ) = _struct_B.unpack(str[start:end]) self.advanced = bool(self.advanced) self.source_time.canon() self.timeout.canon() self.target_time.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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.header is None: self.header = std_msgs.msg.Header() if self.pose is None: self.pose = geometry_msgs.msg.Pose() if self.wrench_or_stiffness is None: self.wrench_or_stiffness = geometry_msgs.msg.Wrench() if self.time_from_start is None: self.time_from_start = genpy.Duration() end = 0 _x = self start = end end += 12 ( _x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs, ) = _struct_3I.unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.header.frame_id = str[start:end].decode('utf-8') else: self.header.frame_id = str[start:end] _x = self start = end end += 118 ( _x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w, _x.wrench_or_stiffness.force.x, _x.wrench_or_stiffness.force.y, _x.wrench_or_stiffness.force.z, _x.wrench_or_stiffness.torque.x, _x.wrench_or_stiffness.torque.y, _x.wrench_or_stiffness.torque.z, _x.isForceX, _x.isForceY, _x.isForceZ, _x.isTorqueX, _x.isTorqueY, _x.isTorqueZ, _x.time_from_start.secs, _x.time_from_start.nsecs, ) = _struct_13d6B2i.unpack(str[start:end]) self.isForceX = bool(self.isForceX) self.isForceY = bool(self.isForceY) self.isForceZ = bool(self.isForceZ) self.isTorqueX = bool(self.isTorqueX) self.isTorqueY = bool(self.isTorqueY) self.isTorqueZ = bool(self.isTorqueZ) self.time_from_start.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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.target is None: self.target = geometry_msgs.msg.PointStamped() if self.pointing_axis is None: self.pointing_axis = geometry_msgs.msg.Vector3() if self.min_duration is None: self.min_duration = genpy.Duration() end = 0 _x = self start = end end += 12 ( _x.target.header.seq, _x.target.header.stamp.secs, _x.target.header.stamp.nsecs, ) = _get_struct_3I().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.target.header.frame_id = str[start:end].decode('utf-8') else: self.target.header.frame_id = str[start:end] _x = self start = end end += 48 ( _x.target.point.x, _x.target.point.y, _x.target.point.z, _x.pointing_axis.x, _x.pointing_axis.y, _x.pointing_axis.z, ) = _get_struct_6d().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.pointing_frame = str[start:end].decode('utf-8') else: self.pointing_frame = str[start:end] _x = self start = end end += 16 ( _x.min_duration.secs, _x.min_duration.nsecs, _x.max_velocity, ) = _get_struct_2id().unpack(str[start:end]) self.min_duration.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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.header is None: self.header = std_msgs.msg.Header() if self.pose is None: self.pose = geometry_msgs.msg.Pose() if self.scale is None: self.scale = geometry_msgs.msg.Vector3() if self.color is None: self.color = std_msgs.msg.ColorRGBA() if self.lifetime is None: self.lifetime = genpy.Duration() if self.points is None: self.points = None if self.colors is None: self.colors = None end = 0 _x = self start = end end += 12 ( _x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs, ) = _get_struct_3I().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.header.frame_id = str[start:end].decode('utf-8') else: self.header.frame_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.ns = str[start:end].decode('utf-8') else: self.ns = str[start:end] _x = self start = end end += 117 ( _x.id, _x.type, _x.action, _x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w, _x.scale.x, _x.scale.y, _x.scale.z, _x.color.r, _x.color.g, _x.color.b, _x.color.a, _x.lifetime.secs, _x.lifetime.nsecs, _x.frame_locked, ) = _get_struct_3i10d4f2iB().unpack(str[start:end]) self.frame_locked = bool(self.frame_locked) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.points = [] for i in range(0, length): val1 = geometry_msgs.msg.Point() _x = val1 start = end end += 24 ( _x.x, _x.y, _x.z, ) = _get_struct_3d().unpack(str[start:end]) self.points.append(val1) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.colors = [] for i in range(0, length): val1 = std_msgs.msg.ColorRGBA() _x = val1 start = end end += 16 ( _x.r, _x.g, _x.b, _x.a, ) = _get_struct_4f().unpack(str[start:end]) self.colors.append(val1) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.text = str[start:end].decode('utf-8') else: self.text = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.mesh_resource = str[start:end].decode('utf-8') else: self.mesh_resource = str[start:end] start = end end += 1 (self.mesh_use_embedded_materials, ) = _get_struct_B().unpack( str[start:end]) self.mesh_use_embedded_materials = bool( self.mesh_use_embedded_materials) self.lifetime.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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.header is None: self.header = std_msgs.msg.Header() if self.coreStats is None: self.coreStats = None if self.uptime is None: self.uptime = genpy.Duration() end = 0 _x = self start = end end += 12 ( _x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs, ) = _struct_3I.unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.header.frame_id = str[start:end].decode('utf-8') else: self.header.frame_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.name = str[start:end].decode('utf-8') else: self.name = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.coreStats = [] for i in range(0, length): val1 = nasa_r2_common_msgs.msg.SystemCore() start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val1.id = str[start:end].decode('utf-8') else: val1.id = str[start:end] _x = val1 start = end end += 17 ( _x.speed, _x.load, _x.failure, ) = _struct_2dB.unpack(str[start:end]) val1.failure = bool(val1.failure) self.coreStats.append(val1) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) pattern = '<%sd' % length start = end end += struct.calcsize(pattern) self.coreTemps = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) _x = self start = end end += 44 ( _x.oneMinuteLoad, _x.fiveMinuteLoad, _x.fifteenMinuteLoad, _x.uptime.secs, _x.uptime.nsecs, _x.totalMemory, _x.usedMemory, _x.freeMemory, ) = _struct_3d2i3I.unpack(str[start:end]) self.uptime.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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.header is None: self.header = std_msgs.msg.Header() if self.segment_time is None: self.segment_time = genpy.Duration() end = 0 _x = self start = end end += 12 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end]) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.header.frame_id = str[start:end].decode('utf-8') else: self.header.frame_id = str[start:end] _x = self start = end end += 12 (_x.num_coeffs, _x.segment_time.secs, _x.segment_time.nsecs,) = _get_struct_3i().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.x = 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.y = 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.z = 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.yaw = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) self.segment_time.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
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.header is None: self.header = std_msgs.msg.Header() if self.wrench is None: self.wrench = geometry_msgs.msg.Wrench() if self.application_point is None: self.application_point = geometry_msgs.msg.Point() if self.duration is None: self.duration = genpy.Duration() end = 0 _x = self start = end end += 12 ( _x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs, ) = _get_struct_3I().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.header.frame_id = str[start:end].decode('utf-8') else: self.header.frame_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.link_name = str[start:end].decode('utf-8') else: self.link_name = str[start:end] _x = self start = end end += 80 ( _x.wrench.force.x, _x.wrench.force.y, _x.wrench.force.z, _x.wrench.torque.x, _x.wrench.torque.y, _x.wrench.torque.z, _x.application_point.x, _x.application_point.y, _x.application_point.z, _x.duration.secs, _x.duration.nsecs, ) = _get_struct_9d2i().unpack(str[start:end]) self.duration.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill
def deserialize(self, str): """ unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str`` """ codecs.lookup_error("rosmsg").msg_type = self._type try: if self.header is None: self.header = std_msgs.msg.Header() if self.control_command_delay is None: self.control_command_delay = genpy.Duration() if self.control_computation_time is None: self.control_computation_time = genpy.Duration() if self.trajectory_execution_left_duration is None: self.trajectory_execution_left_duration = genpy.Duration() if self.low_level_feedback is None: self.low_level_feedback = quadrotor_msgs.msg.LowLevelFeedback() if self.reference_state is None: self.reference_state = quadrotor_msgs.msg.TrajectoryPoint() if self.state_estimate is None: self.state_estimate = nav_msgs.msg.Odometry() end = 0 _x = self start = end end += 12 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end]) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg') else: self.header.frame_id = str[start:end] _x = self start = end end += 38 (_x.autopilot_state, _x.control_command_delay.secs, _x.control_command_delay.nsecs, _x.control_computation_time.secs, _x.control_computation_time.nsecs, _x.trajectory_execution_left_duration.secs, _x.trajectory_execution_left_duration.nsecs, _x.trajectories_left_in_queue, _x.low_level_feedback.header.seq, _x.low_level_feedback.header.stamp.secs, _x.low_level_feedback.header.stamp.nsecs,) = _get_struct_B6iB3I().unpack(str[start:end]) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.low_level_feedback.header.frame_id = str[start:end].decode('utf-8', 'rosmsg') else: self.low_level_feedback.header.frame_id = str[start:end] _x = self start = end end += 6 (_x.low_level_feedback.battery_voltage, _x.low_level_feedback.battery_state, _x.low_level_feedback.control_mode,) = _get_struct_f2B().unpack(str[start:end]) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) pattern = '<%sh'%length start = end s = struct.Struct(pattern) end += s.size self.low_level_feedback.motor_speeds = s.unpack(str[start:end]) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) pattern = '<%sd'%length start = end s = struct.Struct(pattern) end += s.size self.low_level_feedback.thrust_mapping_coeffs = s.unpack(str[start:end]) _x = self start = end end += 292 (_x.reference_state.time_from_start.secs, _x.reference_state.time_from_start.nsecs, _x.reference_state.pose.position.x, _x.reference_state.pose.position.y, _x.reference_state.pose.position.z, _x.reference_state.pose.orientation.x, _x.reference_state.pose.orientation.y, _x.reference_state.pose.orientation.z, _x.reference_state.pose.orientation.w, _x.reference_state.velocity.linear.x, _x.reference_state.velocity.linear.y, _x.reference_state.velocity.linear.z, _x.reference_state.velocity.angular.x, _x.reference_state.velocity.angular.y, _x.reference_state.velocity.angular.z, _x.reference_state.acceleration.linear.x, _x.reference_state.acceleration.linear.y, _x.reference_state.acceleration.linear.z, _x.reference_state.acceleration.angular.x, _x.reference_state.acceleration.angular.y, _x.reference_state.acceleration.angular.z, _x.reference_state.jerk.linear.x, _x.reference_state.jerk.linear.y, _x.reference_state.jerk.linear.z, _x.reference_state.jerk.angular.x, _x.reference_state.jerk.angular.y, _x.reference_state.jerk.angular.z, _x.reference_state.snap.linear.x, _x.reference_state.snap.linear.y, _x.reference_state.snap.linear.z, _x.reference_state.snap.angular.x, _x.reference_state.snap.angular.y, _x.reference_state.snap.angular.z, _x.reference_state.heading, _x.reference_state.heading_rate, _x.reference_state.heading_acceleration, _x.state_estimate.header.seq, _x.state_estimate.header.stamp.secs, _x.state_estimate.header.stamp.nsecs,) = _get_struct_2i34d3I().unpack(str[start:end]) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.state_estimate.header.frame_id = str[start:end].decode('utf-8', 'rosmsg') else: self.state_estimate.header.frame_id = str[start:end] start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.state_estimate.child_frame_id = str[start:end].decode('utf-8', 'rosmsg') else: self.state_estimate.child_frame_id = str[start:end] _x = self start = end end += 56 (_x.state_estimate.pose.pose.position.x, _x.state_estimate.pose.pose.position.y, _x.state_estimate.pose.pose.position.z, _x.state_estimate.pose.pose.orientation.x, _x.state_estimate.pose.pose.orientation.y, _x.state_estimate.pose.pose.orientation.z, _x.state_estimate.pose.pose.orientation.w,) = _get_struct_7d().unpack(str[start:end]) start = end end += 288 self.state_estimate.pose.covariance = _get_struct_36d().unpack(str[start:end]) _x = self start = end end += 48 (_x.state_estimate.twist.twist.linear.x, _x.state_estimate.twist.twist.linear.y, _x.state_estimate.twist.twist.linear.z, _x.state_estimate.twist.twist.angular.x, _x.state_estimate.twist.twist.angular.y, _x.state_estimate.twist.twist.angular.z,) = _get_struct_6d().unpack(str[start:end]) start = end end += 288 self.state_estimate.twist.covariance = _get_struct_36d().unpack(str[start:end]) self.control_command_delay.canon() self.control_computation_time.canon() self.trajectory_execution_left_duration.canon() return self except struct.error as e: raise genpy.DeserializationError(e) # most likely buffer underfill
def deserialize(self, str): """ unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str`` """ try: if self.trajectory is None: self.trajectory = trajectory_msgs.msg.JointTrajectory() if self.path_tolerance is None: self.path_tolerance = None if self.goal_tolerance is None: self.goal_tolerance = None if self.goal_time_tolerance is None: self.goal_time_tolerance = genpy.Duration() end = 0 _x = self start = end end += 12 ( _x.trajectory.header.seq, _x.trajectory.header.stamp.secs, _x.trajectory.header.stamp.nsecs, ) = _get_struct_3I().unpack(str[start:end]) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.trajectory.header.frame_id = str[start:end].decode( 'utf-8') else: self.trajectory.header.frame_id = str[start:end] start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.trajectory.joint_names = [] for i in range(0, length): start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val1 = str[start:end].decode('utf-8') else: val1 = str[start:end] self.trajectory.joint_names.append(val1) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.trajectory.points = [] for i in range(0, length): val1 = trajectory_msgs.msg.JointTrajectoryPoint() start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) pattern = '<%sd' % length start = end end += struct.calcsize(pattern) val1.positions = 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) val1.velocities = 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) val1.accelerations = 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) val1.effort = struct.unpack(pattern, str[start:end]) _v2 = val1.time_from_start _x = _v2 start = end end += 8 ( _x.secs, _x.nsecs, ) = _get_struct_2i().unpack(str[start:end]) self.trajectory.points.append(val1) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.path_tolerance = [] for i in range(0, length): val1 = control_msgs.msg.JointTolerance() start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val1.name = str[start:end].decode('utf-8') else: val1.name = str[start:end] _x = val1 start = end end += 24 ( _x.position, _x.velocity, _x.acceleration, ) = _get_struct_3d().unpack(str[start:end]) self.path_tolerance.append(val1) start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) self.goal_tolerance = [] for i in range(0, length): val1 = control_msgs.msg.JointTolerance() start = end end += 4 (length, ) = _struct_I.unpack(str[start:end]) start = end end += length if python3: val1.name = str[start:end].decode('utf-8') else: val1.name = str[start:end] _x = val1 start = end end += 24 ( _x.position, _x.velocity, _x.acceleration, ) = _get_struct_3d().unpack(str[start:end]) self.goal_tolerance.append(val1) _x = self start = end end += 8 ( _x.goal_time_tolerance.secs, _x.goal_time_tolerance.nsecs, ) = _get_struct_2i().unpack(str[start:end]) self.goal_time_tolerance.canon() return self except struct.error as e: raise genpy.DeserializationError(e) #most likely buffer underfill