Go to Post An opportunity is always there waiting to be discovered, we just have to look and then see what we can do to help create change. - JaneYoung [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 15-01-2010, 03:06
ranc ranc is offline
Registered User
FRC #2489
 
Join Date: Feb 2009
Location: Fremont
Posts: 15
ranc is an unknown quantity at this point
Re: Grabbing Output from Robot Sensors

Wait you have no while(true) or while(IsOperatorControl()) loops?
I remember leaving out said while loop and getting the same issue.

Last edited by ranc : 15-01-2010 at 03:13.
Reply With Quote
  #2   Spotlight this post!  
Unread 15-01-2010, 09:41
1951-44U's Avatar
1951-44U 1951-44U is offline
ROAR.
AKA: Phil Chang
FRC #0025 (Raider Robotix)
Team Role: Programmer
 
Join Date: Oct 2008
Rookie Year: 2007
Location: NBTHS
Posts: 34
1951-44U has a spectacular aura about1951-44U has a spectacular aura about1951-44U has a spectacular aura about
Re: Grabbing Output from Robot Sensors

Well, we have those loops, but we have no others. We have Feed()'s within those loops, too.

Does the line "GetWatchdog().SetExpiration(0.1);" in the initializers do anything? Can I delete this?
Reply With Quote
  #3   Spotlight this post!  
Unread 15-01-2010, 10:59
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Grabbing Output from Robot Sensors

Quote:
Originally Posted by 1951-44U View Post
Well, we have those loops, but we have no others. We have Feed()'s within those loops, too.

Does the line "GetWatchdog().SetExpiration(0.1);" in the initializers do anything? Can I delete this?
That sets the expiration time of the watchdog timer. That means that it must be fed within 0.1 second (100 milliseconds) before it times out and the motors stop with the "Watchdog not fed" error message.

If there are any Wait() calls in your loop that are greater than 100ms, the the watchtog will also time out.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #4   Spotlight this post!  
Unread 15-01-2010, 15:41
1951-44U's Avatar
1951-44U 1951-44U is offline
ROAR.
AKA: Phil Chang
FRC #0025 (Raider Robotix)
Team Role: Programmer
 
Join Date: Oct 2008
Rookie Year: 2007
Location: NBTHS
Posts: 34
1951-44U has a spectacular aura about1951-44U has a spectacular aura about1951-44U has a spectacular aura about
Re: Grabbing Output from Robot Sensors

Can I SetExpiration at some ridiculously high number to get rid of the watchdog error?
Reply With Quote
  #5   Spotlight this post!  
Unread 15-01-2010, 16:22
ranc ranc is offline
Registered User
FRC #2489
 
Join Date: Feb 2009
Location: Fremont
Posts: 15
ranc is an unknown quantity at this point
Re: Grabbing Output from Robot Sensors

You could use GetWatchdog().SetEnabled(0) for turning it off right before your long wait and then use GetWatchdog().SetEnabled(1) for turning it back on again when you're not initializing whatever you're initializing (i'm assuming your long wait is due to setup of some component)
Reply With Quote
  #6   Spotlight this post!  
Unread 15-01-2010, 20:12
1951-44U's Avatar
1951-44U 1951-44U is offline
ROAR.
AKA: Phil Chang
FRC #0025 (Raider Robotix)
Team Role: Programmer
 
Join Date: Oct 2008
Rookie Year: 2007
Location: NBTHS
Posts: 34
1951-44U has a spectacular aura about1951-44U has a spectacular aura about1951-44U has a spectacular aura about
Re: Grabbing Output from Robot Sensors

I'll try that tomorrow. But I haven't a single Wait() in the program. ._.

Can I completely delete the GetWatchdog().SetExpiration() or completely replace it with the .SetEnabled()?

Last edited by 1951-44U : 15-01-2010 at 21:48.
Reply With Quote
  #7   Spotlight this post!  
Unread 15-01-2010, 23:46
ranc ranc is offline
Registered User
FRC #2489
 
Join Date: Feb 2009
Location: Fremont
Posts: 15
ranc is an unknown quantity at this point
Re: Grabbing Output from Robot Sensors

Yes I think you could just use set enabled to turn it off
Reply With Quote
  #8   Spotlight this post!  
Unread 16-01-2010, 12:25
1951-44U's Avatar
1951-44U 1951-44U is offline
ROAR.
AKA: Phil Chang
FRC #0025 (Raider Robotix)
Team Role: Programmer
 
Join Date: Oct 2008
Rookie Year: 2007
Location: NBTHS
Posts: 34
1951-44U has a spectacular aura about1951-44U has a spectacular aura about1951-44U has a spectacular aura about
Re: Grabbing Output from Robot Sensors

We tried setting the Watchdog at SetEnabled(0), but still get the same problem. We set it at 0 in the initializers, in autonomous, in the operator function, and in the operator loop. Setting SetExpiration() at an impossibly high number had no success, either.

Last edited by 1951-44U : 16-01-2010 at 12:40.
Reply With Quote
  #9   Spotlight this post!  
Unread 19-01-2010, 15:40
1951-44U's Avatar
1951-44U 1951-44U is offline
ROAR.
AKA: Phil Chang
FRC #0025 (Raider Robotix)
Team Role: Programmer
 
Join Date: Oct 2008
Rookie Year: 2007
Location: NBTHS
Posts: 34
1951-44U has a spectacular aura about1951-44U has a spectacular aura about1951-44U has a spectacular aura about
Re: Grabbing Output from Robot Sensors

New development!

We tried instigating the Watchdog error while watching the serial output, and found something very interesting.

We could get output from the serial output (meaning that we got the printf values from the code in the serial output) and the sensors were working fine! Outputting data! But once we turned on the target console on the programming laptop (the programming laptop and the serial output laptop are separate laptops) everything STOPPED. Came to a STANDSTILL. No more output, nothing. The serial output stream seemed to FREEZE. That may be why the dog was barking.

But the data we received from the sensors are somewhat strange. The different printf statements mixed and mashed with each other, seeming to overlap. I can't make anything of the data because they overlap so often.

Any ideas?
Reply With Quote
  #10   Spotlight this post!  
Unread 19-01-2010, 21:34
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Grabbing Output from Robot Sensors

So when you had just the serial cable plugged in and no target console, was the data reasonable? Is the problem related to having mixed serial output?
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #11   Spotlight this post!  
Unread 20-01-2010, 15:37
1951-44U's Avatar
1951-44U 1951-44U is offline
ROAR.
AKA: Phil Chang
FRC #0025 (Raider Robotix)
Team Role: Programmer
 
Join Date: Oct 2008
Rookie Year: 2007
Location: NBTHS
Posts: 34
1951-44U has a spectacular aura about1951-44U has a spectacular aura about1951-44U has a spectacular aura about
Re: Grabbing Output from Robot Sensors

I'm not even sure what the data was -- it meshed and overlapped, so the numbers weren't nicely and neatly in line with respective labels.

Example:
______ Turns
______ Position

It was like:

Turns0003054Position

It jumbled all the output.
Reply With Quote
  #12   Spotlight this post!  
Unread 20-01-2010, 16:44
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Grabbing Output from Robot Sensors

did you have \r\n at the end of the printf's? this is the new line sequence. if you have printf("part 1") (more code here) printf("part 2 \r\n"), it should output like this:
Code:
part 1 part 2
part 1 part 2
part 1 part 2
part 1 part 2
part 1 part 2
part 1 part 2
part 1 part 2
part 1 part 2
part 1 part 2
so you can see 1 and 2 as the numbers fly by instead of
Code:
part 1 part 2part 1 part 2part 1 part 2pa
rt 1 part 2part 1 part 2part 1 part 2part 
1 part 2part 1 part 2part 1 part 2part 1 
part 2part 1 part 2part 1 part 2part 1 pa
rt 2part 1 part 2part 1 part 2part 1 part 
2part 1 part 2part 1 part 2part 1 part 2p
art 1 part 2part 1 part 2part 1 part 2par
t 1 part 2part 1 part 2part 1 part 2part 
1 part 2part 1 part 2part 1 part 2part 1
 part 2part 1 part 2part 1 part 2
and you have to do a print screen to look at them
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem receiving console output from cRIO Arborama Programming 7 15-02-2009 03:30
Weird output from ultrasonic and gyro Yuan Xue Lim Programming 4 11-02-2009 19:01
live input/output to/from application MarkH Programming 3 06-04-2006 01:43
Weird Output from Dashboard Port Ian W. Programming 9 06-03-2004 21:33
output from a cell phone? Ben.V.293 Electrical 6 24-12-2003 14:52


All times are GMT -5. The time now is 13:35.

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