00001 """autogenerated by genmsg_py from InteractiveMarker.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import roslib.rostime
00006 import geometry_msgs.msg
00007 import visualization_msgs.msg
00008 import std_msgs.msg
00009
00010 class InteractiveMarker(roslib.message.Message):
00011 _md5sum = "97d10a9c6371692b469f5814d4156b68"
00012 _type = "visualization_msgs/InteractiveMarker"
00013 _has_header = True
00014 _full_text = """# Time/frame info.
00015 # If header.time is set to 0, the marker will be retransformed into
00016 # its frame on each timestep. You will receive the pose feedback
00017 # in the same frame.
00018 # Otherwise, you might receive feedback in a different frame.
00019 # For rviz, this will be the current 'fixed frame' set by the user.
00020 Header header
00021
00022 # Initial pose. Also, defines the pivot point for rotations.
00023 geometry_msgs/Pose pose
00024
00025 # Identifying string. Must be globally unique in
00026 # the topic that this message is sent through.
00027 string name
00028
00029 # Short description (< 40 characters).
00030 string description
00031
00032 # Scale to be used for default controls (default=1).
00033 float32 scale
00034
00035 # All menu and submenu entries associated with this marker.
00036 MenuEntry[] menu_entries
00037
00038 # List of controls displayed for this marker.
00039 InteractiveMarkerControl[] controls
00040
00041 ================================================================================
00042 MSG: std_msgs/Header
00043 # Standard metadata for higher-level stamped data types.
00044 # This is generally used to communicate timestamped data
00045 # in a particular coordinate frame.
00046 #
00047 # sequence ID: consecutively increasing ID
00048 uint32 seq
00049 #Two-integer timestamp that is expressed as:
00050 # * stamp.secs: seconds (stamp_secs) since epoch
00051 # * stamp.nsecs: nanoseconds since stamp_secs
00052 # time-handling sugar is provided by the client library
00053 time stamp
00054 #Frame this data is associated with
00055 # 0: no frame
00056 # 1: global frame
00057 string frame_id
00058
00059 ================================================================================
00060 MSG: geometry_msgs/Pose
00061 # A representation of pose in free space, composed of postion and orientation.
00062 Point position
00063 Quaternion orientation
00064
00065 ================================================================================
00066 MSG: geometry_msgs/Point
00067 # This contains the position of a point in free space
00068 float64 x
00069 float64 y
00070 float64 z
00071
00072 ================================================================================
00073 MSG: geometry_msgs/Quaternion
00074 # This represents an orientation in free space in quaternion form.
00075
00076 float64 x
00077 float64 y
00078 float64 z
00079 float64 w
00080
00081 ================================================================================
00082 MSG: visualization_msgs/MenuEntry
00083 # MenuEntry message.
00084
00085 # Each InteractiveMarker message has an array of MenuEntry messages.
00086 # A collection of MenuEntries together describe a
00087 # menu/submenu/subsubmenu/etc tree, though they are stored in a flat
00088 # array. The tree structure is represented by giving each menu entry
00089 # an ID number and a "parent_id" field. Top-level entries are the
00090 # ones with parent_id = 0. Menu entries are ordered within their
00091 # level the same way they are ordered in the containing array. Parent
00092 # entries must appear before their children.
00093
00094 # Example:
00095 # - id = 3
00096 # parent_id = 0
00097 # title = "fun"
00098 # - id = 2
00099 # parent_id = 0
00100 # title = "robot"
00101 # - id = 4
00102 # parent_id = 2
00103 # title = "pr2"
00104 # - id = 5
00105 # parent_id = 2
00106 # title = "turtle"
00107 #
00108 # Gives a menu tree like this:
00109 # - fun
00110 # - robot
00111 # - pr2
00112 # - turtle
00113
00114 # ID is a number for each menu entry. Must be unique within the
00115 # control, and should never be 0.
00116 uint32 id
00117
00118 # ID of the parent of this menu entry, if it is a submenu. If this
00119 # menu entry is a top-level entry, set parent_id to 0.
00120 uint32 parent_id
00121
00122 # menu / entry title
00123 string title
00124
00125 # Arguments to command indicated by command_type (below)
00126 string command
00127
00128 # Command_type stores the type of response desired when this menu
00129 # entry is clicked.
00130 # FEEDBACK: send an InteractiveMarkerFeedback message with menu_entry_id set to this entry's id.
00131 # ROSRUN: execute "rosrun" with arguments given in the command field (above).
00132 # ROSLAUNCH: execute "roslaunch" with arguments given in the command field (above).
00133 uint8 FEEDBACK=0
00134 uint8 ROSRUN=1
00135 uint8 ROSLAUNCH=2
00136 uint8 command_type
00137
00138 ================================================================================
00139 MSG: visualization_msgs/InteractiveMarkerControl
00140 # Represents a control that is to be displayed together with an interactive marker
00141
00142 # Identifying string for this control.
00143 # You need to assign a unique value to this to receive feedback from the GUI
00144 # on what actions the user performs on this control (e.g. a button click).
00145 string name
00146
00147
00148 # Defines the local coordinate frame (relative to the pose of the parent
00149 # interactive marker) in which is being rotated and translated.
00150 # Default: Identity
00151 geometry_msgs/Quaternion orientation
00152
00153
00154 # Orientation mode: controls how orientation changes.
00155 # INHERIT: Follow orientation of interactive marker
00156 # FIXED: Keep orientation fixed at initial state
00157 # VIEW_FACING: Align y-z plane with screen (x: forward, y:left, z:up).
00158 uint8 INHERIT = 0
00159 uint8 FIXED = 1
00160 uint8 VIEW_FACING = 2
00161
00162 uint8 orientation_mode
00163
00164 # Interaction mode for this control
00165 #
00166 # NONE: This control is only meant for visualization; no context menu.
00167 # MENU: Like NONE, but right-click menu is active.
00168 # BUTTON: Element can be left-clicked.
00169 # MOVE_AXIS: Translate along local x-axis.
00170 # MOVE_PLANE: Translate in local y-z plane.
00171 # ROTATE_AXIS: Rotate around local x-axis.
00172 # MOVE_ROTATE: Combines MOVE_PLANE and ROTATE_AXIS.
00173 uint8 NONE = 0
00174 uint8 MENU = 1
00175 uint8 BUTTON = 2
00176 uint8 MOVE_AXIS = 3
00177 uint8 MOVE_PLANE = 4
00178 uint8 ROTATE_AXIS = 5
00179 uint8 MOVE_ROTATE = 6
00180
00181 uint8 interaction_mode
00182
00183
00184 # If true, the contained markers will also be visible
00185 # when the gui is not in interactive mode.
00186 bool always_visible
00187
00188
00189 # Markers to be displayed as custom visual representation.
00190 # Leave this empty to use the default control handles.
00191 #
00192 # Note:
00193 # - The markers can be defined in an arbitrary coordinate frame,
00194 # but will be transformed into the local frame of the interactive marker.
00195 # - If the header of a marker is empty, its pose will be interpreted as
00196 # relative to the pose of the parent interactive marker.
00197 Marker[] markers
00198
00199
00200 # In VIEW_FACING mode, set this to true if you don't want the markers
00201 # to be aligned with the camera view point. The markers will show up
00202 # as in INHERIT mode.
00203 bool independent_marker_orientation
00204
00205
00206 # Short description (< 40 characters) of what this control does,
00207 # e.g. "Move the robot".
00208 # Default: A generic description based on the interaction mode
00209 string description
00210
00211 ================================================================================
00212 MSG: visualization_msgs/Marker
00213 # See http://www.ros.org/wiki/rviz/DisplayTypes/Marker and http://www.ros.org/wiki/rviz/Tutorials/Markers%3A%20Basic%20Shapes for more information on using this message with rviz
00214
00215 uint8 ARROW=0
00216 uint8 CUBE=1
00217 uint8 SPHERE=2
00218 uint8 CYLINDER=3
00219 uint8 LINE_STRIP=4
00220 uint8 LINE_LIST=5
00221 uint8 CUBE_LIST=6
00222 uint8 SPHERE_LIST=7
00223 uint8 POINTS=8
00224 uint8 TEXT_VIEW_FACING=9
00225 uint8 MESH_RESOURCE=10
00226 uint8 TRIANGLE_LIST=11
00227
00228 uint8 ADD=0
00229 uint8 MODIFY=0
00230 uint8 DELETE=2
00231
00232 Header header # header for time/frame information
00233 string ns # Namespace to place this object in... used in conjunction with id to create a unique name for the object
00234 int32 id # object ID useful in conjunction with the namespace for manipulating and deleting the object later
00235 int32 type # Type of object
00236 int32 action # 0 add/modify an object, 1 (deprecated), 2 deletes an object
00237 geometry_msgs/Pose pose # Pose of the object
00238 geometry_msgs/Vector3 scale # Scale of the object 1,1,1 means default (usually 1 meter square)
00239 std_msgs/ColorRGBA color # Color [0.0-1.0]
00240 duration lifetime # How long the object should last before being automatically deleted. 0 means forever
00241 bool frame_locked # If this marker should be frame-locked, i.e. retransformed into its frame every timestep
00242
00243 #Only used if the type specified has some use for them (eg. POINTS, LINE_STRIP, ...)
00244 geometry_msgs/Point[] points
00245 #Only used if the type specified has some use for them (eg. POINTS, LINE_STRIP, ...)
00246 #number of colors must either be 0 or equal to the number of points
00247 #NOTE: alpha is not yet used
00248 std_msgs/ColorRGBA[] colors
00249
00250 # NOTE: only used for text markers
00251 string text
00252
00253 # NOTE: only used for MESH_RESOURCE markers
00254 string mesh_resource
00255 bool mesh_use_embedded_materials
00256
00257 ================================================================================
00258 MSG: geometry_msgs/Vector3
00259 # This represents a vector in free space.
00260
00261 float64 x
00262 float64 y
00263 float64 z
00264 ================================================================================
00265 MSG: std_msgs/ColorRGBA
00266 float32 r
00267 float32 g
00268 float32 b
00269 float32 a
00270
00271 """
00272 __slots__ = ['header','pose','name','description','scale','menu_entries','controls']
00273 _slot_types = ['Header','geometry_msgs/Pose','string','string','float32','visualization_msgs/MenuEntry[]','visualization_msgs/InteractiveMarkerControl[]']
00274
00275 def __init__(self, *args, **kwds):
00276 """
00277 Constructor. Any message fields that are implicitly/explicitly
00278 set to None will be assigned a default value. The recommend
00279 use is keyword arguments as this is more robust to future message
00280 changes. You cannot mix in-order arguments and keyword arguments.
00281
00282 The available fields are:
00283 header,pose,name,description,scale,menu_entries,controls
00284
00285 @param args: complete set of field values, in .msg order
00286 @param kwds: use keyword arguments corresponding to message field names
00287 to set specific fields.
00288 """
00289 if args or kwds:
00290 super(InteractiveMarker, self).__init__(*args, **kwds)
00291
00292 if self.header is None:
00293 self.header = std_msgs.msg._Header.Header()
00294 if self.pose is None:
00295 self.pose = geometry_msgs.msg.Pose()
00296 if self.name is None:
00297 self.name = ''
00298 if self.description is None:
00299 self.description = ''
00300 if self.scale is None:
00301 self.scale = 0.
00302 if self.menu_entries is None:
00303 self.menu_entries = []
00304 if self.controls is None:
00305 self.controls = []
00306 else:
00307 self.header = std_msgs.msg._Header.Header()
00308 self.pose = geometry_msgs.msg.Pose()
00309 self.name = ''
00310 self.description = ''
00311 self.scale = 0.
00312 self.menu_entries = []
00313 self.controls = []
00314
00315 def _get_types(self):
00316 """
00317 internal API method
00318 """
00319 return self._slot_types
00320
00321 def serialize(self, buff):
00322 """
00323 serialize message into buffer
00324 @param buff: buffer
00325 @type buff: StringIO
00326 """
00327 try:
00328 _x = self
00329 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00330 _x = self.header.frame_id
00331 length = len(_x)
00332 buff.write(struct.pack('<I%ss'%length, length, _x))
00333 _x = self
00334 buff.write(_struct_7d.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))
00335 _x = self.name
00336 length = len(_x)
00337 buff.write(struct.pack('<I%ss'%length, length, _x))
00338 _x = self.description
00339 length = len(_x)
00340 buff.write(struct.pack('<I%ss'%length, length, _x))
00341 buff.write(_struct_f.pack(self.scale))
00342 length = len(self.menu_entries)
00343 buff.write(_struct_I.pack(length))
00344 for val1 in self.menu_entries:
00345 _x = val1
00346 buff.write(_struct_2I.pack(_x.id, _x.parent_id))
00347 _x = val1.title
00348 length = len(_x)
00349 buff.write(struct.pack('<I%ss'%length, length, _x))
00350 _x = val1.command
00351 length = len(_x)
00352 buff.write(struct.pack('<I%ss'%length, length, _x))
00353 buff.write(_struct_B.pack(val1.command_type))
00354 length = len(self.controls)
00355 buff.write(_struct_I.pack(length))
00356 for val1 in self.controls:
00357 _x = val1.name
00358 length = len(_x)
00359 buff.write(struct.pack('<I%ss'%length, length, _x))
00360 _v1 = val1.orientation
00361 _x = _v1
00362 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00363 _x = val1
00364 buff.write(_struct_3B.pack(_x.orientation_mode, _x.interaction_mode, _x.always_visible))
00365 length = len(val1.markers)
00366 buff.write(_struct_I.pack(length))
00367 for val2 in val1.markers:
00368 _v2 = val2.header
00369 buff.write(_struct_I.pack(_v2.seq))
00370 _v3 = _v2.stamp
00371 _x = _v3
00372 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00373 _x = _v2.frame_id
00374 length = len(_x)
00375 buff.write(struct.pack('<I%ss'%length, length, _x))
00376 _x = val2.ns
00377 length = len(_x)
00378 buff.write(struct.pack('<I%ss'%length, length, _x))
00379 _x = val2
00380 buff.write(_struct_3i.pack(_x.id, _x.type, _x.action))
00381 _v4 = val2.pose
00382 _v5 = _v4.position
00383 _x = _v5
00384 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00385 _v6 = _v4.orientation
00386 _x = _v6
00387 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00388 _v7 = val2.scale
00389 _x = _v7
00390 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00391 _v8 = val2.color
00392 _x = _v8
00393 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a))
00394 _v9 = val2.lifetime
00395 _x = _v9
00396 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00397 buff.write(_struct_B.pack(val2.frame_locked))
00398 length = len(val2.points)
00399 buff.write(_struct_I.pack(length))
00400 for val3 in val2.points:
00401 _x = val3
00402 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00403 length = len(val2.colors)
00404 buff.write(_struct_I.pack(length))
00405 for val3 in val2.colors:
00406 _x = val3
00407 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a))
00408 _x = val2.text
00409 length = len(_x)
00410 buff.write(struct.pack('<I%ss'%length, length, _x))
00411 _x = val2.mesh_resource
00412 length = len(_x)
00413 buff.write(struct.pack('<I%ss'%length, length, _x))
00414 buff.write(_struct_B.pack(val2.mesh_use_embedded_materials))
00415 buff.write(_struct_B.pack(val1.independent_marker_orientation))
00416 _x = val1.description
00417 length = len(_x)
00418 buff.write(struct.pack('<I%ss'%length, length, _x))
00419 except struct.error as se: self._check_types(se)
00420 except TypeError as te: self._check_types(te)
00421
00422 def deserialize(self, str):
00423 """
00424 unpack serialized message in str into this message instance
00425 @param str: byte array of serialized message
00426 @type str: str
00427 """
00428 try:
00429 if self.header is None:
00430 self.header = std_msgs.msg._Header.Header()
00431 if self.pose is None:
00432 self.pose = geometry_msgs.msg.Pose()
00433 end = 0
00434 _x = self
00435 start = end
00436 end += 12
00437 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00438 start = end
00439 end += 4
00440 (length,) = _struct_I.unpack(str[start:end])
00441 start = end
00442 end += length
00443 self.header.frame_id = str[start:end]
00444 _x = self
00445 start = end
00446 end += 56
00447 (_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,) = _struct_7d.unpack(str[start:end])
00448 start = end
00449 end += 4
00450 (length,) = _struct_I.unpack(str[start:end])
00451 start = end
00452 end += length
00453 self.name = str[start:end]
00454 start = end
00455 end += 4
00456 (length,) = _struct_I.unpack(str[start:end])
00457 start = end
00458 end += length
00459 self.description = str[start:end]
00460 start = end
00461 end += 4
00462 (self.scale,) = _struct_f.unpack(str[start:end])
00463 start = end
00464 end += 4
00465 (length,) = _struct_I.unpack(str[start:end])
00466 self.menu_entries = []
00467 for i in range(0, length):
00468 val1 = visualization_msgs.msg.MenuEntry()
00469 _x = val1
00470 start = end
00471 end += 8
00472 (_x.id, _x.parent_id,) = _struct_2I.unpack(str[start:end])
00473 start = end
00474 end += 4
00475 (length,) = _struct_I.unpack(str[start:end])
00476 start = end
00477 end += length
00478 val1.title = str[start:end]
00479 start = end
00480 end += 4
00481 (length,) = _struct_I.unpack(str[start:end])
00482 start = end
00483 end += length
00484 val1.command = str[start:end]
00485 start = end
00486 end += 1
00487 (val1.command_type,) = _struct_B.unpack(str[start:end])
00488 self.menu_entries.append(val1)
00489 start = end
00490 end += 4
00491 (length,) = _struct_I.unpack(str[start:end])
00492 self.controls = []
00493 for i in range(0, length):
00494 val1 = visualization_msgs.msg.InteractiveMarkerControl()
00495 start = end
00496 end += 4
00497 (length,) = _struct_I.unpack(str[start:end])
00498 start = end
00499 end += length
00500 val1.name = str[start:end]
00501 _v10 = val1.orientation
00502 _x = _v10
00503 start = end
00504 end += 32
00505 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00506 _x = val1
00507 start = end
00508 end += 3
00509 (_x.orientation_mode, _x.interaction_mode, _x.always_visible,) = _struct_3B.unpack(str[start:end])
00510 val1.always_visible = bool(val1.always_visible)
00511 start = end
00512 end += 4
00513 (length,) = _struct_I.unpack(str[start:end])
00514 val1.markers = []
00515 for i in range(0, length):
00516 val2 = visualization_msgs.msg.Marker()
00517 _v11 = val2.header
00518 start = end
00519 end += 4
00520 (_v11.seq,) = _struct_I.unpack(str[start:end])
00521 _v12 = _v11.stamp
00522 _x = _v12
00523 start = end
00524 end += 8
00525 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00526 start = end
00527 end += 4
00528 (length,) = _struct_I.unpack(str[start:end])
00529 start = end
00530 end += length
00531 _v11.frame_id = str[start:end]
00532 start = end
00533 end += 4
00534 (length,) = _struct_I.unpack(str[start:end])
00535 start = end
00536 end += length
00537 val2.ns = str[start:end]
00538 _x = val2
00539 start = end
00540 end += 12
00541 (_x.id, _x.type, _x.action,) = _struct_3i.unpack(str[start:end])
00542 _v13 = val2.pose
00543 _v14 = _v13.position
00544 _x = _v14
00545 start = end
00546 end += 24
00547 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00548 _v15 = _v13.orientation
00549 _x = _v15
00550 start = end
00551 end += 32
00552 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00553 _v16 = val2.scale
00554 _x = _v16
00555 start = end
00556 end += 24
00557 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00558 _v17 = val2.color
00559 _x = _v17
00560 start = end
00561 end += 16
00562 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end])
00563 _v18 = val2.lifetime
00564 _x = _v18
00565 start = end
00566 end += 8
00567 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00568 start = end
00569 end += 1
00570 (val2.frame_locked,) = _struct_B.unpack(str[start:end])
00571 val2.frame_locked = bool(val2.frame_locked)
00572 start = end
00573 end += 4
00574 (length,) = _struct_I.unpack(str[start:end])
00575 val2.points = []
00576 for i in range(0, length):
00577 val3 = geometry_msgs.msg.Point()
00578 _x = val3
00579 start = end
00580 end += 24
00581 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00582 val2.points.append(val3)
00583 start = end
00584 end += 4
00585 (length,) = _struct_I.unpack(str[start:end])
00586 val2.colors = []
00587 for i in range(0, length):
00588 val3 = std_msgs.msg.ColorRGBA()
00589 _x = val3
00590 start = end
00591 end += 16
00592 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end])
00593 val2.colors.append(val3)
00594 start = end
00595 end += 4
00596 (length,) = _struct_I.unpack(str[start:end])
00597 start = end
00598 end += length
00599 val2.text = str[start:end]
00600 start = end
00601 end += 4
00602 (length,) = _struct_I.unpack(str[start:end])
00603 start = end
00604 end += length
00605 val2.mesh_resource = str[start:end]
00606 start = end
00607 end += 1
00608 (val2.mesh_use_embedded_materials,) = _struct_B.unpack(str[start:end])
00609 val2.mesh_use_embedded_materials = bool(val2.mesh_use_embedded_materials)
00610 val1.markers.append(val2)
00611 start = end
00612 end += 1
00613 (val1.independent_marker_orientation,) = _struct_B.unpack(str[start:end])
00614 val1.independent_marker_orientation = bool(val1.independent_marker_orientation)
00615 start = end
00616 end += 4
00617 (length,) = _struct_I.unpack(str[start:end])
00618 start = end
00619 end += length
00620 val1.description = str[start:end]
00621 self.controls.append(val1)
00622 return self
00623 except struct.error as e:
00624 raise roslib.message.DeserializationError(e)
00625
00626
00627 def serialize_numpy(self, buff, numpy):
00628 """
00629 serialize message with numpy array types into buffer
00630 @param buff: buffer
00631 @type buff: StringIO
00632 @param numpy: numpy python module
00633 @type numpy module
00634 """
00635 try:
00636 _x = self
00637 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00638 _x = self.header.frame_id
00639 length = len(_x)
00640 buff.write(struct.pack('<I%ss'%length, length, _x))
00641 _x = self
00642 buff.write(_struct_7d.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))
00643 _x = self.name
00644 length = len(_x)
00645 buff.write(struct.pack('<I%ss'%length, length, _x))
00646 _x = self.description
00647 length = len(_x)
00648 buff.write(struct.pack('<I%ss'%length, length, _x))
00649 buff.write(_struct_f.pack(self.scale))
00650 length = len(self.menu_entries)
00651 buff.write(_struct_I.pack(length))
00652 for val1 in self.menu_entries:
00653 _x = val1
00654 buff.write(_struct_2I.pack(_x.id, _x.parent_id))
00655 _x = val1.title
00656 length = len(_x)
00657 buff.write(struct.pack('<I%ss'%length, length, _x))
00658 _x = val1.command
00659 length = len(_x)
00660 buff.write(struct.pack('<I%ss'%length, length, _x))
00661 buff.write(_struct_B.pack(val1.command_type))
00662 length = len(self.controls)
00663 buff.write(_struct_I.pack(length))
00664 for val1 in self.controls:
00665 _x = val1.name
00666 length = len(_x)
00667 buff.write(struct.pack('<I%ss'%length, length, _x))
00668 _v19 = val1.orientation
00669 _x = _v19
00670 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00671 _x = val1
00672 buff.write(_struct_3B.pack(_x.orientation_mode, _x.interaction_mode, _x.always_visible))
00673 length = len(val1.markers)
00674 buff.write(_struct_I.pack(length))
00675 for val2 in val1.markers:
00676 _v20 = val2.header
00677 buff.write(_struct_I.pack(_v20.seq))
00678 _v21 = _v20.stamp
00679 _x = _v21
00680 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00681 _x = _v20.frame_id
00682 length = len(_x)
00683 buff.write(struct.pack('<I%ss'%length, length, _x))
00684 _x = val2.ns
00685 length = len(_x)
00686 buff.write(struct.pack('<I%ss'%length, length, _x))
00687 _x = val2
00688 buff.write(_struct_3i.pack(_x.id, _x.type, _x.action))
00689 _v22 = val2.pose
00690 _v23 = _v22.position
00691 _x = _v23
00692 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00693 _v24 = _v22.orientation
00694 _x = _v24
00695 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00696 _v25 = val2.scale
00697 _x = _v25
00698 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00699 _v26 = val2.color
00700 _x = _v26
00701 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a))
00702 _v27 = val2.lifetime
00703 _x = _v27
00704 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00705 buff.write(_struct_B.pack(val2.frame_locked))
00706 length = len(val2.points)
00707 buff.write(_struct_I.pack(length))
00708 for val3 in val2.points:
00709 _x = val3
00710 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00711 length = len(val2.colors)
00712 buff.write(_struct_I.pack(length))
00713 for val3 in val2.colors:
00714 _x = val3
00715 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a))
00716 _x = val2.text
00717 length = len(_x)
00718 buff.write(struct.pack('<I%ss'%length, length, _x))
00719 _x = val2.mesh_resource
00720 length = len(_x)
00721 buff.write(struct.pack('<I%ss'%length, length, _x))
00722 buff.write(_struct_B.pack(val2.mesh_use_embedded_materials))
00723 buff.write(_struct_B.pack(val1.independent_marker_orientation))
00724 _x = val1.description
00725 length = len(_x)
00726 buff.write(struct.pack('<I%ss'%length, length, _x))
00727 except struct.error as se: self._check_types(se)
00728 except TypeError as te: self._check_types(te)
00729
00730 def deserialize_numpy(self, str, numpy):
00731 """
00732 unpack serialized message in str into this message instance using numpy for array types
00733 @param str: byte array of serialized message
00734 @type str: str
00735 @param numpy: numpy python module
00736 @type numpy: module
00737 """
00738 try:
00739 if self.header is None:
00740 self.header = std_msgs.msg._Header.Header()
00741 if self.pose is None:
00742 self.pose = geometry_msgs.msg.Pose()
00743 end = 0
00744 _x = self
00745 start = end
00746 end += 12
00747 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00748 start = end
00749 end += 4
00750 (length,) = _struct_I.unpack(str[start:end])
00751 start = end
00752 end += length
00753 self.header.frame_id = str[start:end]
00754 _x = self
00755 start = end
00756 end += 56
00757 (_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,) = _struct_7d.unpack(str[start:end])
00758 start = end
00759 end += 4
00760 (length,) = _struct_I.unpack(str[start:end])
00761 start = end
00762 end += length
00763 self.name = str[start:end]
00764 start = end
00765 end += 4
00766 (length,) = _struct_I.unpack(str[start:end])
00767 start = end
00768 end += length
00769 self.description = str[start:end]
00770 start = end
00771 end += 4
00772 (self.scale,) = _struct_f.unpack(str[start:end])
00773 start = end
00774 end += 4
00775 (length,) = _struct_I.unpack(str[start:end])
00776 self.menu_entries = []
00777 for i in range(0, length):
00778 val1 = visualization_msgs.msg.MenuEntry()
00779 _x = val1
00780 start = end
00781 end += 8
00782 (_x.id, _x.parent_id,) = _struct_2I.unpack(str[start:end])
00783 start = end
00784 end += 4
00785 (length,) = _struct_I.unpack(str[start:end])
00786 start = end
00787 end += length
00788 val1.title = str[start:end]
00789 start = end
00790 end += 4
00791 (length,) = _struct_I.unpack(str[start:end])
00792 start = end
00793 end += length
00794 val1.command = str[start:end]
00795 start = end
00796 end += 1
00797 (val1.command_type,) = _struct_B.unpack(str[start:end])
00798 self.menu_entries.append(val1)
00799 start = end
00800 end += 4
00801 (length,) = _struct_I.unpack(str[start:end])
00802 self.controls = []
00803 for i in range(0, length):
00804 val1 = visualization_msgs.msg.InteractiveMarkerControl()
00805 start = end
00806 end += 4
00807 (length,) = _struct_I.unpack(str[start:end])
00808 start = end
00809 end += length
00810 val1.name = str[start:end]
00811 _v28 = val1.orientation
00812 _x = _v28
00813 start = end
00814 end += 32
00815 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00816 _x = val1
00817 start = end
00818 end += 3
00819 (_x.orientation_mode, _x.interaction_mode, _x.always_visible,) = _struct_3B.unpack(str[start:end])
00820 val1.always_visible = bool(val1.always_visible)
00821 start = end
00822 end += 4
00823 (length,) = _struct_I.unpack(str[start:end])
00824 val1.markers = []
00825 for i in range(0, length):
00826 val2 = visualization_msgs.msg.Marker()
00827 _v29 = val2.header
00828 start = end
00829 end += 4
00830 (_v29.seq,) = _struct_I.unpack(str[start:end])
00831 _v30 = _v29.stamp
00832 _x = _v30
00833 start = end
00834 end += 8
00835 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00836 start = end
00837 end += 4
00838 (length,) = _struct_I.unpack(str[start:end])
00839 start = end
00840 end += length
00841 _v29.frame_id = str[start:end]
00842 start = end
00843 end += 4
00844 (length,) = _struct_I.unpack(str[start:end])
00845 start = end
00846 end += length
00847 val2.ns = str[start:end]
00848 _x = val2
00849 start = end
00850 end += 12
00851 (_x.id, _x.type, _x.action,) = _struct_3i.unpack(str[start:end])
00852 _v31 = val2.pose
00853 _v32 = _v31.position
00854 _x = _v32
00855 start = end
00856 end += 24
00857 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00858 _v33 = _v31.orientation
00859 _x = _v33
00860 start = end
00861 end += 32
00862 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00863 _v34 = val2.scale
00864 _x = _v34
00865 start = end
00866 end += 24
00867 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00868 _v35 = val2.color
00869 _x = _v35
00870 start = end
00871 end += 16
00872 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end])
00873 _v36 = val2.lifetime
00874 _x = _v36
00875 start = end
00876 end += 8
00877 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00878 start = end
00879 end += 1
00880 (val2.frame_locked,) = _struct_B.unpack(str[start:end])
00881 val2.frame_locked = bool(val2.frame_locked)
00882 start = end
00883 end += 4
00884 (length,) = _struct_I.unpack(str[start:end])
00885 val2.points = []
00886 for i in range(0, length):
00887 val3 = geometry_msgs.msg.Point()
00888 _x = val3
00889 start = end
00890 end += 24
00891 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00892 val2.points.append(val3)
00893 start = end
00894 end += 4
00895 (length,) = _struct_I.unpack(str[start:end])
00896 val2.colors = []
00897 for i in range(0, length):
00898 val3 = std_msgs.msg.ColorRGBA()
00899 _x = val3
00900 start = end
00901 end += 16
00902 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end])
00903 val2.colors.append(val3)
00904 start = end
00905 end += 4
00906 (length,) = _struct_I.unpack(str[start:end])
00907 start = end
00908 end += length
00909 val2.text = str[start:end]
00910 start = end
00911 end += 4
00912 (length,) = _struct_I.unpack(str[start:end])
00913 start = end
00914 end += length
00915 val2.mesh_resource = str[start:end]
00916 start = end
00917 end += 1
00918 (val2.mesh_use_embedded_materials,) = _struct_B.unpack(str[start:end])
00919 val2.mesh_use_embedded_materials = bool(val2.mesh_use_embedded_materials)
00920 val1.markers.append(val2)
00921 start = end
00922 end += 1
00923 (val1.independent_marker_orientation,) = _struct_B.unpack(str[start:end])
00924 val1.independent_marker_orientation = bool(val1.independent_marker_orientation)
00925 start = end
00926 end += 4
00927 (length,) = _struct_I.unpack(str[start:end])
00928 start = end
00929 end += length
00930 val1.description = str[start:end]
00931 self.controls.append(val1)
00932 return self
00933 except struct.error as e:
00934 raise roslib.message.DeserializationError(e)
00935
00936 _struct_I = roslib.message.struct_I
00937 _struct_7d = struct.Struct("<7d")
00938 _struct_f = struct.Struct("<f")
00939 _struct_3i = struct.Struct("<3i")
00940 _struct_2i = struct.Struct("<2i")
00941 _struct_3I = struct.Struct("<3I")
00942 _struct_B = struct.Struct("<B")
00943 _struct_4f = struct.Struct("<4f")
00944 _struct_3B = struct.Struct("<3B")
00945 _struct_4d = struct.Struct("<4d")
00946 _struct_2I = struct.Struct("<2I")
00947 _struct_3d = struct.Struct("<3d")