class Rubots::Command::Throttle

Public Class Methods

new(throttle) click to toggle source
# File lib/rubots/command/throttle.rb, line 4
def initialize(throttle)
  @throttle = throttle
  @throttle = 0 if @throttle < 0
  @throttle = Robot::MAX_THROTTLE if @throttle > Robot::MAX_THROTTLE
end

Public Instance Methods

apply_to(robot) click to toggle source
# File lib/rubots/command/throttle.rb, line 10
def apply_to(robot)
  robot.desired_throttle = @throttle
end
cooldown() click to toggle source
# File lib/rubots/command/throttle.rb, line 14
def cooldown
  5
end