Go to Post It seems ironic to me that a robotics competition would come down to human error, which is precisely what the field of robotics attempts to prevent. - David8696 [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-2015, 07:16
Cinnamon Toast's Avatar
Cinnamon Toast Cinnamon Toast is offline
Registered User
FRC #3641 (The Flying Toasters)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Michigan
Posts: 32
Cinnamon Toast is an unknown quantity at this point
SmartDashboard Class Problems

Hello fellow programmers,

I've run into a problem with the SmartDashboard.h class. As you may have found out, the DriverStationLCD class that many used last year to output text to the User Messages part of the Driver Station has been replaced with the SmartDashboard.h class. As far as I'm concerned there's no way to actually output text to the equivalent section of this years driver station. Instead, the SmartDashboard class lets you output data to the basic tab of the FRC Dashboard. We as a team used to use this readout in the User Messages as a live feedback for our potentiometer and ultra sonic sensor values with the following code.

ds->PrintfLine(DriverStationLCD::kUser_Line3, "Pot: %f", angle);

From what I've seen from the class documentation of SmartDashboard.h, there is no way to output a floating point value. Any argument for output seems to have to be char based. Also, we used to be able to use the updateLCD line to get live feedback of the values as they changed. How can we actually get such variables to output to the driver station? I would really appreciate any help that I can get. Thank you all in advance.
Reply With Quote
  #2   Spotlight this post!  
Unread 15-01-2015, 10:19
fsilberberg fsilberberg is offline
WPILib Developer
AKA: Fred Silberberg
FRC #0190
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Redmond
Posts: 146
fsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura about
Re: SmartDashboard Class Problems

That is absolutely not true. See here: http://wpilib.screenstepslive.com/s/...-robot-program. The example is in Java but the equivalent C++ will work From your example:
Code:
SmartDashboard::PutNumber("Pot Angle", angle);
That will show up on the SmartDashboard as a number, and you can change it to other types of displays such as a graph over time and other widgets, as seen here: http://wpilib.screenstepslive.com/s/...anual-id=26401.
Reply With Quote
  #3   Spotlight this post!  
Unread 15-01-2015, 11:44
Cinnamon Toast's Avatar
Cinnamon Toast Cinnamon Toast is offline
Registered User
FRC #3641 (The Flying Toasters)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Michigan
Posts: 32
Cinnamon Toast is an unknown quantity at this point
Re: SmartDashboard Class Problems

Thank you so much fsilberberg! I must have grazed over that last night while looking at the SmartDashboard class, because it was sitting right there after I searched for it. One more question though. Do I have to mess with updating the value now? I know that before I had to, but what about now? Sorry these questions may be a bit...rudimentary. It's my first year as programming lead and I don't have as much experience as I really should. Thank you again!
Reply With Quote
  #4   Spotlight this post!  
Unread 15-01-2015, 17:45
fsilberberg fsilberberg is offline
WPILib Developer
AKA: Fred Silberberg
FRC #0190
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Redmond
Posts: 146
fsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura about
If I'm understanding your question correctly, you are asking whether you'll need to keep putting the values or whether it will update itself? If that's the question, then yes, you need to keep updating it.
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 02:45.

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