|
|
|
| You may possess me without penalty. |
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
||||
|
||||
|
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");
}
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. |
|
#2
|
||||
|
||||
|
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(); Code:
SmartDashboard::Log(value,"name"); |
|
#3
|
||||
|
||||
|
Re: Need SmartDashboard Help
Quote:
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. |
|
#4
|
||||
|
||||
|
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 Last edited by demosthenes2k8 : 30-01-2011 at 14:12. |
|
#5
|
||||
|
||||
|
Re: Need SmartDashboard Help
Quote:
We were having to squeeze them all into the dsLCD area of the Driverstation which is a big pain. |
|
#6
|
||||
|
||||
|
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;
}
And you're welcome for the launcher, Ben wrote it really quickly, but it's small and works very well! |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|