Class: RapiroWrapper::Waist
- Inherits:
-
ServoMotor
- Object
- ServoMotor
- RapiroWrapper::Waist
- Defined in:
- lib/rapiro_wrapper/servo_motor/waist.rb
Overview
Waist class for RAPIRO
Constant Summary collapse
- NO =
1
- DEFAULT =
90
- MIN =
0
- MAX =
180
Instance Method Summary collapse
-
#initialize(left: nil, right: nil) ⇒ Waist
constructor
A new instance of Waist.
Methods inherited from ServoMotor
Constructor Details
#initialize(left: nil, right: nil) ⇒ Waist
Returns a new instance of Waist.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rapiro_wrapper/servo_motor/waist.rb', line 9 def initialize(left: nil, right: nil) fail ArgumentError if left && right if left @value = DEFAULT + left elsif right @value = DEFAULT - right else @value = DEFAULT end fail ArgumentError unless @value.between?(MIN, MAX) end |