Class: Visualization_msgs::InteractiveMarkerControl

Inherits:
ROS::Message
  • Object
show all
Defined in:
lib/visualization_msgs/InteractiveMarkerControl.rb

Constant Summary collapse

INHERIT =

Pseudo-constants

0
FIXED =
1
VIEW_FACING =
2
NONE =
0
1
BUTTON =
2
MOVE_AXIS =
3
MOVE_PLANE =
4
ROTATE_AXIS =
5
MOVE_ROTATE =
6
@@struct_C =
::ROS::Struct.new("C")
@@struct_l2 =
::ROS::Struct.new("l2")
@@struct_l3 =
::ROS::Struct.new("l3")
@@struct_d4C3 =
::ROS::Struct.new("d4C3")
@@struct_f4 =
::ROS::Struct.new("f4")
@@struct_d4 =
::ROS::Struct.new("d4")
@@struct_L2 =
::ROS::Struct.new("L2")
@@struct_d3 =
::ROS::Struct.new("d3")
@@struct_L =
::ROS::Struct.new("L")
@@slot_types =
['string','geometry_msgs/Quaternion','uint8','uint8','bool','visualization_msgs/Marker[]','bool','string']

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ InteractiveMarkerControl

Constructor. You can set the default values using keyword operators.

Parameters:

  • args (Hash) (defaults to: {})

    keyword for initializing values

Options Hash (args):

  • :name (string)

    initialize value

  • :orientation (geometry_msgs/Quaternion)

    initialize value

  • :orientation_mode (uint8)

    initialize value

  • :interaction_mode (uint8)

    initialize value

  • :always_visible (bool)

    initialize value

  • :markers (visualization_msgs/Marker[])

    initialize value

  • :independent_marker_orientation (bool)

    initialize value

  • :description (string)

    initialize value



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 239

def initialize(args={})
  # message fields cannot be None, assign default values for those that are
  if args[:name]
    @name = args[:name]
  else
    @name = ''
  end
  if args[:orientation]
    @orientation = args[:orientation]
  else
    @orientation = Geometry_msgs::Quaternion.new
  end
  if args[:orientation_mode]
    @orientation_mode = args[:orientation_mode]
  else
    @orientation_mode = 0
  end
  if args[:interaction_mode]
    @interaction_mode = args[:interaction_mode]
  else
    @interaction_mode = 0
  end
  if args[:always_visible]
    @always_visible = args[:always_visible]
  else
    @always_visible = false
  end
  if args[:markers]
    @markers = args[:markers]
  else
    @markers = []
  end
  if args[:independent_marker_orientation]
    @independent_marker_orientation = args[:independent_marker_orientation]
  else
    @independent_marker_orientation = false
  end
  if args[:description]
    @description = args[:description]
  else
    @description = ''
  end
end

Instance Attribute Details

#always_visibleObject

Returns the value of attribute always_visible.



214
215
216
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 214

def always_visible
  @always_visible
end

#descriptionObject

Returns the value of attribute description.



214
215
216
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 214

def description
  @description
end

#independent_marker_orientationObject

Returns the value of attribute independent_marker_orientation.



214
215
216
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 214

def independent_marker_orientation
  @independent_marker_orientation
end

#interaction_modeObject

Returns the value of attribute interaction_mode.



214
215
216
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 214

def interaction_mode
  @interaction_mode
end

#markersObject

Returns the value of attribute markers.



214
215
216
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 214

def markers
  @markers
end

#nameObject

Returns the value of attribute name.



214
215
216
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 214

def name
  @name
end

#orientationObject

Returns the value of attribute orientation.



214
215
216
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 214

def orientation
  @orientation
end

#orientation_modeObject

Returns the value of attribute orientation_mode.



214
215
216
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 214

def orientation_mode
  @orientation_mode
end

Class Method Details

.md5sumObject



16
17
18
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 16

def self.md5sum
  "f69c49e4eb251b5b0a89651eebf5a277"
end

.typeObject



20
21
22
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 20

def self.type
  "visualization_msgs/InteractiveMarkerControl"
end

Instance Method Details

#_get_typesString

internal API method

Returns:

  • (String)

    Message type string.



285
286
287
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 285

def _get_types
  @slot_types
end

#deserialize(str) ⇒ Object

unpack serialized message in str into this message instance

@param [String] str: byte array of serialized message


362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 362

def deserialize(str)

  begin
    if @orientation == nil
      @orientation = Geometry_msgs::Quaternion.new
    end
    end_point = 0
    start = end_point
    end_point += 4
    (length,) = @@struct_L.unpack(str[start..(end_point-1)])
    start = end_point
    end_point += length
    @name = str[start..(end_point-1)]
    start = end_point
    end_point += ROS::Struct::calc_size('d4C3')
    (@orientation.x, @orientation.y, @orientation.z, @orientation.w, @orientation_mode, @interaction_mode, @always_visible,) = @@struct_d4C3.unpack(str[start..(end_point-1)])
    @always_visible = bool(@always_visible)
    start = end_point
    end_point += 4
    (length,) = @@struct_L.unpack(str[start..(end_point-1)])
    @markers = []
    length.times do
      val1 = Visualization_msgs::Marker.new
      _v69 = val1.header
      start = end_point
      end_point += ROS::Struct::calc_size('L')
      (_v69.seq,) = @@struct_L.unpack(str[start..(end_point-1)])
      _v70 = _v69.stamp
      _x = _v70
      start = end_point
      end_point += ROS::Struct::calc_size('L2')
      (_x.secs, _x.nsecs,) = @@struct_L2.unpack(str[start..(end_point-1)])
      start = end_point
      end_point += 4
      (length,) = @@struct_L.unpack(str[start..(end_point-1)])
      start = end_point
      end_point += length
      _v69.frame_id = str[start..(end_point-1)]
      start = end_point
      end_point += 4
      (length,) = @@struct_L.unpack(str[start..(end_point-1)])
      start = end_point
      end_point += length
      val1.ns = str[start..(end_point-1)]
      _x = val1
      start = end_point
      end_point += ROS::Struct::calc_size('l3')
      (_x.id, _x.type, _x.action,) = @@struct_l3.unpack(str[start..(end_point-1)])
      _v71 = val1.pose
      _v72 = _v71.position
      _x = _v72
      start = end_point
      end_point += ROS::Struct::calc_size('d3')
      (_x.x, _x.y, _x.z,) = @@struct_d3.unpack(str[start..(end_point-1)])
      _v73 = _v71.orientation
      _x = _v73
      start = end_point
      end_point += ROS::Struct::calc_size('d4')
      (_x.x, _x.y, _x.z, _x.w,) = @@struct_d4.unpack(str[start..(end_point-1)])
      _v74 = val1.scale
      _x = _v74
      start = end_point
      end_point += ROS::Struct::calc_size('d3')
      (_x.x, _x.y, _x.z,) = @@struct_d3.unpack(str[start..(end_point-1)])
      _v75 = val1.color
      _x = _v75
      start = end_point
      end_point += ROS::Struct::calc_size('f4')
      (_x.r, _x.g, _x.b, _x.a,) = @@struct_f4.unpack(str[start..(end_point-1)])
      _v76 = val1.lifetime
      _x = _v76
      start = end_point
      end_point += ROS::Struct::calc_size('l2')
      (_x.secs, _x.nsecs,) = @@struct_l2.unpack(str[start..(end_point-1)])
      start = end_point
      end_point += ROS::Struct::calc_size('C')
      (val1.frame_locked,) = @@struct_C.unpack(str[start..(end_point-1)])
      val1.frame_locked = bool(val1.frame_locked)
      start = end_point
      end_point += 4
      (length,) = @@struct_L.unpack(str[start..(end_point-1)])
      val1.points = []
      length.times do
        val2 = Geometry_msgs::Point.new
        _x = val2
        start = end_point
        end_point += ROS::Struct::calc_size('d3')
        (_x.x, _x.y, _x.z,) = @@struct_d3.unpack(str[start..(end_point-1)])
        val1.points.push(val2)
      end
      start = end_point
      end_point += 4
      (length,) = @@struct_L.unpack(str[start..(end_point-1)])
      val1.colors = []
      length.times do
        val2 = Std_msgs::ColorRGBA.new
        _x = val2
        start = end_point
        end_point += ROS::Struct::calc_size('f4')
        (_x.r, _x.g, _x.b, _x.a,) = @@struct_f4.unpack(str[start..(end_point-1)])
        val1.colors.push(val2)
      end
      start = end_point
      end_point += 4
      (length,) = @@struct_L.unpack(str[start..(end_point-1)])
      start = end_point
      end_point += length
      val1.text = str[start..(end_point-1)]
      start = end_point
      end_point += 4
      (length,) = @@struct_L.unpack(str[start..(end_point-1)])
      start = end_point
      end_point += length
      val1.mesh_resource = str[start..(end_point-1)]
      start = end_point
      end_point += ROS::Struct::calc_size('C')
      (val1.mesh_use_embedded_materials,) = @@struct_C.unpack(str[start..(end_point-1)])
      val1.mesh_use_embedded_materials = bool(val1.mesh_use_embedded_materials)
      @markers.push(val1)
    end
    start = end_point
    end_point += ROS::Struct::calc_size('C')
    (@independent_marker_orientation,) = @@struct_C.unpack(str[start..(end_point-1)])
    @independent_marker_orientation = bool(@independent_marker_orientation)
    start = end_point
    end_point += 4
    (length,) = @@struct_L.unpack(str[start..(end_point-1)])
    start = end_point
    end_point += length
    @description = str[start..(end_point-1)]
    return self
  rescue => exception
    raise "message DeserializationError: #{exception}" #most likely buffer underfill
  end
end

#has_header?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 24

def has_header?
  false
end

#message_definitionObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 28

def message_definition
  "# Represents a control that is to be displayed together with an interactive marker

# Identifying string for this control.
# You need to assign a unique value to this to receive feedback from the GUI
# on what actions the user performs on this control (e.g. a button click).
string name


# Defines the local coordinate frame (relative to the pose of the parent
# interactive marker) in which is being rotated and translated.
# Default: Identity
geometry_msgs/Quaternion orientation


# Orientation mode: controls how orientation changes.
# INHERIT: Follow orientation of interactive marker
# FIXED: Keep orientation fixed at initial state
# VIEW_FACING: Align y-z plane with screen (x: forward, y:left, z:up).
uint8 INHERIT = 0 
uint8 FIXED = 1
uint8 VIEW_FACING = 2

uint8 orientation_mode

# Interaction mode for this control
# 
# NONE: This control is only meant for visualization; no context menu.
# MENU: Like NONE, but right-click menu is active.
# BUTTON: Element can be left-clicked.
# MOVE_AXIS: Translate along local x-axis.
# MOVE_PLANE: Translate in local y-z plane.
# ROTATE_AXIS: Rotate around local x-axis.
# MOVE_ROTATE: Combines MOVE_PLANE and ROTATE_AXIS.
uint8 NONE = 0 
uint8 MENU = 1
uint8 BUTTON = 2
uint8 MOVE_AXIS = 3 
uint8 MOVE_PLANE = 4
uint8 ROTATE_AXIS = 5
uint8 MOVE_ROTATE = 6

uint8 interaction_mode


# If true, the contained markers will also be visible
# when the gui is not in interactive mode.
bool always_visible


# Markers to be displayed as custom visual representation.
# Leave this empty to use the default control handles.
#
# Note: 
# - The markers can be defined in an arbitrary coordinate frame,
#   but will be transformed into the local frame of the interactive marker.
# - If the header of a marker is empty, its pose will be interpreted as 
#   relative to the pose of the parent interactive marker.
Marker[] markers


# In VIEW_FACING mode, set this to true if you don't want the markers
# to be aligned with the camera view point. The markers will show up
# as in INHERIT mode.
bool independent_marker_orientation


# Short description (< 40 characters) of what this control does,
# e.g. \"Move the robot\". 
# Default: A generic description based on the interaction mode
string description

================================================================================
MSG: geometry_msgs/Quaternion
# This represents an orientation in free space in quaternion form.

float64 x
float64 y
float64 z
float64 w

================================================================================
MSG: visualization_msgs/Marker
# 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

uint8 ARROW=0
uint8 CUBE=1
uint8 SPHERE=2
uint8 CYLINDER=3
uint8 LINE_STRIP=4
uint8 LINE_LIST=5
uint8 CUBE_LIST=6
uint8 SPHERE_LIST=7
uint8 POINTS=8
uint8 TEXT_VIEW_FACING=9
uint8 MESH_RESOURCE=10
uint8 TRIANGLE_LIST=11

uint8 ADD=0
uint8 MODIFY=0
uint8 DELETE=2

Header header                        # header for time/frame information
string ns                            # Namespace to place this object in... used in conjunction with id to create a unique name for the object
int32 id 		                         # object ID useful in conjunction with the namespace for manipulating and deleting the object later
int32 type 		                       # Type of object
int32 action 	                       # 0 add/modify an object, 1 (deprecated), 2 deletes an object
geometry_msgs/Pose pose                 # Pose of the object
geometry_msgs/Vector3 scale             # Scale of the object 1,1,1 means default (usually 1 meter square)
std_msgs/ColorRGBA color             # Color [0.0-1.0]
duration lifetime                    # How long the object should last before being automatically deleted.  0 means forever
bool frame_locked                    # If this marker should be frame-locked, i.e. retransformed into its frame every timestep

#Only used if the type specified has some use for them (eg. POINTS, LINE_STRIP, ...)
geometry_msgs/Point[] points
#Only used if the type specified has some use for them (eg. POINTS, LINE_STRIP, ...)
#number of colors must either be 0 or equal to the number of points
#NOTE: alpha is not yet used
std_msgs/ColorRGBA[] colors

# NOTE: only used for text markers
string text

# NOTE: only used for MESH_RESOURCE markers
string mesh_resource
bool mesh_use_embedded_materials

================================================================================
MSG: std_msgs/Header
# Standard metadata for higher-level stamped data types.
# This is generally used to communicate timestamped data 
# in a particular coordinate frame.
# 
# sequence ID: consecutively increasing ID 
uint32 seq
#Two-integer timestamp that is expressed as:
# * stamp.secs: seconds (stamp_secs) since epoch
# * stamp.nsecs: nanoseconds since stamp_secs
# time-handling sugar is provided by the client library
time stamp
#Frame this data is associated with
# 0: no frame
# 1: global frame
string frame_id

================================================================================
MSG: geometry_msgs/Pose
# A representation of pose in free space, composed of postion and orientation. 
Point position
Quaternion orientation

================================================================================
MSG: geometry_msgs/Point
# This contains the position of a point in free space
float64 x
float64 y
float64 z

================================================================================
MSG: geometry_msgs/Vector3
# This represents a vector in free space. 

float64 x
float64 y
float64 z
================================================================================
MSG: std_msgs/ColorRGBA
float32 r
float32 g
float32 b
float32 a

"
end

#serialize(buff) ⇒ Object

serialize message into buffer

Parameters:

  • buff (IO)

    buffer



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/visualization_msgs/InteractiveMarkerControl.rb', line 291

def serialize(buff)
  begin
    _x = @name
    length = _x.length
    buff.write([length, _x].pack("La#{length}"))
    buff.write(@@struct_d4C3.pack(@orientation.x, @orientation.y, @orientation.z, @orientation.w, @orientation_mode, @interaction_mode, @always_visible))
    length = @markers.length
    buff.write(@@struct_L.pack(length))
    for val1 in @markers
      _v61 = val1.header
      buff.write(@@struct_L.pack(_v61.seq))
      _v62 = _v61.stamp
      _x = _v62
      buff.write(@@struct_L2.pack(_x.secs, _x.nsecs))
      _x = _v61.frame_id
      length = _x.length
      buff.write([length, _x].pack("La#{length}"))
      _x = val1.ns
      length = _x.length
      buff.write([length, _x].pack("La#{length}"))
      _x = val1
      buff.write(@@struct_l3.pack(_x.id, _x.type, _x.action))
      _v63 = val1.pose
      _v64 = _v63.position
      _x = _v64
      buff.write(@@struct_d3.pack(_x.x, _x.y, _x.z))
      _v65 = _v63.orientation
      _x = _v65
      buff.write(@@struct_d4.pack(_x.x, _x.y, _x.z, _x.w))
      _v66 = val1.scale
      _x = _v66
      buff.write(@@struct_d3.pack(_x.x, _x.y, _x.z))
      _v67 = val1.color
      _x = _v67
      buff.write(@@struct_f4.pack(_x.r, _x.g, _x.b, _x.a))
      _v68 = val1.lifetime
      _x = _v68
      buff.write(@@struct_l2.pack(_x.secs, _x.nsecs))
      buff.write(@@struct_C.pack(val1.frame_locked))
      length = val1.points.length
      buff.write(@@struct_L.pack(length))
      for val2 in val1.points
        _x = val2
        buff.write(@@struct_d3.pack(_x.x, _x.y, _x.z))
      end
      length = val1.colors.length
      buff.write(@@struct_L.pack(length))
      for val2 in val1.colors
        _x = val2
        buff.write(@@struct_f4.pack(_x.r, _x.g, _x.b, _x.a))
      end
      _x = val1.text
      length = _x.length
      buff.write([length, _x].pack("La#{length}"))
      _x = val1.mesh_resource
      length = _x.length
      buff.write([length, _x].pack("La#{length}"))
      buff.write(@@struct_C.pack(val1.mesh_use_embedded_materials))
    end
    buff.write(@@struct_C.pack(@independent_marker_orientation))
    _x = @description
    length = _x.length
    buff.write([length, _x].pack("La#{length}"))
  rescue => exception
    raise "some erro in serialize: #{exception}"

  end
end