Log in

View Full Version : Does any code run while the laptop is connected to the field,but the bot is disabled?


jtrv
04-03-2015, 15:05
Hi guys,

I'm wondering if there is any code that runs while your laptop is connected to the field via ethernet but the robot is disabled. Currently using IterativeBot in Java if there's a method we can override that I'm missing.

Thinking about calibrating some wonky gyro on the field because if we do it in the pits it'll get all wonky and it's too hard to explain the gyro situation here and the gyro is bagged anyway.

We'd have a limit-switch type object that we press on the bot itself and it will calibrate, turning on a certain LED while it is calibrating, and turning off when done.

Anybody know? Thanks a bunch ^^

MrRoboSteve
04-03-2015, 15:18
overriding disabledInit() or disabledPeriodic() sounds like a match.

jtrv
04-03-2015, 16:15
That's what I thought too, but I honestly wasn't sure if FIRST had a safety system where literally no code will run while your laptop is connected to the field. So i don't know. There's not much of a way to test it until we get there, either, unfortunately.

alopex_rex
04-03-2015, 16:18
To the best of my knowledge, anything that could run an actuator (so all PWM, digital output, etc) cannot be used when the robot is disabled, but your code still runs. I know because our (C++) program prints to the smart dashboard in DisabledPeriodic().

adamm
04-03-2015, 16:27
To the best of my knowledge, anything that could run an actuator (so all PWM, digital output, etc) cannot be used when the robot is disabled, but your code still runs. I know because our (C++) program prints to the smart dashboard in DisabledPeriodic().

Yes, all output controls are disabled when the robot is disabled (safety feature), however, you can still initialize sensors (calibrate gyros, etc), load values from preferences, etc.

jtrv
04-03-2015, 16:46
Our gyro is a digital gyro that plugs into the SPI port. Will code be able to access that? We initialize it at SPI.Port.kOnboardCS1 ... Yes, we had to write our own driver in Java... it sucked, but it works (kinda).

adamm
04-03-2015, 16:53
Our gyro is a digital gyro that plugs into the SPI port. Will code be able to access that? We initialize it at SPI.Port.kOnboardCS1 ... Yes, we had to write our own driver in Java... it sucked, but it works (kinda).

Yes, Anything that works now will work the same on the field. (Well, its intended to, sometime the field likes to do other things though). Read more about how the field controls your robot here: https://wpilib.screenstepslive.com/s/4485/m/24193/l/291972-fms-whitepaper

jtrv
04-03-2015, 21:12
Yes, Anything that works now will work the same on the field. (Well, its intended to, sometime the field likes to do other things though). Read more about how the field controls your robot here: https://wpilib.screenstepslive.com/s/4485/m/24193/l/291972-fms-whitepaper

This is great. So that means disabledPeriodic() runs before the match starts?

adamm
05-03-2015, 14:44
This is great. So that means disabledPeriodic() runs before the match starts?

It should, yes.

cgmv123
05-03-2015, 15:25
This is great. So that means disabledPeriodic() runs before the match starts?

It should, yes.

The code will run, but note that you can't activate any motors or solenoids while the robot is disabled for what I hope are obvious reasons.