Class: Nav_msgs::GetPlanResponse

Inherits:
ROS::Message
  • Object
show all
Defined in:
lib/nav_msgs/GetPlan.rb

Constant Summary collapse

@@struct_d4 =
::ROS::Struct.new("d4")
@@struct_L3 =
::ROS::Struct.new("L3")
@@struct_L2 =
::ROS::Struct.new("L2")
@@struct_d3 =
::ROS::Struct.new("d3")
@@struct_L =
::ROS::Struct.new("L")
@@slot_types =
['nav_msgs/Path']

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ GetPlanResponse

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

Parameters:

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

    keyword for initializing values

Options Hash (args):

  • :plan (nav_msgs/Path)

    initialize value



282
283
284
285
286
287
288
289
# File 'lib/nav_msgs/GetPlan.rb', line 282

def initialize(args={})
  # message fields cannot be None, assign default values for those that are
  if args[:plan]
    @plan = args[:plan]
  else
    @plan = Nav_msgs::Path.new
  end
end

Instance Attribute Details

#planObject

Returns the value of attribute plan.



268
269
270
# File 'lib/nav_msgs/GetPlan.rb', line 268

def plan
  @plan
end

Class Method Details

.md5sumObject



198
199
200
# File 'lib/nav_msgs/GetPlan.rb', line 198

def self.md5sum
  "0002bc113c0259d71f6cf8cbc9430e18"
end

.typeObject



202
203
204
# File 'lib/nav_msgs/GetPlan.rb', line 202

def self.type
  "nav_msgs/GetPlanResponse"
end

Instance Method Details

#_get_typesString

internal API method

Returns:

  • (String)

    Message type string.



293
294
295
# File 'lib/nav_msgs/GetPlan.rb', line 293

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


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
359
360
361
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
# File 'lib/nav_msgs/GetPlan.rb', line 332

def deserialize(str)

  begin
    if @plan == nil
      @plan = Nav_msgs::Path.new
    end
    end_point = 0
    start = end_point
    end_point += ROS::Struct::calc_size('L3')
    (@plan.header.seq, @plan.header.stamp.secs, @plan.header.stamp.nsecs,) = @@struct_L3.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
    @plan.header.frame_id = str[start..(end_point-1)]
    start = end_point
    end_point += 4
    (length,) = @@struct_L.unpack(str[start..(end_point-1)])
    @plan.poses = []
    length.times do
      val1 = Geometry_msgs::PoseStamped.new
      _v22 = val1.header
      start = end_point
      end_point += ROS::Struct::calc_size('L')
      (_v22.seq,) = @@struct_L.unpack(str[start..(end_point-1)])
      _v23 = _v22.stamp
      _x = _v23
      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
      _v22.frame_id = str[start..(end_point-1)]
      _v24 = val1.pose
      _v25 = _v24.position
      _x = _v25
      start = end_point
      end_point += ROS::Struct::calc_size('d3')
      (_x.x, _x.y, _x.z,) = @@struct_d3.unpack(str[start..(end_point-1)])
      _v26 = _v24.orientation
      _x = _v26
      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)])
      @plan.poses.push(val1)
    end
    return self
  rescue => exception
    raise "message DeserializationError: #{exception}" #most likely buffer underfill
  end
end

#has_header?Boolean

Returns:

  • (Boolean)


206
207
208
# File 'lib/nav_msgs/GetPlan.rb', line 206

def has_header?
  false
end

#message_definitionObject



210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
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
# File 'lib/nav_msgs/GetPlan.rb', line 210

def message_definition
  "nav_msgs/Path plan


================================================================================
MSG: nav_msgs/Path
#An array of poses that represents a Path for a robot to follow
Header header
geometry_msgs/PoseStamped[] poses

================================================================================
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/PoseStamped
# A Pose with reference coordinate frame and timestamp
Header header
Pose pose

================================================================================
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/Quaternion
# This represents an orientation in free space in quaternion form.

float64 x
float64 y
float64 z
float64 w

"
end

#serialize(buff) ⇒ Object

serialize message into buffer

Parameters:

  • buff (IO)

    buffer



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
# File 'lib/nav_msgs/GetPlan.rb', line 299

def serialize(buff)
  begin
    buff.write(@@struct_L3.pack(@plan.header.seq, @plan.header.stamp.secs, @plan.header.stamp.nsecs))
    _x = @plan.header.frame_id
    length = _x.length
    buff.write([length, _x].pack("La#{length}"))
    length = @plan.poses.length
    buff.write(@@struct_L.pack(length))
    for val1 in @plan.poses
      _v17 = val1.header
      buff.write(@@struct_L.pack(_v17.seq))
      _v18 = _v17.stamp
      _x = _v18
      buff.write(@@struct_L2.pack(_x.secs, _x.nsecs))
      _x = _v17.frame_id
      length = _x.length
      buff.write([length, _x].pack("La#{length}"))
      _v19 = val1.pose
      _v20 = _v19.position
      _x = _v20
      buff.write(@@struct_d3.pack(_x.x, _x.y, _x.z))
      _v21 = _v19.orientation
      _x = _v21
      buff.write(@@struct_d4.pack(_x.x, _x.y, _x.z, _x.w))
    end
  rescue => exception
    raise "some erro in serialize: #{exception}"

  end
end