00001 """autogenerated by genmsg_py from OrientationConstraint.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006 import std_msgs.msg
00007
00008 class OrientationConstraint(roslib.message.Message):
00009 _md5sum = "27d99749ba49d4a822298bbd1e0988ba"
00010 _type = "motion_planning_msgs/OrientationConstraint"
00011 _has_header = True
00012 _full_text = """# This message contains the definition of an orientation constraint.
00013 Header header
00014
00015 # The robot link this constraint refers to
00016 string link_name
00017
00018 # The type of the constraint
00019 int32 type
00020 int32 LINK_FRAME=0
00021 int32 HEADER_FRAME=1
00022
00023 # The desired orientation of the robot link specified as a quaternion
00024 geometry_msgs/Quaternion orientation
00025
00026 # optional RPY error tolerances specified if
00027 float64 absolute_roll_tolerance
00028 float64 absolute_pitch_tolerance
00029 float64 absolute_yaw_tolerance
00030
00031 # Constraint weighting factor - a weight for this constraint
00032 float64 weight
00033
00034 ================================================================================
00035 MSG: std_msgs/Header
00036 # Standard metadata for higher-level stamped data types.
00037 # This is generally used to communicate timestamped data
00038 # in a particular coordinate frame.
00039 #
00040 # sequence ID: consecutively increasing ID
00041 uint32 seq
00042 #Two-integer timestamp that is expressed as:
00043 # * stamp.secs: seconds (stamp_secs) since epoch
00044 # * stamp.nsecs: nanoseconds since stamp_secs
00045 # time-handling sugar is provided by the client library
00046 time stamp
00047 #Frame this data is associated with
00048 # 0: no frame
00049 # 1: global frame
00050 string frame_id
00051
00052 ================================================================================
00053 MSG: geometry_msgs/Quaternion
00054 # This represents an orientation in free space in quaternion form.
00055
00056 float64 x
00057 float64 y
00058 float64 z
00059 float64 w
00060
00061 """
00062
00063 LINK_FRAME = 0
00064 HEADER_FRAME = 1
00065
00066 __slots__ = ['header','link_name','type','orientation','absolute_roll_tolerance','absolute_pitch_tolerance','absolute_yaw_tolerance','weight']
00067 _slot_types = ['Header','string','int32','geometry_msgs/Quaternion','float64','float64','float64','float64']
00068
00069 def __init__(self, *args, **kwds):
00070 """
00071 Constructor. Any message fields that are implicitly/explicitly
00072 set to None will be assigned a default value. The recommend
00073 use is keyword arguments as this is more robust to future message
00074 changes. You cannot mix in-order arguments and keyword arguments.
00075
00076 The available fields are:
00077 header,link_name,type,orientation,absolute_roll_tolerance,absolute_pitch_tolerance,absolute_yaw_tolerance,weight
00078
00079 @param args: complete set of field values, in .msg order
00080 @param kwds: use keyword arguments corresponding to message field names
00081 to set specific fields.
00082 """
00083 if args or kwds:
00084 super(OrientationConstraint, self).__init__(*args, **kwds)
00085
00086 if self.header is None:
00087 self.header = std_msgs.msg._Header.Header()
00088 if self.link_name is None:
00089 self.link_name = ''
00090 if self.type is None:
00091 self.type = 0
00092 if self.orientation is None:
00093 self.orientation = geometry_msgs.msg.Quaternion()
00094 if self.absolute_roll_tolerance is None:
00095 self.absolute_roll_tolerance = 0.
00096 if self.absolute_pitch_tolerance is None:
00097 self.absolute_pitch_tolerance = 0.
00098 if self.absolute_yaw_tolerance is None:
00099 self.absolute_yaw_tolerance = 0.
00100 if self.weight is None:
00101 self.weight = 0.
00102 else:
00103 self.header = std_msgs.msg._Header.Header()
00104 self.link_name = ''
00105 self.type = 0
00106 self.orientation = geometry_msgs.msg.Quaternion()
00107 self.absolute_roll_tolerance = 0.
00108 self.absolute_pitch_tolerance = 0.
00109 self.absolute_yaw_tolerance = 0.
00110 self.weight = 0.
00111
00112 def _get_types(self):
00113 """
00114 internal API method
00115 """
00116 return self._slot_types
00117
00118 def serialize(self, buff):
00119 """
00120 serialize message into buffer
00121 @param buff: buffer
00122 @type buff: StringIO
00123 """
00124 try:
00125 _x = self
00126 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00127 _x = self.header.frame_id
00128 length = len(_x)
00129 buff.write(struct.pack('<I%ss'%length, length, _x))
00130 _x = self.link_name
00131 length = len(_x)
00132 buff.write(struct.pack('<I%ss'%length, length, _x))
00133 _x = self
00134 buff.write(_struct_i8d.pack(_x.type, _x.orientation.x, _x.orientation.y, _x.orientation.z, _x.orientation.w, _x.absolute_roll_tolerance, _x.absolute_pitch_tolerance, _x.absolute_yaw_tolerance, _x.weight))
00135 except struct.error, se: self._check_types(se)
00136 except TypeError, te: self._check_types(te)
00137
00138 def deserialize(self, str):
00139 """
00140 unpack serialized message in str into this message instance
00141 @param str: byte array of serialized message
00142 @type str: str
00143 """
00144 try:
00145 if self.header is None:
00146 self.header = std_msgs.msg._Header.Header()
00147 if self.orientation is None:
00148 self.orientation = geometry_msgs.msg.Quaternion()
00149 end = 0
00150 _x = self
00151 start = end
00152 end += 12
00153 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00154 start = end
00155 end += 4
00156 (length,) = _struct_I.unpack(str[start:end])
00157 start = end
00158 end += length
00159 self.header.frame_id = str[start:end]
00160 start = end
00161 end += 4
00162 (length,) = _struct_I.unpack(str[start:end])
00163 start = end
00164 end += length
00165 self.link_name = str[start:end]
00166 _x = self
00167 start = end
00168 end += 68
00169 (_x.type, _x.orientation.x, _x.orientation.y, _x.orientation.z, _x.orientation.w, _x.absolute_roll_tolerance, _x.absolute_pitch_tolerance, _x.absolute_yaw_tolerance, _x.weight,) = _struct_i8d.unpack(str[start:end])
00170 return self
00171 except struct.error, e:
00172 raise roslib.message.DeserializationError(e)
00173
00174
00175 def serialize_numpy(self, buff, numpy):
00176 """
00177 serialize message with numpy array types into buffer
00178 @param buff: buffer
00179 @type buff: StringIO
00180 @param numpy: numpy python module
00181 @type numpy module
00182 """
00183 try:
00184 _x = self
00185 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00186 _x = self.header.frame_id
00187 length = len(_x)
00188 buff.write(struct.pack('<I%ss'%length, length, _x))
00189 _x = self.link_name
00190 length = len(_x)
00191 buff.write(struct.pack('<I%ss'%length, length, _x))
00192 _x = self
00193 buff.write(_struct_i8d.pack(_x.type, _x.orientation.x, _x.orientation.y, _x.orientation.z, _x.orientation.w, _x.absolute_roll_tolerance, _x.absolute_pitch_tolerance, _x.absolute_yaw_tolerance, _x.weight))
00194 except struct.error, se: self._check_types(se)
00195 except TypeError, te: self._check_types(te)
00196
00197 def deserialize_numpy(self, str, numpy):
00198 """
00199 unpack serialized message in str into this message instance using numpy for array types
00200 @param str: byte array of serialized message
00201 @type str: str
00202 @param numpy: numpy python module
00203 @type numpy: module
00204 """
00205 try:
00206 if self.header is None:
00207 self.header = std_msgs.msg._Header.Header()
00208 if self.orientation is None:
00209 self.orientation = geometry_msgs.msg.Quaternion()
00210 end = 0
00211 _x = self
00212 start = end
00213 end += 12
00214 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00215 start = end
00216 end += 4
00217 (length,) = _struct_I.unpack(str[start:end])
00218 start = end
00219 end += length
00220 self.header.frame_id = str[start:end]
00221 start = end
00222 end += 4
00223 (length,) = _struct_I.unpack(str[start:end])
00224 start = end
00225 end += length
00226 self.link_name = str[start:end]
00227 _x = self
00228 start = end
00229 end += 68
00230 (_x.type, _x.orientation.x, _x.orientation.y, _x.orientation.z, _x.orientation.w, _x.absolute_roll_tolerance, _x.absolute_pitch_tolerance, _x.absolute_yaw_tolerance, _x.weight,) = _struct_i8d.unpack(str[start:end])
00231 return self
00232 except struct.error, e:
00233 raise roslib.message.DeserializationError(e)
00234
00235 _struct_I = roslib.message.struct_I
00236 _struct_3I = struct.Struct("<3I")
00237 _struct_i8d = struct.Struct("<i8d")