Go to Post If you base a team on how well you do on the field you have a much harder time winning. - Bob Steele [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-04-2011, 13:22
topgun's Avatar
topgun topgun is offline
Registered User
FRC #2846 (FireBears)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Minnesota
Posts: 229
topgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant future
High Average Trip Time - What to look for?

At our regional this last week we saw our avg trip time between the robot and the FMS system running about 180 ms. Everyone else was usually under 10 ms, with most being under 4 ms.

I asked the FTA about it and he said that it was something in our code.

Does anyone have any ideas on how to go about detecting what is slowing our code down so much? Is there a way to simulate the average trip time?

We are using Java and CAN. Versions of cRio, Java and DS were all up to the latest versions.

Thanks for your help!
__________________
-T

  #2   Spotlight this post!  
Unread 04-04-2011, 13:37
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: High Average Trip Time - What to look for?

Vision processing, sending back a lot of Dashboard/SmartDashboard messages, sending back raw video, and use of a lot of "xxxContinuous()" methods without Wait statements are all possible causes.

Probably the best way to test is to incrementally disable different parts of your code until the trip times seem reasonable. I would start with the possible causes listed above, if they are applicable.
  #3   Spotlight this post!  
Unread 04-04-2011, 13:37
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: High Average Trip Time - What to look for?

This might be far fetched, but I think he is right. When you program, you have to be conscientious about what you are doing in the code. Try streamlining your code and try making it more efficient. Remember less lines != mean more efficient. Less instructions = more efficient (eh, not always, some instructions take longer than others, but that is besides the fact)

Eh, I guess post your code here and I will help make it faster?
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #4   Spotlight this post!  
Unread 04-04-2011, 13:58
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,588
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: High Average Trip Time - What to look for?

It could also be caused by problems on the classmate side, for example a dashboard that uses too much CPU (we saw problems with video at 30fps, but reducing that to 10 made the problem go away). It could also be background tasks on the classmate (ie a virus).

Another cause on the robot side could be too many CAN messages that cause blocking. Check the diagnostics tab and see if any errors are being reported.
  #5   Spotlight this post!  
Unread 04-04-2011, 15:59
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: High Average Trip Time - What to look for?

Another possible cause:

Quote:
Originally Posted by Mark McCleod

Radios:

Radios mounted between/on-top-of/near the drive CIMs and/or buried deep in the robot metal lose communications when the robot starts to drive. Talk to the FTA before a match to ask him/her to watch the packet round trip time for your robot. Slow times (>20ms) probably mean the radio needs to be repositioned.
http://www.chiefdelphi.com/forums/sh...07&postcount=9


180ms seems really high though and may be a code or Driver's Station issue, or a code/DS issue in combination with a radio placement issue.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
  #6   Spotlight this post!  
Unread 04-04-2011, 16:13
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,856
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: High Average Trip Time - What to look for?

I'll backup what's already been mentioned.
  1. Check the Classmate CPU utilization (Cntl-Shift-Esc), because it can easily get bogged down by the video stream or other intensive Dashboard operations. Isolate by disabling/commenting out code.
  2. Check the CPU utilization on the cRIO for the same thing.
  3. Check the radio placement for disruptive interference.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #7   Spotlight this post!  
Unread 05-04-2011, 09:34
topgun's Avatar
topgun topgun is offline
Registered User
FRC #2846 (FireBears)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Minnesota
Posts: 229
topgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant future
Re: High Average Trip Time - What to look for?

Thank you for the suggestions.

If you want to look at our code it is located in read-only mode here:
http://www.firebears.org/hg Suggestions are welcomed.

We have our radio mounted about 4 feet high in the open with polycarbonate on one side to attach to our mast. We have never had an issue achieving connection and I didn't see where the avg trip time would speed up when the radio's open side was facing the FMS versus when it was facing away from the FMS.

We do a fair amount of system.out.println statements in our code, plus watching variable values on the dashboard.
__________________
-T

  #8   Spotlight this post!  
Unread 05-04-2011, 09:42
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,856
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: High Average Trip Time - What to look for?

From your description it wouldn't be the radio position.
I have noticed that a large volume of println's can also slow the system down.

Mostly it's measuring the processing load on the two primary processing systems involved: the Classmate and the cRIO.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #9   Spotlight this post!  
Unread 05-04-2011, 10:48
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: High Average Trip Time - What to look for?

Try disabling your SmartDashboard I/O and see what happens. You have a *lot* of it, and we noticed that our round trip times started to rise as we put more and more SmartDashboard calls in there.
  #10   Spotlight this post!  
Unread 10-04-2011, 21:10
topgun's Avatar
topgun topgun is offline
Registered User
FRC #2846 (FireBears)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Minnesota
Posts: 229
topgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant futuretopgun has a brilliant future
Re: High Average Trip Time - What to look for?

Quote:
Originally Posted by Jared341 View Post
... and we noticed that our round trip times started to rise as we put more and more SmartDashboard calls in there.
How were you able to notice that? Did you also notice that at a regional or is there a way to see the avg trip time with just the normal setup that teams have in their workshop?
__________________
-T

  #11   Spotlight this post!  
Unread 10-04-2011, 22:04
Arjun Namineni Arjun Namineni is offline
Registered User
FRC #4384
Team Role: Coach
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Troy, MI
Posts: 27
Arjun Namineni is an unknown quantity at this point
Re: High Average Trip Time - What to look for?

We also had a large trip time and upon further investigation, we concluded that it was the ridiculous amount of smart dashboard outputs that we had put in to help us debug our code.
Closed Thread


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 23:32.

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