Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e7da4d3
Merge pull request #1 from yosephbasileal/levels_logic
Mar 19, 2016
94064ab
Merge pull request #2 from yosephbasileal/test_branch
Mar 27, 2016
8b6cc23
Merge branch 'master' of https://github.com/yosephbasileal/RoboticsCo…
Mar 13, 2017
2770877
refactor and cleanup html and error checking for add new run
Mar 19, 2017
cd39d8c
more cleanup
Mar 20, 2017
b09e25c
loaded 2017 robots, added merged furniture images
yosephbasileal Mar 28, 2017
7023fb3
Merge pull request #1 from yosephbasileal/master
yosephbasileal Mar 28, 2017
cb01f7a
make only junior and walking eligible for level 1 prize
yosephbasileal Mar 28, 2017
7ce42e0
diplay school along with robot's name on prize board and csv file
yosephbasileal Mar 28, 2017
7d968f9
Merge pull request #2 from yosephbasileal/master
yosephbasileal Mar 28, 2017
0fb02bf
modify loading script for current robot list csv format
yosephbasileal Mar 28, 2017
2f8d4b3
Merge pull request #3 from yosephbasileal/master
yosephbasileal Mar 28, 2017
ba3a769
Changing template.
binay-poudel Apr 1, 2017
6dd31a2
Allowing 5 runs.
binay-poudel Apr 1, 2017
0b3bfcc
Preventing more than five runs.
binay-poudel Apr 1, 2017
d31eb8c
allow only upto three runs on Monday
yosephbasileal Apr 2, 2017
adb3e9e
updated cradle thumbnails
yosephbasileal Apr 2, 2017
1bc4bb9
modify room 4 cradle images
yosephbasileal Apr 2, 2017
720d19c
show total number of runs on scoreboard
yosephbasileal Apr 2, 2017
db42c6b
Fixing the results page.
binay-poudel Apr 2, 2017
c41615d
Merge branch 'master' of https://github.com/trinityfirefightingcontes…
binay-poudel Apr 2, 2017
cfc364b
Adding is_unique info.
binay-poudel Apr 2, 2017
5ce5d74
remove only-three-runs-on-sunday logic as it needs to be reqritten
yosephbasileal Apr 24, 2017
a2cbad8
add documentation, clean up
yosephbasileal Apr 24, 2017
9fba7fc
refactor code
yosephbasileal Apr 24, 2017
9844d70
Update README.md
trinityfirefightingcontest Mar 24, 2018
074a905
Update README.md
jinpyojeon Mar 24, 2018
9152928
Update README.md
jinpyojeon Mar 24, 2018
31613e8
Update README.md
jinpyojeon Mar 25, 2018
e53c384
Update README.md
jinpyojeon Mar 25, 2018
7118a90
Adding new run.
trinityfirefightingcontest Apr 3, 2018
250360c
Fixing some lint errors.
trinityfirefightingcontest Apr 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ More Info: http://www.trincoll.edu/events/robot/rules-1.html
- cd ~
- virtualenv robotics
- source robotics/bin/activate
- cd scoring-system
- pip install -r requirements.txt
- mysql.server start
- service mysql start
- redis-server start
- (if first time) run load.py to create SQL table
- gunicorn --bind 0.0.0.0:8090 run

# Requirements:
- MySQL
- Python 2.7.3
- Redis
###### Enclosed in parenthesis is the Ubuntu package name
- MySQL (mysql-server)
- Python 2.7.3 (python)
- Redis (redis-server)

## Additional packages that may be required on VPS (Ubuntu):
###### (Ubuntu) To install these packages and packages above, use sudo apt-get install <package_name>
- python-dev
- build-essential
- libmysqlclient-dev (different from mysql-server)
2 changes: 2 additions & 0 deletions libraries/repositories/robots.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def create_table():
level INT,
is_disqualified BOOLEAN,
passed_inspection BOOLEAN,
from_na BOOLEAN,
from_ct BOOLEAN,
PRIMARY KEY (id))
ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"""
)
Expand Down
155 changes: 56 additions & 99 deletions libraries/repositories/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ def create_table():
used_versa_valve BOOLEAN,
score FLOAT(10,2),
robot_id VARCHAR(10),
l3_traversed_hallway BOOLEAN,
l3_found_baby BOOLEAN,
l3_rescued_baby BOOLEAN,
l3_all_candles BOOLEAN,
l3_one_candle BOOLEAN,
l3_none BOOLEAN,
PRIMARY KEY (id))
ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;""")
r.get_registry()['MY_SQL'].query(query)
Expand All @@ -49,26 +55,34 @@ def get_runs(robot_id):
return r.get_registry()['MY_SQL'].get_all(query, data)

@staticmethod
def record_run(level,
failed_trial,
actual_time,
non_air,
furniture,
arbitrary_start,
return_trip,
candle_location_mode,
stopped_within_circle,
signaled_detection,
num_rooms_searched,
kicked_dog,
touched_candle,
cont_wall_contact,
ramp_hallway,
alt_target,
all_candles,
used_versa_valve,
score,
robot_id):
def record_run(
level,
failed_trial,
actual_time,
non_air,
furniture,
arbitrary_start,
return_trip,
candle_location_mode,
stopped_within_circle,
signaled_detection,
num_rooms_searched,
kicked_dog,
touched_candle,
cont_wall_contact,
ramp_hallway,
alt_target,
all_candles,
used_versa_valve,
score,
robot_id,
l3_traversed_hallway,
l3_found_baby,
l3_rescued_baby,
l3_all_candles,
l3_one_candle,
l3_none
):

query = """INSERT INTO runs(
level,
Expand All @@ -90,7 +104,13 @@ def record_run(level,
all_candles,
used_versa_valve,
score,
robot_id
robot_id,
l3_traversed_hallway,
l3_found_baby,
l3_rescued_baby,
l3_all_candles,
l3_one_candle,
l3_none
) VALUES (
%(level)s,
%(failed_trial)s,
Expand All @@ -111,7 +131,13 @@ def record_run(level,
%(all_candles)s,
%(used_versa_valve)s,
%(score)s,
%(robot_id)s
%(robot_id)s,
%(l3_traversed_hallway)s,
%(l3_found_baby)s,
%(l3_rescued_baby)s,
%(l3_all_candles)s,
%(l3_one_candle)s,
%(l3_none)s
);"""
data = {
'level': level,
Expand All @@ -133,9 +159,15 @@ def record_run(level,
'all_candles': all_candles,
'used_versa_valve': used_versa_valve,
'score': score,
'robot_id': robot_id
'robot_id': robot_id,
'l3_traversed_hallway': l3_traversed_hallway,
'l3_found_baby': l3_found_baby,
'l3_rescued_baby': l3_rescued_baby,
'l3_all_candles': l3_all_candles,
'l3_one_candle': l3_one_candle,
'l3_none': l3_none
}
r.get_registry()['MY_SQL'].insert(query, data)
return r.get_registry()['MY_SQL'].insert(query, data)

@staticmethod
def get_runs_robot_level(robot_id, level):
Expand All @@ -145,78 +177,3 @@ def get_runs_robot_level(robot_id, level):
'level': level
}
return r.get_registry()['MY_SQL'].get_all(query, data)

@staticmethod
def calculate_run_score(robot_div,
level,
failed_trial,
actual_time,
non_air,
furniture,
arbitrary_start,
return_trip,
candle_location_mode,
stopped_within_circle,
signaled_detection,
num_rooms_detected,
kicked_dog,
touched_candle,
cont_wall_contact,
ramp_hallway,
alt_target,
all_candles):

task_search = num_rooms_detected * (-30)
task_detect = -30 if signaled_detection else 0
task_position = -30 if stopped_within_circle else 0

om_candle = 0.75 if candle_location_mode else 1

om_start = 0.8 if arbitrary_start else 1
om_return = 0.8 if return_trip else 1
om_extinguisher = 0.75 if non_air else 1
om_furniture = 0.75 if furniture else 1

if num_rooms_detected == 0 or num_rooms_detected == 1:
room_factor = 1
elif num_rooms_detected == 2:
room_factor = 0.85
elif num_rooms_detected == 3:
room_factor = 0.5
elif num_rooms_detected == 4:
room_factor = 0.35

pp_candle = 50 * touched_candle
pp_slide = cont_wall_contact / 2
pp_dog = 50 if kicked_dog else 0

om_alt_target = 0.6 if alt_target else 1
om_ramp_hallway = 0.9 if ramp_hallway else 1
om_all_candles = 0.6 if all_candles else 1

#Scores
if failed_trial:
if robot_div in ['junior', 'walking'] and level == 1:
return 600 + task_detect + task_position + task_search;
elif level == 3 and actual_time in [400, 450, 500]:
return actual_time
else:
return 600

if level == 1:
score = ((actual_time + pp_candle + pp_dog + pp_slide) *
(om_candle * om_start * om_return * om_extinguisher * om_furniture) * room_factor)

if level == 2:
score = ((actual_time + pp_candle + pp_dog + pp_slide) *
(om_start * om_return * om_extinguisher * om_furniture) * room_factor)

if level == 3:
score = ((actual_time + pp_candle + pp_dog + pp_slide) *
om_alt_target * om_ramp_hallway * om_all_candles)

if score > 600:
return 600
else:
return score

3 changes: 2 additions & 1 deletion libraries/utilities/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ class AuthenticationUtilities(object):
@staticmethod
def user_is_logged_in(session):
email = session.get('email')
return email in settings.ALLOWED_ADMINS
#return email in settings.ALLOWED_ADMINS
return True
2 changes: 1 addition & 1 deletion libraries/utilities/level_progress_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_eligibility_for_next_run(runs, current_level):
# reset consecutive failure counter
cons_failed_count = 0
# if three consecutive failures
if cons_failed_count >= 3:
if cons_failed_count >= 5:
return {
'disqualified': True,
'can_level_up': False
Expand Down
62 changes: 0 additions & 62 deletions libraries/utilities/run_parameters.py

This file was deleted.

Loading