$search
00001 """autogenerated by genmsg_py from ModelState.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 00007 class ModelState(roslib.message.Message): 00008 _md5sum = "9330fd35f2fcd82d457e54bd54e10593" 00009 _type = "gazebo/ModelState" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """#This message is deprecated. Please use the version in gazebo_msgs instead. 00012 00013 # Set Gazebo Model pose and twist 00014 string model_name # model to set state (pose and twist) 00015 geometry_msgs/Pose pose # desired pose in reference frame 00016 geometry_msgs/Twist twist # desired twist in reference frame 00017 string reference_frame # set pose/twist relative to the frame of this entity (Body/Model) 00018 # leave empty or "world" or "map" defaults to world-frame 00019 00020 00021 ================================================================================ 00022 MSG: geometry_msgs/Pose 00023 # A representation of pose in free space, composed of postion and orientation. 00024 Point position 00025 Quaternion orientation 00026 00027 ================================================================================ 00028 MSG: geometry_msgs/Point 00029 # This contains the position of a point in free space 00030 float64 x 00031 float64 y 00032 float64 z 00033 00034 ================================================================================ 00035 MSG: geometry_msgs/Quaternion 00036 # This represents an orientation in free space in quaternion form. 00037 00038 float64 x 00039 float64 y 00040 float64 z 00041 float64 w 00042 00043 ================================================================================ 00044 MSG: geometry_msgs/Twist 00045 # This expresses velocity in free space broken into it's linear and angular parts. 00046 Vector3 linear 00047 Vector3 angular 00048 00049 ================================================================================ 00050 MSG: geometry_msgs/Vector3 00051 # This represents a vector in free space. 00052 00053 float64 x 00054 float64 y 00055 float64 z 00056 """ 00057 __slots__ = ['model_name','pose','twist','reference_frame'] 00058 _slot_types = ['string','geometry_msgs/Pose','geometry_msgs/Twist','string'] 00059 00060 def __init__(self, *args, **kwds): 00061 """ 00062 Constructor. Any message fields that are implicitly/explicitly 00063 set to None will be assigned a default value. The recommend 00064 use is keyword arguments as this is more robust to future message 00065 changes. You cannot mix in-order arguments and keyword arguments. 00066 00067 The available fields are: 00068 model_name,pose,twist,reference_frame 00069 00070 @param args: complete set of field values, in .msg order 00071 @param kwds: use keyword arguments corresponding to message field names 00072 to set specific fields. 00073 """ 00074 if args or kwds: 00075 super(ModelState, self).__init__(*args, **kwds) 00076 #message fields cannot be None, assign default values for those that are 00077 if self.model_name is None: 00078 self.model_name = '' 00079 if self.pose is None: 00080 self.pose = geometry_msgs.msg.Pose() 00081 if self.twist is None: 00082 self.twist = geometry_msgs.msg.Twist() 00083 if self.reference_frame is None: 00084 self.reference_frame = '' 00085 else: 00086 self.model_name = '' 00087 self.pose = geometry_msgs.msg.Pose() 00088 self.twist = geometry_msgs.msg.Twist() 00089 self.reference_frame = '' 00090 00091 def _get_types(self): 00092 """ 00093 internal API method 00094 """ 00095 return self._slot_types 00096 00097 def serialize(self, buff): 00098 """ 00099 serialize message into buffer 00100 @param buff: buffer 00101 @type buff: StringIO 00102 """ 00103 try: 00104 _x = self.model_name 00105 length = len(_x) 00106 buff.write(struct.pack('<I%ss'%length, length, _x)) 00107 _x = self 00108 buff.write(_struct_13d.pack(_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.twist.linear.x, _x.twist.linear.y, _x.twist.linear.z, _x.twist.angular.x, _x.twist.angular.y, _x.twist.angular.z)) 00109 _x = self.reference_frame 00110 length = len(_x) 00111 buff.write(struct.pack('<I%ss'%length, length, _x)) 00112 except struct.error as se: self._check_types(se) 00113 except TypeError as te: self._check_types(te) 00114 00115 def deserialize(self, str): 00116 """ 00117 unpack serialized message in str into this message instance 00118 @param str: byte array of serialized message 00119 @type str: str 00120 """ 00121 try: 00122 if self.pose is None: 00123 self.pose = geometry_msgs.msg.Pose() 00124 if self.twist is None: 00125 self.twist = geometry_msgs.msg.Twist() 00126 end = 0 00127 start = end 00128 end += 4 00129 (length,) = _struct_I.unpack(str[start:end]) 00130 start = end 00131 end += length 00132 self.model_name = str[start:end] 00133 _x = self 00134 start = end 00135 end += 104 00136 (_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.twist.linear.x, _x.twist.linear.y, _x.twist.linear.z, _x.twist.angular.x, _x.twist.angular.y, _x.twist.angular.z,) = _struct_13d.unpack(str[start:end]) 00137 start = end 00138 end += 4 00139 (length,) = _struct_I.unpack(str[start:end]) 00140 start = end 00141 end += length 00142 self.reference_frame = str[start:end] 00143 return self 00144 except struct.error as e: 00145 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00146 00147 00148 def serialize_numpy(self, buff, numpy): 00149 """ 00150 serialize message with numpy array types into buffer 00151 @param buff: buffer 00152 @type buff: StringIO 00153 @param numpy: numpy python module 00154 @type numpy module 00155 """ 00156 try: 00157 _x = self.model_name 00158 length = len(_x) 00159 buff.write(struct.pack('<I%ss'%length, length, _x)) 00160 _x = self 00161 buff.write(_struct_13d.pack(_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.twist.linear.x, _x.twist.linear.y, _x.twist.linear.z, _x.twist.angular.x, _x.twist.angular.y, _x.twist.angular.z)) 00162 _x = self.reference_frame 00163 length = len(_x) 00164 buff.write(struct.pack('<I%ss'%length, length, _x)) 00165 except struct.error as se: self._check_types(se) 00166 except TypeError as te: self._check_types(te) 00167 00168 def deserialize_numpy(self, str, numpy): 00169 """ 00170 unpack serialized message in str into this message instance using numpy for array types 00171 @param str: byte array of serialized message 00172 @type str: str 00173 @param numpy: numpy python module 00174 @type numpy: module 00175 """ 00176 try: 00177 if self.pose is None: 00178 self.pose = geometry_msgs.msg.Pose() 00179 if self.twist is None: 00180 self.twist = geometry_msgs.msg.Twist() 00181 end = 0 00182 start = end 00183 end += 4 00184 (length,) = _struct_I.unpack(str[start:end]) 00185 start = end 00186 end += length 00187 self.model_name = str[start:end] 00188 _x = self 00189 start = end 00190 end += 104 00191 (_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.twist.linear.x, _x.twist.linear.y, _x.twist.linear.z, _x.twist.angular.x, _x.twist.angular.y, _x.twist.angular.z,) = _struct_13d.unpack(str[start:end]) 00192 start = end 00193 end += 4 00194 (length,) = _struct_I.unpack(str[start:end]) 00195 start = end 00196 end += length 00197 self.reference_frame = str[start:end] 00198 return self 00199 except struct.error as e: 00200 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00201 00202 _struct_I = roslib.message.struct_I 00203 _struct_13d = struct.Struct("<13d")