You may possess me without penalty.
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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 30-01-2011, 11:56
sircedric4's Avatar
sircedric4 sircedric4 is offline
Registered User
AKA: Darren
no team (The SS Prometheus)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Lousiana
Posts: 245
sircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond repute
Need SmartDashboard Help

I really like the looks and simplicity of the SmartDashboard listed in the WPI user's guide but I can't figure out how to get it setup and working.

How do I get the dashboard program to load on the Classmate in place of the Labview default. The readme for SmartDashboard does not describe how to setup it up on the Classmate.

Simple step by step instructions would be best. I tried simply deleteing the Dashboard.exe within the FRC Dashboard folder and replacing it with the Smartdashboard.jar file renamed to Dashboard.exe but it did not load when I brought up the Driver Station.

Once I have it working on the Classmate, we are using C++, the Users Guide only shows java code for example. How would I use it in C++?

I tried:
Code:
class IterativeDemo : public IterativeRobot
{
	SmartDashboard *dash;

public:
	IterativeDemo(void)	{
		dash = new SmartDashboard();
             }


	void DisabledInit(void) {
		dash->init();
              }

	void DisabledPeriodic(void)  {
			dash->log(ElevatorCommand,"Elevator Command");
             }
but I got this error about the first declaration: "C:/WindRiver/workspace/Team2992_2011_Code_4/IterativeDemo.cpp:254: error: no matching function for call to `SmartDashboard::SmartDashboard()'"

so I need help getting it working codewise too. For the SmartDashboard folks, a quick "Getting Started" guide with the assumption that we have never changed dashboards before would be very valuable.
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2011, 12:38
demosthenes2k8's Avatar
demosthenes2k8 demosthenes2k8 is offline
Graduated but not gone
AKA: Matt Soucy
FRC #0166 (Chop Shop 166)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Merrimack, NH
Posts: 590
demosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to behold
Send a message via AIM to demosthenes2k8 Send a message via Yahoo to demosthenes2k8
Re: Need SmartDashboard Help

Aah, I see your problem.
You never have to actually create a SmartDashboard pointer. Instead, what you have to do is
Code:
SmartDashboard::init();
Then you log with
Code:
SmartDashboard::Log(value,"name");
__________________


GSR Dean's List Finalist 2011
Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2011, 12:44
sircedric4's Avatar
sircedric4 sircedric4 is offline
Registered User
AKA: Darren
no team (The SS Prometheus)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Lousiana
Posts: 245
sircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond repute
Re: Need SmartDashboard Help

Quote:
Originally Posted by demosthenes2k8 View Post
Aah, I see your problem.
You never have to actually create a SmartDashboard pointer. Instead, what you have to do is
Code:
SmartDashboard::init();
Then you log with
Code:
SmartDashboard::Log(value,"name");
Sweet, thanks. I still can't understand when you are supposed to use pointer and when you are not. Nothing is consistent and so it seems impossible to get the hang of C++ coding by example.

Do you know how to setup it up on the Classmate so its uses a custom dashboard instead of the default? I still need help there.
Reply With Quote
  #4   Spotlight this post!  
Unread 30-01-2011, 14:06
demosthenes2k8's Avatar
demosthenes2k8 demosthenes2k8 is offline
Graduated but not gone
AKA: Matt Soucy
FRC #0166 (Chop Shop 166)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Merrimack, NH
Posts: 590
demosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to behold
Send a message via AIM to demosthenes2k8 Send a message via Yahoo to demosthenes2k8
Re: Need SmartDashboard Help

Well, SmartDashboard is supposed to have static members - this means you don't have to have an object of the type to use them. This is denoted with the "::". A few things do this, often getInstance functions to get singleton instances of a class. I'm willing to help answer any questions you may have, so please, just ask!

One of 166's team members made a simple launcher for the SmartDashboard, and he's posting it now.
EDIT: It's here
__________________


GSR Dean's List Finalist 2011

Last edited by demosthenes2k8 : 30-01-2011 at 14:12.
Reply With Quote
  #5   Spotlight this post!  
Unread 31-01-2011, 07:40
sircedric4's Avatar
sircedric4 sircedric4 is offline
Registered User
AKA: Darren
no team (The SS Prometheus)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Lousiana
Posts: 245
sircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond repute
Re: Need SmartDashboard Help

Quote:
Originally Posted by demosthenes2k8 View Post
Well, SmartDashboard is supposed to have static members - this means you don't have to have an object of the type to use them. This is denoted with the "::". A few things do this, often getInstance functions to get singleton instances of a class. I'm willing to help answer any questions you may have, so please, just ask!

One of 166's team members made a simple launcher for the SmartDashboard, and he's posting it now.
EDIT: It's here
Thanks for the link to the launcher, we'll give that a try tonight. It will be so nice to get a simple dashboard without all the clusters and formatting and other associated claptrap. We are still amateurs at our coding, so just being able to pop up the variables we are looking for is going to be so handy for debugging.

We were having to squeeze them all into the dsLCD area of the Driverstation which is a big pain.
Reply With Quote
  #6   Spotlight this post!  
Unread 31-01-2011, 08:55
demosthenes2k8's Avatar
demosthenes2k8 demosthenes2k8 is offline
Graduated but not gone
AKA: Matt Soucy
FRC #0166 (Chop Shop 166)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Merrimack, NH
Posts: 590
demosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to behold
Send a message via AIM to demosthenes2k8 Send a message via Yahoo to demosthenes2k8
Re: Need SmartDashboard Help

My team made a function (it's part of our framework) to make an interface for that dsLCD that behaves essentially exactly like printf.

Code:
/**
 * Send text to DS LCD display
 */
int DriverStationDisplay(const char* format, ...)
{
        va_list args;
        static string dash_string[6];
        static bool init=true;
        char formatted_string[DASHBOARD_BUFFER_MAX];
        if(init) {
                //Initializes it first call.
                for(int i=0;i<6;i++) {
                        dash_string[i] = "                     ";
                }
                init=false;
        }
        va_start( args, format );
        vsnprintf(formatted_string, DASHBOARD_BUFFER_MAX, format, args);
        va_end(args);
        
        //Move lines up to make room for the newline 
        for(int i=5; i>=1; i--) {
                dash_string[i] = dash_string[i-1];
        }
        dash_string[0] = formatted_string;

        for(int i=0; i<6; i++) {
                dsHandleLCD->PrintfLine((DriverStationLCD::Line)i, dash_string[i].c_str());
        }
        dsHandleLCD->UpdateLCD();
        return 0;
}
Feel free to use it, or even the whole framework, from http://framework.chopshop166.com/

And you're welcome for the launcher, Ben wrote it really quickly, but it's small and works very well!
__________________


GSR Dean's List Finalist 2011
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 05:15.

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