Skip to content

Commit

Permalink
Added configuration option for station keeping timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
jamestaylr committed May 29, 2015
1 parent 77f20d2 commit 04f961d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/autonomous.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def station_keeping(self):

logging.debug("Station keeping elapsed time: %s" % time_elapsed)

# If the correct amount of time has elapsed, switch targets
if time_elapsed > 30:
# If the correct amount of time has elapsed (converting minutes to seconds), switch targets
if time_elapsed > (values['station_keeping_timeout'] * 60):
for i in range(len(target_locations)):
target_locations[i] = Location(0, 0)
logging.warn("Switched targets!")
Expand Down
6 changes: 4 additions & 2 deletions src/config.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
[DEFAULT]
debug: True
# when changing the port name, make sure to also change the port in the client
# When changing the port name, make sure to also change the port in the client
port: 80
transmission_delay: 1
eval_delay: 1
# possible event configurations: default, station_keeping
# Possible event configurations: default, station_keeping
event: default
# Timeout delay for the station keeping event
station_keeping_timeout: 5

[LOGIC]
point_proximity_radius: 5
Expand Down
2 changes: 2 additions & 0 deletions src/modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def setup_config(values):
values['max_rudder_angle'] = float(config.get('LOGIC', 'max_rudder_angle'))
values['max_turn_rate_angle'] = float(config.get('LOGIC', 'max_turn_rate_angle'))

values['station_keeping_timeout'] = float(config.get('DEFAULT', 'station_keeping_timeout'))

modules.calc.point_proximity_radius = float(config.get('LOGIC', 'point_proximity_radius'))

print('Configuration file successfully loaded.')
Expand Down

0 comments on commit 04f961d

Please sign in to comment.