Class: Sphero::Response::CollisionDetected
Constant Summary
AsyncResponse::COLLISION_DETECTED, AsyncResponse::CONFIG_BLOCK, AsyncResponse::DLEN_LSB, AsyncResponse::DLEN_MSB, AsyncResponse::ID_CODE, AsyncResponse::LEVEL_1_DIAGNOSTIC, AsyncResponse::MACRO_MARKERS, AsyncResponse::POWER_NOTIFICATION, AsyncResponse::PRESLEEP_WARNING, AsyncResponse::SENSOR_DATA, AsyncResponse::VALID_REPONSES
ASYNC_RESPONSE, CODE_OK, DLEN, MRSP, SEQ, SIMPLE_RESPONSE, SOP1, SOP2
Instance Method Summary
collapse
constantize, #empty?, response, #seq, #success?, valid?
async?, #empty?, #initialize, #seq, simple?, #success?, #valid?
Instance Method Details
#axis ⇒ Object
182
183
184
|
# File 'lib/sphero/response.rb', line 182
def axis
body[3]
end
|
#body ⇒ Object
166
167
168
|
# File 'lib/sphero/response.rb', line 166
def body
@body.unpack 'nnnCnnCN'
end
|
#speed ⇒ Object
194
195
196
|
# File 'lib/sphero/response.rb', line 194
def speed
body[6]
end
|
#timestamp ⇒ Object
198
199
200
|
# File 'lib/sphero/response.rb', line 198
def timestamp
body[7]
end
|
#x ⇒ Object
170
171
172
|
# File 'lib/sphero/response.rb', line 170
def x
body[0]
end
|
#x_magnitude ⇒ Object
186
187
188
|
# File 'lib/sphero/response.rb', line 186
def x_magnitude
body[4]
end
|
#y ⇒ Object
174
175
176
|
# File 'lib/sphero/response.rb', line 174
def y
body[1]
end
|
#y_magnitude ⇒ Object
190
191
192
|
# File 'lib/sphero/response.rb', line 190
def y_magnitude
body[5]
end
|
#z ⇒ Object
178
179
180
|
# File 'lib/sphero/response.rb', line 178
def z
body[2]
end
|