Dashboard for .NET

I have an untested dashboard application that allows you to create your own views of the dashboard data and dynamically load them into a GUI. The application loads a set of controls that inherit from a shared base class into tabs on a form. The host application does all of the serial IO and packet decoding so you only need to worry about processing the packets as they come it.

The current version has five sample views, including one that displays the information from the CMUCam data struct. Currently it shows the centroid and the bounding box only. In order to view the data within the dashboard application you will need to use the user_bytes to pass back the information as follows:


User_Byte1 = cam.x;
User_Byte2 = cam.y;
User_Byte3 = cam.x1;
User_Byte4 = cam.y1;
User_Byte5 = cam.x2;
User_Byte6 = cam.y2;

If you would like to give it a shot you can download the program HERE. Once I know its all working correctly I’ll post instructions for creating your own views.

If you really want to hack at it, all you do is create a new user control that inherits from Team116.Dashboard.UI.DashboardView found in DashboardTypeLib.dll. There are four virtual methods defined in that class that you can override, one to process each of the four data packet types. Your new control is then compiled into an assembly and copied to the folder with dashboard.exe. Edit DashboardTabs.xml to add a reference to your new control and you’re all set.

The CommBase.dll assembly is from a sample in MSDN Magazine, Ref: “Serial Comm: Use P/Invoke to Develop a .NET Base Class Library for Serial Device Communications” John Hind, MSDN Magazine, Oct 2002. V1.3 February 2004.

Very nicely done. Congrats.

The previous release worked fine. I tested it originally with the mini-rc but I was able to try it with a 2005 controller pair over the weekend.

You can download the viewer here: http://members.cox.net/seanwitte/dashboardviewer.zip.

Assembly containing a field map control: http://members.cox.net/seanwitte/FieldModel.dll

The Field control has three items of interest:

  1. The property RobotImagePath can be set to a custom graphic representing your robot. This is the full windows path to the file. It should be 44x33 pixels for scale. The pixel in the upper left-hand corner will be used as the transparent color. Set this property when you initialize the container.

  2. Method DrawRobot(int x, int y, int heading) draws the robot on the field. The heading is in degrees and the origin is the lower left-hand edge.

  3. Method ClearField() clears the field image.

I haven’t released the source, but it is not needed to create your own views. The word document in the zip file walks you through the process of creating a new Windows Control Library, setting up a view control, and adding the new view to the dashboard viewer application.

Each of the tabs in the application is loaded with a separate control at runtime. You just create a control, override some callback methods to display the dashboard data, and you’re all set. I includes a control to show the centroid and bounding box output from the CMUCam, a simple LED, and a sliding bar control.

If it works out for you, please let me know. I would rate the skills required to be intermediate. At least you can find a use for the copy of VS.NET in the KOP.

I forgot to mention that the views included are just samples. You can remove them by commenting them out in the XML config file using <!-- --> tags around the <tab></tab> element you want to remove. Or you can delete them. If you muck up the file, delete it and restart the exe. It will create a fresh copy with the defaults.

This is great! You need .NET for the code to actually execute, or at least I did,

Also, I was able to make a usb-serial work by changing the com settings in
the device driver to 19200 baud the standard rate for the dashboard interface. Also, if your laptop has a strange com port (i.e. com8), you should manually edit the .xml file with comm settings (it will generate when the .exe runs)

~Andrew Lynch

Really helpful tool, I have the same problem with a wacky usb com port.

I’ve received a few questions about extending this application, so I added a sample project. The msi installer is available here:

http://members.cox.net/seanwitte/dashboardviewersample.msi

The installation folder will include the latest version of everything, plus a subfolder with a VB.NET project containing the source for the tab labeled “Custom View”. You sould be able to edit the content of CustomView.vb (a user control inheriting from Team116.Dashboard.UI.DashboardView) to suit your needs. Run dashboard.exe in the installation folder to start the application.

I don’t use VB.NET, but it seems like the default namespace always matches the assembly name. So a class named foo in an assembly named bar would be bar.foo. The Custom View includes a field map showing the robot’s location and the control showing the CMU camera tracking data.

You can change the image of the robot by setting RobotImagePath property on the Field class in CustomView.vb. The scale is roughly 1.1 pixel per inch and the pixel in the upper left-hand corner will be used as the transparent color.

Send me an email at [email protected] if you’re using this and want to be notified when an update is ready. I will be finishing it up this weekend.

Screen shot of the sample view showing the CMUCam data and field map:

Again, wow, I think every team should consider using such a powerful application for debugging and autonomous period (to actually know what your robot was sensing). That also means gyro, accelerometer, encoders and potentiometers must be fed through userbytes or maybe through some other dashboard data byte.

The next thing that seems possible for FIRST is to have real time touch screen (of the playing field) control for the operator instead of a joystick!! Seems strange but think about the precision!

this is fantastic!

~ Andrew Lynch

I am pretty sure a touchscreen would be illegal. There is some sort of rule against using processors on the OI end of the link. It doesnt really make much sense to me, but there are a lot of things like that. Awesome program. I will be trying it on our robot tomorrow, assuming I have time.

I uploaded the completed package in the Whitepapers -> Programming -> Dashboard section. It includes sample C# and VB.NET projects you can use as a starting point for creating your own views. It also explains how the custom controls in the package are used and a simple example illustrating how to squeeze more information out of the feedback data set.