Go to Post ....a red-light-of-death. - Kevin Watson [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 24-02-2016, 14:10
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 744
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
getMatchTime docs not correct

Measuring time in autonomous should be easy.

This is my first year using Java for FRC and it surprised me that it wasn't the case.

1: The sample "Getting Started" code uses loop counters to measure time... Really?

2: The description for the Timer class is simply wrong... it would lead you to believe that getMatchTime returns elapsed seconds... but it doesn't , it returns the countdown clock... which is extremely counter intuitive.

Plus, it only returns a valid time when running in "Practice" mode on the Driver Station. Nothing in pure Auto or Teleop modes.

The library getMatchTime() comment reads:

* This returns the time since the enable
* signal sent from the Driver Station At the beginning of autonomous, the
* time is reset to 0.0 seconds At the beginning of teleop, the time is reset
* to +15.0 seconds If the robot is disabled, this returns 0.0 seconds

I had to ultimately display the returned time on the dashboard to see why my code wasn't working. In Auto it starts at 15 and counts down.

So, it would appear that if I want a generic timer that I can reset to zero in each mode, I need to use getFPGATimestamp() to get a hardware time, and great my own "ElapsedTime class to be able to tell how long I've been running.

Simple enough now I know I need to do it, but really.......
Not making it easy for beginners.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
Reply With Quote
 


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

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