Skip to content

Commit

Permalink
Minor fixes to rudder turning logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jamestaylr committed May 28, 2015
1 parent ca33f61 commit 5b5c41f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/autonomous.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def check_locations(self):

def turn_rudder(self):
# Heading differential
a = values['current_desired_heading'] - data['heading']
a = ((values['current_desired_heading'] - data['heading']) + 360) % 360
if (a > 180):
a -= 360

Expand All @@ -262,7 +262,7 @@ def turn_rudder(self):
if (a < (-1 * values['max_turn_rate_angle'])):
a = -1 * values['max_turn_rate_angle']

values['rudder_angle'] = 90 + a * (values['max_rudder_angle'] / values['max_turn_rate_angle'])
values['rudder_angle'] = a * (values['max_rudder_angle'] / values['max_turn_rate_angle'])

logging.debug('Set the rudder angle to: %f' % values['rudder_angle'])
self._kwargs['data_thread'].set_rudder_angle(values['rudder_angle'])
Expand Down

0 comments on commit 5b5c41f

Please sign in to comment.