Class: RapiroWrapper::LeftFootYaw

Inherits:
ServoMotor show all
Defined in:
lib/rapiro_wrapper/servo_motor/left_foot_yaw.rb

Overview

LeftFootYaw class for RAPIRO

Constant Summary collapse

NO =
10
DEFAULT =
90
MIN =
50
MAX =
110

Instance Method Summary collapse

Methods inherited from ServoMotor

code, find_servos, #to_code

Constructor Details

#initialize(close: nil, open: nil) ⇒ LeftFootYaw

Returns a new instance of LeftFootYaw.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rapiro_wrapper/servo_motor/left_foot_yaw.rb', line 9

def initialize(close: nil, open: nil)
  fail ArgumentError if open && close
  if close
    @value = MAX - close
  elsif open
    @value = MIN + open
  else
    @value = DEFAULT
  end
  fail ArgumentError unless @value.between?(MIN, MAX)
end