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