![]() |
Running networking code while robot is disabled
I'd like to run some NetworkTables code while the robot is disabled. No running motors or anything(and I'm pretty sure the FPGA will stop me from doing that), just code that updates variables even when the robot is stopped. Is this legal? Can I just run a loop inside Disabled()?
|
Re: Running networking code while robot is disabled
Don't put a loop in Disabled() because when the robot is disabled that function loops on its own.
Having code run in Disabled(), such as variable updates and prints, is fine. However, putting code that could potentially move or control the robot would defeat the purpose of having a Disabled() function. This is usually what my Disabled() function looks like: Code:
void Robot::Disabled() |
Re: Running networking code while robot is disabled
Quote:
|
Re: Running networking code while robot is disabled
Disabledinit would print once.
Disabledperiodic would print over and over again. |
Re: Running networking code while robot is disabled
I use SampleRobot.
|
Re: Running networking code while robot is disabled
Sorry, I should have been specific. The periodic one loops. In SampleRobot it does not.
If you want to loop in Disabled() you could try: Code:
Robot::Disabled()Edit: When I said that it loops earlier I was thinking of when print statements from OperatorControl continue printing if you're missing the "IsOperatorControl()" function in your while condition. |
Re: Running networking code while robot is disabled
Quote:
|
Re: Running networking code while robot is disabled
No reason in particular. I just wouldn't want to mess with it, I'm not familiar with how the field management system handles the disabled modes.
It would probably be fine, but is there a reason to do it? Once the robot disables at the end of a match it's not like it's going to be powered on much longer. |
Re: Running networking code while robot is disabled
Quote:
|
Re: Running networking code while robot is disabled
Quote:
I would just be terrified because if there was an error with the disabled loop you could brick the match! (Paranoia, after having bricked matches in the past.) |
Re: Running networking code while robot is disabled
Quote:
|
Re: Running networking code while robot is disabled
I wasn't on the drive team the year it happened, but I think there was an issue with our loop statements for teleop/auto. Basically autonomous mode worked and then teleop never began for our robot.
That happened for two matches and we worked the magic of deploying different, but still final, code and it started working. I think the FMS does its best to force your robot to change modes, but sometimes it can't if you did something bad enough? I honestly don't know xD |
Re: Running networking code while robot is disabled
Quote:
|
| All times are GMT -5. The time now is 10:17 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi