Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Detecting If We're Competing (http://www.chiefdelphi.com/forums/showthread.php?t=125223)

faulknna 25-01-2014 14:44

Detecting If We're Competing
 
Does anyone know of a way to detect if we're at competition? I'm trying to implement a battery-saving mechanism on the driver station that will beep at you (kind of like an alarm clock) after 3 seconds of being below 11 volts, and will disable the robot after 13 seconds; however, I need to make sure the robot doesn't get shut down in the middle of a match. While a simple solution might be to have a control on the dash board, I'd rather have something that can't be so easily flipped.

Joe Ross 25-01-2014 15:13

Re: Detecting If We're Competing
 
Java and C++ have a method in the DriverStation class called isFMSAttached.

You may want to experiment with your thresholds once you have the robot built.

JohnGilb 25-01-2014 15:38

Re: Detecting If We're Competing
 
One small addendum - I would be very, very careful with any code that disables your robot. A bug, misconfiguration, or regression in that could could have the undesirable side effect of disabling your robot at competition.

Greg McKaskle 26-01-2014 08:52

Re: Detecting If We're Competing
 
I wasn't sure what language. It doesn't look like LV exposes that in a palette VI, but it is easy to get from one of the lower level VIs not in the palette.

But before doing this, does the robot use that much more power when enabled than when disabled? Is it the compressor? Because it may be simpler to have a toggle for energy saving that is more explicit. Binding this to being on a field could happen later, but it will in fact be hard to test before you are at an event.

Greg McKaskle

magnets 26-01-2014 09:38

Re: Detecting If We're Competing
 
IIRC, isFMSAttached didn't work last year.

yash101 27-01-2014 00:09

Re: Detecting If We're Competing
 
Just have a checkbox, with it's value saved. That way, whenever you go to comps, you just need to press the comp checkbutton once and you're set. It's not too hard either!

EricH 27-01-2014 00:28

Re: Detecting If We're Competing
 
Quote:

Originally Posted by yash101 (Post 1332987)
Just have a checkbox, with it's value saved. That way, whenever you go to comps, you just need to press the comp checkbutton once and you're set. It's not too hard either!

What about the practice field?

sircedric4 27-01-2014 11:01

Re: Detecting If We're Competing
 
TL;DR: Set a flag in your autonomous routine, only triggered when you are playing a real game or during "practice" on driver station.


We are going to be doing something different on the real field then at our pits with one of presets on the robot we are building and I had a similar problem.

I will tell you how I plan to only allow a preset when we are in the pits versus during the actual game and you can see if it applies for you.

Basically, we use IterativeRobot in Java and C++ and we are setting a flag during the autonomous portion. While that flag is tripped, then we are in a real game and as such I do not want to return to our start position of the robot. When it is not tripped, that means we just flipped the driver station to teleop and are playing around in the pit and I will allow the robot to be returned to start position automatically then.

chris.boyle 27-01-2014 11:16

Re: Detecting If We're Competing
 
1 Attachment(s)
I have asked this question in the past and the answers I received are in the following thread. http://www.chiefdelphi.com/forums/sh...d.php?t=114614

Also, I've attached a photo of how we are using the information.

JesseK 27-01-2014 11:48

Re: Detecting If We're Competing
 
We have a similar situation where we want to automatically up the data rate of telemetry data from the robot to the driver's station when not on a competition field. If the cRIO can keep up, we're talking roughly 2Mbits on top of video & normal FMS traffic, so we really want to scale it back on the field.

Can anyone confirm that the FMS Attachment bit still works? Does it detect the actual FMS & FMS Lite?

magnets 27-01-2014 17:27

Re: Detecting If We're Competing
 
After looking at our code from last year, the FMS method did not work during the match we tried it at.

bs7280 27-01-2014 19:39

Re: Detecting If We're Competing
 
Make it so that no matter what the battery level is, the power can not be cut until at least 2 and a half minutes have passed (I would do three just to be safe), then once 2.5 minutes have passed, the program can cut off power after 11 volts

matthewdenny 27-01-2014 20:33

The solutions proposed so far are elegant and seem effective. However I suggest 1 more possible option. You could have a simple switch wired to a digital input. The default position (as well as the switch unplugged position) would be competition settings and the other option could be for testing.

Greg McKaskle 28-01-2014 07:40

Re: Detecting If We're Competing
 
I believe that the bit in the protocol is set, but I can't really verify that the bit makes it to the control byte unmodified. Anytime the FMS Present message and blue strip shows on the DS, that will trigger the FMS bit. So this should work with FMS lite.

Greg McKaskle


All times are GMT -5. The time now is 02:31.

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