Class: Sensor_msgs::SetCameraInfoResponse

Inherits:
ROS::Message
  • Object
show all
Defined in:
lib/sensor_msgs/SetCameraInfo.rb

Constant Summary collapse

@@struct_C =
::ROS::Struct.new("C")
@@struct_L =
::ROS::Struct.new("L")
@@slot_types =
['bool','string']

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ SetCameraInfoResponse

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

Parameters:

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

    keyword for initializing values

Options Hash (args):

  • :success (bool)

    initialize value

  • :status_message (string)

    initialize value



358
359
360
361
362
363
364
365
366
367
368
369
370
# File 'lib/sensor_msgs/SetCameraInfo.rb', line 358

def initialize(args={})
  # message fields cannot be None, assign default values for those that are
  if args[:success]
    @success = args[:success]
  else
    @success = false
  end
  if args[:status_message]
    @status_message = args[:status_message]
  else
    @status_message = ''
  end
end

Instance Attribute Details

#status_messageObject

Returns the value of attribute status_message.



346
347
348
# File 'lib/sensor_msgs/SetCameraInfo.rb', line 346

def status_message
  @status_message
end

#successObject

Returns the value of attribute success.



346
347
348
# File 'lib/sensor_msgs/SetCameraInfo.rb', line 346

def success
  @success
end

Class Method Details

.md5sumObject



327
328
329
# File 'lib/sensor_msgs/SetCameraInfo.rb', line 327

def self.md5sum
  "2ec6f3eff0161f4257b808b12bc830c2"
end

.typeObject



331
332
333
# File 'lib/sensor_msgs/SetCameraInfo.rb', line 331

def self.type
  "sensor_msgs/SetCameraInfoResponse"
end

Instance Method Details

#_get_typesString

internal API method

Returns:

  • (String)

    Message type string.



374
375
376
# File 'lib/sensor_msgs/SetCameraInfo.rb', line 374

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


394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/sensor_msgs/SetCameraInfo.rb', line 394

def deserialize(str)

  begin
    end_point = 0
    start = end_point
    end_point += ROS::Struct::calc_size('C')
    (@success,) = @@struct_C.unpack(str[start..(end_point-1)])
    @success = bool(@success)
    start = end_point
    end_point += 4
    (length,) = @@struct_L.unpack(str[start..(end_point-1)])
    start = end_point
    end_point += length
    @status_message = str[start..(end_point-1)]
    return self
  rescue => exception
    raise "message DeserializationError: #{exception}" #most likely buffer underfill
  end
end

#has_header?Boolean

Returns:

  • (Boolean)


335
336
337
# File 'lib/sensor_msgs/SetCameraInfo.rb', line 335

def has_header?
  false
end

#message_definitionObject



339
340
341
342
343
344
345
# File 'lib/sensor_msgs/SetCameraInfo.rb', line 339

def message_definition
  "bool success
string status_message


"
end

#serialize(buff) ⇒ Object

serialize message into buffer

Parameters:

  • buff (IO)

    buffer



380
381
382
383
384
385
386
387
388
389
390
# File 'lib/sensor_msgs/SetCameraInfo.rb', line 380

def serialize(buff)
  begin
    buff.write(@@struct_C.pack(@success))
    _x = @status_message
    length = _x.length
    buff.write([length, _x].pack("La#{length}"))
  rescue => exception
    raise "some erro in serialize: #{exception}"

  end
end