Go to Post Defense shall reign supreme. - Corey Balint [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 19-01-2014, 22:38
ggorsuch ggorsuch is offline
Registered User
FRC #2471 (Team Mean Machine)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Camas, WA
Posts: 21
ggorsuch is an unknown quantity at this point
Keeping Track of Assists

Hello everyone,
I am currently working on a web app to mimic the alliance station possession and assist monitor for practice. I am having trouble thinking of a way to keep track of assists. As I have it now, most scenarios shown in this video work as they should, however some don't.
This is my current method for keeping track:


Code:
            if(robotNum == 'robot1' && zone == 'red' && !redZone && !rOneAssist) {
                $('#' + robotNum).children('.' + zone).addClass('assist');
                redZone = true;
                rOneAssist = true;
            }
            else if(robotNum == 'robot1' && zone == 'white' && !whiteZone && !rOneAssist) {
                $('#' + robotNum).children('.' + zone).addClass('assist');
                whiteZone = true;
                rOneAssist = true;
            }
            else if(robotNum == 'robot1' && zone == 'blue' && !blueZone && !rOneAssist) {
                $('#' + robotNum).children('.' + zone).addClass('assist');
                blueZone = true;
                rOneAssist = true;
            }
            else if(robotNum == 'robot2' && zone == 'blue' && !blueZone && !rTwoAssist) {
                $('#' + robotNum).children('.' + zone).addClass('assist');
                blueZone = true;
                rTwoAssist = true;
            }
            else if(robotNum == 'robot2' && zone == 'white' && !whiteZone && !rTwoAssist) {
                $('#' + robotNum).children('.' + zone).addClass('assist');
                whiteZone = true;
                rTwoAssist = true;
            }
            else if(robotNum == 'robot2' && zone == 'red' && !redZone && !rTwoAssist) {
                $('#' + robotNum).children('.' + zone).addClass('assist');
                redZone = true;
                rTwoAssist = true;
            }
            else if(robotNum == 'robot3' && zone == 'blue' && !blueZone && !rThreeAssist) {
                $('#' + robotNum).children('.' + zone).addClass('assist');
                blueZone = true;
                rThreeAssist = true;
            }
            else if(robotNum == 'robot3' && zone == 'white' && !whiteZone && !rThreeAssist) {
                $('#' + robotNum).children('.' + zone).addClass('assist');
                whiteZone = true;
                rThreeAssist = true;
            }
            else if(robotNum == 'robot3' && zone == 'red' && !redZone && !rThreeAssist) {
                $('#' + robotNum).children('.' + zone).addClass('assist');
                redZone = true;
                rThreeAssist = true;
            }
Basically, the way it works is whenever the possession of the ball changes, it checks if that zone has already had an assist, and if that robot has had an assist. The problem comes from the example at 3:10 of the video, when the awarded possession changes robots. Does anybody have a better formula for doing this?
Assists are a very confusing part of the game, which is one of the reasons why this is difficult for me to wrap my head around.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:16.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi