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