Go to Post wow Paul and Rich in a photograph, i thought that if that much nerd got together that a black hole would form - Mike Schroeder [more]
Home
Go Back   Chief Delphi > Technical > Control System
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-03-2016, 21:21
Auri's Avatar
Auri Auri is offline
Llama Overlord
AKA: Doug Guzman
FRC #2081 (Icarus)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Peoria IL
Posts: 3
Auri is an unknown quantity at this point
Randomly Dropping out of Teleop

We have been having issues where in the middle of a match, with no other problems, the robot suddenly drops out of teleop mode, while the driver station stays in teleop. After that, for the remainder of the match, the robot would periodically go back into teleop for a single software loop exactly once every 5 seconds, but then immediately drop out again, putting us out of the match. Neither the initial nor subsequent drops occur in conjunction with physical shocks or impacts. Neither the field management system nor the driver station indicated any connection issues. Similarly, the log file for the match shows minimal packet loss and no brownout issues. The occasional battery voltage drops during the problem are the result of the robot moving on the field when a command happened to get through during one of the single-loop teleop reconnects.

This issue occurred twice during our last regional, on different days, with seemingly no connection between them. We have another regional this coming weekend and are obviously eager to resolve this before it. We have only observed this during matches, not during practice. The driver station log files and our code are attached here. Sorry for code quality, this is our first year using C++ to code the robot.

Anyone know what is happening here and how to fix it?
Attached Files
File Type: zip DS Logs Sat.zip (65.4 KB, 10 views)
File Type: zip src.zip (9.7 KB, 11 views)
File Type: zip DS Logs Fri.zip (49.3 KB, 4 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 15-03-2016, 09:42
mdballard's Avatar
mdballard mdballard is offline
SW and Control Systems Mentor
AKA: Matthew Ballard
FRC #4329 (Lutheran Roboteers)
Team Role: Mentor
 
Join Date: Aug 2014
Rookie Year: 2014
Location: Missouri
Posts: 6
mdballard is an unknown quantity at this point
Re: Randomly Dropping out of Teleop

By any chance did you retrieve the log file off the roboRIO? The file is: /user/lvuser/FRCUserProgram.log. It might have some additional diagnostic information that could be very useful for you to track down what is happening. It will also capture printf output from your code. I will look at your code when I get home tonight and see if I can find anything to recommend.

Good luck this weekend,
Matt
Reply With Quote
  #3   Spotlight this post!  
Unread 15-03-2016, 11:06
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 298
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Randomly Dropping out of Teleop

I see this in your logs

Code:
IMAQdxGrab error: -1074360293
Could that be causing your problem?
Reply With Quote
  #4   Spotlight this post!  
Unread 15-03-2016, 20:09
Auri's Avatar
Auri Auri is offline
Llama Overlord
AKA: Doug Guzman
FRC #2081 (Icarus)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Peoria IL
Posts: 3
Auri is an unknown quantity at this point
Re: Randomly Dropping out of Teleop

Quote:
Originally Posted by mdballard View Post
By any chance did you retrieve the log file off the roboRIO? The file is: /user/lvuser/FRCUserProgram.log. It might have some additional diagnostic information that could be very useful for you to track down what is happening. It will also capture printf output from your code. I will look at your code when I get home tonight and see if I can find anything to recommend.

Good luck this weekend,
Matt
Thanks for the help, we will look into that file at competition, as we do not currently have access to the robot .
Reply With Quote
  #5   Spotlight this post!  
Unread 16-03-2016, 01:52
mdballard's Avatar
mdballard mdballard is offline
SW and Control Systems Mentor
AKA: Matthew Ballard
FRC #4329 (Lutheran Roboteers)
Team Role: Mentor
 
Join Date: Aug 2014
Rookie Year: 2014
Location: Missouri
Posts: 6
mdballard is an unknown quantity at this point
Re: Randomly Dropping out of Teleop

Looking at the events in your driverstation logs, the IMAQdxGrab error, mentioned in the post by euhlmann, is worth consideration. Error -1074360293 is a timeout error.

That timeout error is then followed by timeout errors from your robotdrive. Timeout errors on the robotdrive would be observed as the drive not receiving driver commanding (ie robot appears dead). The periodicity of the IMAQdxGrab errors is approximately the 5 seconds you state in your original post. Since this is occurring in the middle of the match, that might indicate that the camera may have become disconnected electrically at the point the errors start being observed. Hard to tell from just the logs. I know that the team I mentor with (4329) has spent quite a bit of effort to harden the robot's electrical connections for this game, especially the radio's.

Your code invokes: IMAQdxGrab(curCam, frame, true, NULL); with the waitForNextBuffer argument set to true.

All this seems to point to your use of IMAQdxGrab is a blocking call that is only returning when it times out. While the call is blocking it is starving the rest of your teleop code which is why the robotdrive is reporting timeouts as well.

It might be worth placing your CameraFeeds::Run into its own Task. This will create a separate execution thread that can block without causing the rest of your teleop code wait for the blocking code to return.

Another recommendation is to check your Eclipse plugins and ensure they are up to date.


On another note I would recommend looking at the command pattern for C++ programming. it is pretty powerful and will help keep your code more easily manageable.

Lastly, while I am not especially proud of the code, I have a class for an xbox controller you might be interested in.

As I get time, I'll look over more of your code in detail to see if I can find anything else. I would be curious to know how things go with your resolution of this issue.

Thanks,
Matt
Reply With Quote
  #6   Spotlight this post!  
Unread 17-03-2016, 19:31
Auri's Avatar
Auri Auri is offline
Llama Overlord
AKA: Doug Guzman
FRC #2081 (Icarus)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Peoria IL
Posts: 3
Auri is an unknown quantity at this point
Re: Randomly Dropping out of Teleop

We got it figured out. Thanks Matt for explaining the issue to us. The camera is now running in its own thread.
Reply With Quote
Reply


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 22:01.

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