Go to Post "There are two ways to compete in this world, you can drag your competitors down, or you can rise above them. Which is better for the world in the long run?" - Karthik [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 05-02-2009, 04:29
kiettyyyy's Avatar
kiettyyyy kiettyyyy is offline
Registered User
FRC #1538 (The Holy Cows)
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2005
Location: San Diego, CA
Posts: 181
kiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond repute
Send a message via AIM to kiettyyyy
PrintF to Driver Station

Hey all!

I've been reading through the documentation to use the Driverstation class, but, I still havn't figured out how the data actually goes across the network into eth2.

Does anyone know what port I can listen into to get data when using the printf function?

Thanks!
__________________
-Kiet Chau

2004-2008 - Software Developer/Driver on Team #968
2008-2011 - Software Developer/Coach/Mentor/"Engineer" on Team #968
2011-Present - Mentor & Engineer on Team #1538
www.team1538.com
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2009, 14:48
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: PrintF to Driver Station

include a printf in your code, run it, then in WR target connections, right click the cRIO connection>Target Tools>Target Console:OK
__________________
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
  #3   Spotlight this post!  
Unread 05-02-2009, 15:56
kiettyyyy's Avatar
kiettyyyy kiettyyyy is offline
Registered User
FRC #1538 (The Holy Cows)
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2005
Location: San Diego, CA
Posts: 181
kiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond repute
Send a message via AIM to kiettyyyy
Re: PrintF to Driver Station

Well, is there any way to pull the data off without using the WR tools?
__________________
-Kiet Chau

2004-2008 - Software Developer/Driver on Team #968
2008-2011 - Software Developer/Coach/Mentor/"Engineer" on Team #968
2011-Present - Mentor & Engineer on Team #1538
www.team1538.com
Reply With Quote
  #4   Spotlight this post!  
Unread 05-02-2009, 21:01
ericand's Avatar
ericand ericand is offline
Registered User
AKA: Eric Anderson
FRC #3765 (Terrabots)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: St. Paul, MN
Posts: 148
ericand is a jewel in the roughericand is a jewel in the roughericand is a jewel in the rough
Re: PrintF to Driver Station

The data that you print will also go out the cRIO console on the serial port.

There is some setup that you need to do (a dip switch setting I think) and a somewhat custom serial cable to construct, but you can get the console printfs via the serial port without having Wind River involved.
Reply With Quote
  #5   Spotlight this post!  
Unread 05-02-2009, 21:10
Phazonmutant's Avatar
Phazonmutant Phazonmutant is offline
Winrar
AKA: Greg Mitchell
FRC #2556 (RadioActive Roaches)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Niceville, FL
Posts: 17
Phazonmutant is on a distinguished road
Re: PrintF to Driver Station

I think I'm trying to do something similar.
Instead of getting the output in an ugly console, I'm trying to redirect the sdout stream to a C# gui that I'll create. Does anyone have any idea how to redirect the sdout stream to a process on the laptop?

Oh, and to get the cout's (or printf's or whatever) to appear in the Wind River Target Console, you need to flip the dip switch labeled "Console Out" on the cRIO to the left (if the bulk of the cRIO is to your right)
Reply With Quote
  #6   Spotlight this post!  
Unread 05-02-2009, 22:11
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: PrintF to Driver Station

http://www.chiefdelphi.com/forums/sh...ad.php?t=72874
I tried that, it worked a few times, then it stopped working for me
__________________
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
  #7   Spotlight this post!  
Unread 07-02-2009, 00:16
kiettyyyy's Avatar
kiettyyyy kiettyyyy is offline
Registered User
FRC #1538 (The Holy Cows)
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2005
Location: San Diego, CA
Posts: 181
kiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond repute
Send a message via AIM to kiettyyyy
Re: PrintF to Driver Station

Anyone know how to pull off dashboard values from the control system packets?
__________________
-Kiet Chau

2004-2008 - Software Developer/Driver on Team #968
2008-2011 - Software Developer/Coach/Mentor/"Engineer" on Team #968
2011-Present - Mentor & Engineer on Team #1538
www.team1538.com
Reply With Quote
  #8   Spotlight this post!  
Unread 07-02-2009, 10:51
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: PrintF to Driver Station

Based on the default dashboard project in labview, the packet comes in on UDP port 1165 of the 10.XX.YY.6 address. There's a bunch of decoding that gets done in "Receive DS Packet.vi" that you can try to decipher if you're trying to roll your own.

We took the default project, stipped off the right side of the diagram and plugged in our own front panel elements. Once you get it up and running, it proves to be extremely useful...much more so than a console of streaming numbers

I have to say, if you're doing a laptop based dashboard that at this point in time this is a fast and easy way to get something up quickly. One thing that burned me a few times is having data in the input cluster out of order. To fix this you can right click on the cluster itself and select the reorder controls option.
Reply With Quote
  #9   Spotlight this post!  
Unread 08-02-2009, 18:11
Phazonmutant's Avatar
Phazonmutant Phazonmutant is offline
Winrar
AKA: Greg Mitchell
FRC #2556 (RadioActive Roaches)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Niceville, FL
Posts: 17
Phazonmutant is on a distinguished road
Re: PrintF to Driver Station

You're right, the LabView Dashboard looks like it can be really useful.
How do I set the constant on the left to match with the dashboard data format I define in the code? Also, how do I get the custom data to appear on the LabView dashboad?
Reply With Quote
  #10   Spotlight this post!  
Unread 09-02-2009, 19:53
mianesva mianesva is offline
Registered User
FRC #1073
 
Join Date: Oct 2008
Location: Hollis, NH
Posts: 1
mianesva is an unknown quantity at this point
Re: PrintF to Driver Station

If using Windriver you can just create one of the sample projects to demo the dashboard class.

It is extremely useful to download/install the WPI Lib sources...

Specifically, driverstation.cpp and dashboard.cpp

It is clear that dashboard.cpp is a packer class that encodes the data in a way for Labview to unpack...

One does not need to use this particular way of packing data if one is to write their own dashboard (e.g. using c#, java, etc...). All that is needed is a sample upd server code to read port 1165 as noted earlier in this tread... One can then come up with their own way of encoding data in the packets....

The robot essentially sends the 984 or so bytes every 20ms... it is all there in the code in driverstation.cpp (senddata function)

These bytes then go to the driverstation (address 10.x.x.5) which then sends them to the 10.x.x.6 address. This is hardwired somewhere.... The laptop that has 10.x.x.6 address then receives the information via udp from the driver station....
Reply With Quote
  #11   Spotlight this post!  
Unread 09-02-2009, 20:56
dpeterson3 dpeterson3 is offline
Registered User
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Aug 2008
Rookie Year: 2008
Location: St. Louis
Posts: 158
dpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the rough
Re: PrintF to Driver Station

I'm working on a custom dashboard also. This thread is very helpful.
http://www.chiefdelphi.com/forums/sh...446#post804446
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
Driver Station S.O.S. M. Gildner Electrical 15 28-11-2009 19:35
Dead Driver Station? tdeprince FRC Control System 3 12-02-2009 12:14
Driver Station Print drosophyllum Programming 0 27-01-2009 21:06
Driver Station Input SwampDogs NI LabVIEW 3 27-01-2009 11:33
Connections to Driver Station Zellboy Electrical 1 23-01-2009 16:24


All times are GMT -5. The time now is 02:40.

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