Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Does any code run while the laptop is connected to the field,but the bot is disabled? (http://www.chiefdelphi.com/forums/showthread.php?t=135465)

jtrv 04-03-2015 15:05

Does any code run while the laptop is connected to the field,but the bot is disabled?
 
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

Re: Does any code run while the laptop is connected to the field,but the bot is disab
 
overriding disabledInit() or disabledPeriodic() sounds like a match.

jtrv 04-03-2015 16:15

Re: Does any code run while the laptop is connected to the field,but the bot is disab
 
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

Re: Does any code run while the laptop is connected to the field,but the bot is disab
 
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

Re: Does any code run while the laptop is connected to the field,but the bot is disab
 
Quote:

Originally Posted by alopex_rex (Post 1453552)
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

Re: Does any code run while the laptop is connected to the field,but the bot is disab
 
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

Re: Does any code run while the laptop is connected to the field,but the bot is disab
 
Quote:

Originally Posted by jtrv (Post 1453573)
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...fms-whitepaper

jtrv 04-03-2015 21:12

Re: Does any code run while the laptop is connected to the field,but the bot is disab
 
Quote:

Originally Posted by adamm (Post 1453577)
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...fms-whitepaper

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

adamm 05-03-2015 14:44

Re: Does any code run while the laptop is connected to the field,but the bot is disab
 
Quote:

Originally Posted by jtrv (Post 1453714)
This is great. So that means disabledPeriodic() runs before the match starts?

It should, yes.

cgmv123 05-03-2015 15:25

Re: Does any code run while the laptop is connected to the field,but the bot is disab
 
Quote:

Originally Posted by jtrv (Post 1453714)
This is great. So that means disabledPeriodic() runs before the match starts?

Quote:

Originally Posted by adamm (Post 1454053)
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.


All times are GMT -5. The time now is 01:39.

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