Just the sight of you makes my vision system go haywire.
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 12-02-2017, 12:27
AlexNeedsAName's Avatar
AlexNeedsAName AlexNeedsAName is offline
Registered User
AKA: Alexander
FRC #3641 (The Flying Toasters)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2015
Location: South Lyon, MI
Posts: 13
AlexNeedsAName is an unknown quantity at this point
TIL There's a builtin function for getting the alliance station from FMS

I found a function in the wpilib that tells you what alliance you're on!

Code:
import edu.wpi.first.wpilibj.hal.AllianceStationID;
import edu.wpi.first.wpilibj.hal.HAL;

AllianceStationID AlianceStation = HAL.getAllianceStation();
boolean redAlliance = false;
if(AlianceStation == AllianceStationID.Red1 || AlianceStation == AllianceStationID.Red2 || AlianceStation == AllianceStationID.Red3) redAlliance = true;
I figured this could be useful for some teams in auton since the field isn't symmetrical. I wish they would have made it more accessible, since FIRST doesn't even consider the HAL to be user facing.
Reply With Quote
 


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 15:53.

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