View Full Version : Creating a Dashboard
Hello everyone,
This is my second year in FRC, and first year of being one of the main coders (though I have previous C++ experience). Last year, we were using Labview, and it was fairly simple to create a custom dashboard. However, this year, we are thinking of switching to C++, and I have absolutely no idea how to create one. Could you guys help me at all with this?
Thanks
agartner01
27-09-2012, 19:03
QT and bsd sockets are the way to go. Take a look at QT-Creator (qt.digia.com) for building a dashboard on the laptop side. For sending the data I use QT's QTcpSocket on the laptop and the TCPHelper Functions (https://github.com/H2CO3/TCPHelper) on the robot.
Alan Anderson
27-09-2012, 19:54
You don't have to program the Dashboard using the same language you program the robot with. If you follow the data format properly in a C++ robot program, you can easily send data to a LabVIEW Dashboard program.
F22Rapture
27-09-2012, 22:33
No need to create an entirely new dashboard from scratch (unless you want to, that is). Check out ZomB (http://firstforge.wpi.edu/sf/frs/do/viewSummary/projects.zombdashboard/frs) and SmartDashboard (http://firstforge.wpi.edu/sf/frs/do/viewSummary/projects.smartdashboard/frs), both of which are fairly mature, have decent documentation, and work pretty well.
It's also completely possible to use the LabView dashboard with Java or C++ (http://forums.usfirst.org/attachment.php?attachmentid=1976&d=1263243614) if you follow a few steps to make it compatible.
droswell
27-09-2012, 23:46
Yep, we used SmartDashboard this year and it was great. The more people use it, the bigger the community, the more widgets will get added, and the better it will become. I think SmartDashboard is not only the most integrated, but it was really easy to set up and get going. It's part of WPILib now, so my guess is you'll get the best support with this solution.
connor.worley
27-09-2012, 23:49
QT and bsd sockets are the way to go. Take a look at QT-Creator (qt.digia.com (http://qt.digia.com)) for building a dashboard on the laptop side. For sending the data I use QT's QTcpSocket on the laptop and the TCPHelper Functions (https://github.com/H2CO3/TCPHelper) on the robot.
I disagree. There's no need to get into the nitty-gritty of socket programming. SmartDashboard should suffice.
agartner01
28-09-2012, 00:27
I disagree. There's no need to get into the nitty-gritty of socket programming. SmartDashboard should suffice.
If you really want a dashboard in c++, then you pretty much have to. When I responded, I thought that was the question that needed answering. If you don't need that then I guess I agree with your disagreement.
My team used Network Tables last season, and personally, I found them inefficient and inaccurate (which was probably more because of the bandwith problems rather than poor design), half of the time the data never was recieved... Hopefully Network Tables 2.0 will be better (the FirstForge page makes them sound so).
On the note of Qt, sockets, and c++: I actually got a system to send and recieve data values to the robot up and running in about an hour (with pretty much zero knowledge of socket programming). The TCPHelper functions really make it easy on the robot side... On the laptop side it's pretty much just socket.connectToHost(), then socket.write(), or socket.read() (without error checking, of course).
TL;DR: You can probably get by using NetworkTables, but don't be afraid of sockets...
Thanks to everyone! I would prefer to go with the option that has the least amount of work involved, and produces acceptable results--so I think we might just use LabView. Thanks Alan/Rapture for suggesting that--I wasn't sure if they were compatible with each other. I don't have much experience building a dashboard (Though I would assume it's all pre-packaged in the 'Build Dashboard Project' option in LabView; I'm sure it won't be too hard to extend the ready-made code). Are there any finer points to deal with connecting to such a dashboard in C++? And would I just use the functions provided in the Dashboard class? The Dashboard.AddType() functions (in Dashboard.h)? I guess Labview will have similar options for reading, and writing back.
However, what functions would I use for listening to the Dashboard from the CRio?
Once again, thanks!
Joe Ross
01-10-2012, 11:55
Thanks to everyone! I would prefer to go with the option that has the least amount of work involved, and produces acceptable results--so I think we might just use LabView. Thanks Alan/Rapture for suggesting that--I wasn't sure if they were compatible with each other. I don't have much experience building a dashboard (Though I would assume it's all pre-packaged in the 'Build Dashboard Project' option in LabView; I'm sure it won't be too hard to extend the ready-made code). Are there any finer points to deal with connecting to such a dashboard in C++? And would I just use the functions provided in the Dashboard class? The Dashboard.AddType() functions (in Dashboard.h)? I guess Labview will have similar options for reading, and writing back.
However, what functions would I use for listening to the Dashboard from the CRio?
Once again, thanks!
There's no built-in FIRST-specific method to communicate from a LabVIEW dashboard to the robot, unlike from the robot to the dashboard. You can do it through UDP or TCP sockets.
If two way communication is important, I would suggest starting with the SmartDashboard, which supports two way communication natively. I think that managing the datatype using the Dashboard class to communicate with the LabVIEW dashboard is a pain, but that isn't necessary with SmartDashboard.
Greg McKaskle
03-10-2012, 07:52
While I won't discourage you from learning the lower level packing functions that are provided for sending stuff to the dashboard, a beta quality set of VIs that implement the SmartDashboard protocol were released last year.
The 2.0 version should make it far easier to mix and match languages and to allow for two-way communications. So perhaps you want to wait until more of that is available.
Greg McKaskle
That first link describing how to use the Labview dashboard with C++ seems to have been deleted. Is this still possible to do?
nightpool
02-02-2013, 23:27
Probably, but the SmartDashboard has been more then sufficient for any task I've had for it. Unless your concerned about aesthetics, I don't see any reason to not use the SmartDashboard.
Greg McKaskle
03-02-2013, 18:10
It is still possible to do. Communicating to the LV or Java SmartDashboard from C++ is identical. Simply write to a SmartDashboard variable.
Building the dashboard visuals is different and both tools have a variety of ways to accomplish it.
Greg McKaskle
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.