Skip to content

Commit

Permalink
Updated Loader
Browse files Browse the repository at this point in the history
  • Loading branch information
a-abir committed Nov 20, 2019
1 parent 605a177 commit 3b724e3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions minilib/Drive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class ArcadeDrive:
def __init__(self, left, right):
def __init__(self, left, right, a=0, b=1):
'''
Setup Arcade drive
Expand All @@ -10,8 +10,10 @@ def __init__(self, left, right):
'''
self.left = left
self.right = right
self.a = a
self.b = b

def calculate(self, fwd, rcw, a=0, b=1):
def calculate(self, fwd, rcw, a, b):
'''
Arcade algorithm to compute left and right wheel commands
from forward and rotate-clockwise joystick commands.
Expand Down Expand Up @@ -58,7 +60,7 @@ def drive(self, forwardPower, steerPower):
:type steerPower: float
'''
self.leftPower, self.rightPower = self.calculate(
forwardPower, steerPower)
forwardPower, steerPower, self.a, self.b)
self.left.throttle(self.leftPower)
self.right.throttle(self.rightPower)

Expand Down Expand Up @@ -87,4 +89,4 @@ def drive(self, leftPower, rightPower):
:type rightPower: float
'''
self.left.throttle(leftPower)
self.right.throttle(rightPower)
self.right.throttle(rightPower)

0 comments on commit 3b724e3

Please sign in to comment.