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