Class: Pr2_controllers_msgs::QueryCalibrationStateResponse

Inherits:
ROS::Message
  • Object
show all
Defined in:
lib/pr2_controllers_msgs/QueryCalibrationState.rb

Constant Summary collapse

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ QueryCalibrationStateResponse

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

Parameters:

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

    keyword for initializing values

Options Hash (args):

  • :is_calibrated (bool)

    initialize value



101
102
103
104
105
106
107
108
# File 'lib/pr2_controllers_msgs/QueryCalibrationState.rb', line 101

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

Instance Attribute Details

#is_calibratedObject

Returns the value of attribute is_calibrated.



90
91
92
# File 'lib/pr2_controllers_msgs/QueryCalibrationState.rb', line 90

def is_calibrated
  @is_calibrated
end

Class Method Details

.md5sumObject



73
74
75
# File 'lib/pr2_controllers_msgs/QueryCalibrationState.rb', line 73

def self.md5sum
  "28af3beedcb84986b8e470dc5470507d"
end

.typeObject



77
78
79
# File 'lib/pr2_controllers_msgs/QueryCalibrationState.rb', line 77

def self.type
  "pr2_controllers_msgs/QueryCalibrationStateResponse"
end

Instance Method Details

#_get_typesString

internal API method

Returns:

  • (String)

    Message type string.



112
113
114
# File 'lib/pr2_controllers_msgs/QueryCalibrationState.rb', line 112

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


129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/pr2_controllers_msgs/QueryCalibrationState.rb', line 129

def deserialize(str)

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

#has_header?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/pr2_controllers_msgs/QueryCalibrationState.rb', line 81

def has_header?
  false
end

#message_definitionObject



85
86
87
88
89
# File 'lib/pr2_controllers_msgs/QueryCalibrationState.rb', line 85

def message_definition
  "bool is_calibrated

"
end

#serialize(buff) ⇒ Object

serialize message into buffer

Parameters:

  • buff (IO)

    buffer



118
119
120
121
122
123
124
125
# File 'lib/pr2_controllers_msgs/QueryCalibrationState.rb', line 118

def serialize(buff)
  begin
    buff.write(@@struct_C.pack(@is_calibrated))
  rescue => exception
    raise "some erro in serialize: #{exception}"

  end
end