![]() |
ZomB: a C# Drag and Drop Dashboard
2 Attachment(s)
Team 451 would like to share our ZomB Dashboard (Yes, you read that right, zombie) that we have been working on, and get some feedback. We have used this successfully for a few response testing, like ultrasonic (it looks good on a graph)
Pre-build controls: AnalogMeter, DataGraph(inspired by taskmanager), DirectionMeter, DistanceMeter, SpikeControl, RoundSpeedMeter, TacoMeter(Yes, it even has cheese), MessageDisplay, VarValue, OnOffControl, ColorFind(Totally misleading name, still testing) There are 2 parts, the dashboard, and the robot files. Requirements: Visual Studio 2008, .Net 2.0 Note: we use C++, but you can do this in java and LabView also, look at the bottom of this post for the format The robot side files are ZDashboard.h and cpp, copy them into your project and add at the top of the main file #include "ZDashboard.h" in your code, create a ZDashboard object , and initialize it. Code:
class RobotDemo:public SimpleRobotCode:
//...Some notes: THIS IS BETA!!! I am still working on bugs, the least tested feature is the VarValue control and the var and AddDebugVariable functions. please report any bugs the .Net controls features are in the .Cat group. most have Max, Min, and Value. DataGraphs cannot have a Min less that 0 Taco is pure fun To see what each control does, open the test project (run it), click on a control, and move the slider at the top (EDIT: direction and analog meter barely move). onoff and spike are click state change, the thing in the lower right corner is a drag and drop sample, not related to create a new Dashboard, make a new project, Reference System451.Communications.Dashboard.dll (in dash/System451.Communication.Dashboard/bin/Release folder), build the project. the controls will appear at the top of the toolbox, they are drag and drop. add 1 dashboardDataHub control. in the constructor (or a start button) add this code Code:
dashboardDataHub1.AddDashboardControl(YourControls);the Format of the strings, which can be Printf'd from the Dashboard class is @@@451:|controlname=value|name=value|:451@@@ |
Re: ZomB: a C# Drag and Drop Dashboard
Looks shiny. I wrote some old-school looking analog meter controls for C# a few years ago, you might find it useful to use with your dashboard.
http://www.virtualroadside.com/blog/...for-c-and-net/ |
Re: ZomB: a C# Drag and Drop Dashboard
1 Attachment(s)
I added a camera feed to this today, complements of the dashboard here: http://www.chiefdelphi.com/forums/sh...ad.php?t=82422 . It still uses .net 2, so no need to update!
I have some bug fixes that I will post tommorow (some not on this computer), so for now, here is the CS files, and the dll |
Re: ZomB: a C# Drag and Drop Dashboard
1 Attachment(s)
Here's the latest version, I would create a new project that references the dll, and add stuff like my original post explains, as the DefaultDash is a bit of a mess.
Changes from initial release: Fixed multithreading bugs Added CameraView Added CSV DataSaver |
Re: ZomB: a C# Drag and Drop Dashboard
Can I use this with Java?
|
Re: ZomB: a C# Drag and Drop Dashboard
EDIT: Java port posted at post #8
yes, I have not had a chance to port the robot side code (ZDashboard.cpp) yet, but it uses WPILib (and therefore also works with WPILibJ). (functions may be slightly different for java, I am not a java expert (yet)) Instead of making a ZDashboard object, make a Dashboard object from Driverstation.GetInstance().GetHighPriorityDashboa rdPacker() then, at the beginning of your code, create a string, and (either immediatly or when the value has been calculated) then assign it a string in the format of @@@451:|controlname=value|name=value|:451@@@ when you have built the string, use the dashboard object to Printf it example: Code:
string prints = "@@@451:|";I will try to make a Java version of ZDashboard by this Friday. If you have any other questions, please ask |
Re: ZomB: a C# Drag and Drop Dashboard
1 Attachment(s)
minor bug fix: mono compatible (not tested, but MoMA say's looks good)
|
Re: ZomB: a C# Drag and Drop Dashboard
1 Attachment(s)
Got a Java port, just add the attached ZDashboard.java to your project.
Code:
import edu.wpi.first.wpilibj.SimpleRobot; |
Re: ZomB: a C# Drag and Drop Dashboard
Thanks! it will work for our purposes :D
|
Re: ZomB: a C# Drag and Drop Dashboard
It wOnt compile, it says th dashboard packer is bad and so is the send function
edit: The java library wont compile, it says getDashBoardPacker and send are bad calls |
Re: ZomB: a C# Drag and Drop Dashboard
1 Attachment(s)
Quote:
Here it is fixed |
Re: ZomB: a C# Drag and Drop Dashboard
It says that the string is too long
|
Re: ZomB: a C# Drag and Drop Dashboard
1 Attachment(s)
Quote:
IMPORTANT UPDATE! - V0.3 This fixes a few bugs that were fixed with the Camera update, and lost with the mono fix (and adds the fixes to a few other new controls) This also fixes the default Dashboard. Adds configurable IP address for the camera, so you can actually see YOUR camera! added some camera target options - send widthxheigth+x,y to target (ZomB.Add("Target","400x300+5,5");) added Restart to camera Added virtuald's AnalogMeter (VirtualdAnalogMeter) I will probably have some more detailed documentation and how-to's out by Friday Features that are coming: Soon: TCP instead of dashboard, but fallback available virtuald's oscilliscope Before week 6: message splitting a few more controls eventually: re-write of data hub for many params better designer support VS-less design mode (like slavik262's dashboard) |
Re: ZomB: a C# Drag and Drop Dashboard
i just tried to send a motor value to the dashboard.
|
Re: ZomB: a C# Drag and Drop Dashboard
Quote:
also make sure you are not sending every loop, you don't want to overload the dashboard (50Hz) assuming you are running ZB on a different laptop, go to the driverstation setup tab, click on remote dashboard and enter the other laptop's IP |
Re: ZomB: a C# Drag and Drop Dashboard
I have put this on WPI FIRST Forge: http://firstforge.wpi.edu/sf/projects/zombdashboard
the next version will be coming soon (need to test one feature and finish another) |
Re: ZomB: a C# Drag and Drop Dashboard
Version 0.4 has been released on FIRST Forge: http://firstforge.wpi.edu/sf/go/page1029
|
Re: ZomB: a C# Drag and Drop Dashboard
1 Attachment(s)
ZomB Version 0.5 Released!
http://firstforge.wpi.edu/sf/sfmain/....zombdashboard This version contains numerous new features and bug fixes Notable new features
Multiple bugs were fixed, you can read the release notes at http://firstforge.wpi.edu/sf/wiki/do...eleaseNotes0.5 Download Everything - http://firstforge.wpi.edu/sf/frs/do/...able.v0_5?dl=1 Just ZomB Dashboard - http://firstforge.wpi.edu/sf/frs/do/...5/frs1115?dl=1 C++ Bindings - http://firstforge.wpi.edu/sf/frs/do/...5/frs1117?dl=1 Java Bindings - http://firstforge.wpi.edu/sf/frs/do/...5/frs1116?dl=1 Need Help? Post on First Forge or here if you need help setting ZomB up, or you are having troubles with it. I will try to answer all questions as soon as possible http://firstforge.wpi.edu/sf/discuss...iscussion.help |
Re: ZomB: a C# Drag and Drop Dashboard
just to check, you can use ZomB with just m$ C# express 2008?
|
Re: ZomB: a C# Drag and Drop Dashboard
Posting from a teammate's account here...
Anyway, I'm trying to use zomB, but I can't get the default zomB dashboard to update at all. For testing purposes I'm just trying to feed a value of 0.5 to grph and -0.5 to grph2 and nothing is coming up. I'm using Java. Yes, I've declared and instantiated a ZDashboard object (named zomB), and the zomB.Add()s and .Send() are in the teleop loop method. The dashboard is set to our team number and the driverstation is of course properly configured for our team. |
Re: ZomB: a C# Drag and Drop Dashboard
Quote:
Quote:
the team number box on the dashboard is for the camera (so it shouldn't have any affect) are you running ZomB on the classmate (if so what account) or on a remote computer? your code looks like this correct? Code:
void operatorControl() |
Re: ZomB: a C# Drag and Drop Dashboard
Well, rather than being a while loop for teleop, it's a method named teleperiodic that is looped while the DS is in teleop mode. Should be the same, right? Other than that the code does look the same.
And yes, it's on the Classmate. As for the 0.5 value being on a line, I also tried feeding the left joystick's Y value to the graph, and nothing showed up either when I tested that. |
Re: ZomB: a C# Drag and Drop Dashboard
Quote:
Quote:
|
Re: ZomB: a C# Drag and Drop Dashboard
Yes, local dashboard is checked.
|
Re: ZomB: a C# Drag and Drop Dashboard
1 Attachment(s)
Hmm, try the attached (put it all in C:\Program files\FRC Dashboard), and hit the start button near the bottom right.
also, try sending the string value (zomB.Add("grph", "0.5");) if that does not work, download and install Visual Studio C# express 2008 from (http://www.microsoft.com/express/Dow...2008-Visual-CS) |
Re: ZomB: a C# Drag and Drop Dashboard
Still nothing on the graphs. I also tried using sw1 and sw2 and they aren't responding either. Visual Studio is installing right now.
|
Re: ZomB: a C# Drag and Drop Dashboard
Ok, while you're at it, install wireshark (http://www.wireshark.org/download.html), and make sure that the packets have the right data:
(do this while the robot is running, and sending "data") open wireshark go to Capture>Interfaces... select your interface (wait to see the one that has incoming packets) by hitting the start next to it in the Filter text box enter udp.dstport == 1165 and click apply after some packets have come in, click one, and make sure it contains (look at the bottom box) @@@451:|grph=0.5|... (or something similar) if you see this, you are good, and can close wireshark. if not, report back (and you can close wireshark for the moment) |
Re: ZomB: a C# Drag and Drop Dashboard
I'll see what I can do, but we had to pack up everything we could today for the trip down to Atlanta. I might be able to unbox the electrical board on Monday and work on it for a while though. Otherwise I'll have to try this in the pits on Wednesday...
|
Re: ZomB: a C# Drag and Drop Dashboard
actually, I might have just found the problem.
the first thing I want you to do is open ZDashboard.java, and find the line (near the bottom) that says dash.addString(prints + ":451@@@"); add dash.commit(); just after that. the end of the file will look like this: Code:
... |
Re: ZomB: a C# Drag and Drop Dashboard
@Azores: did you try it? did it work?
|
Re: ZomB: a C# Drag and Drop Dashboard
Sorry for not checking back in so long :D
Anyway I didn't get any time to test anything out before packing up for Atlanta, and once we got there I really didn't have the time to be testing out the Dashboard :rolleyes:. But, our robot is on its way back to us, so once it gets in I'll be testing ZomB out, and hopefully we'll get to use it for next year! |
Re: ZomB: a C# Drag and Drop Dashboard
Good news, everyone! [/Farnsworth]
Finally got time to try and put ZomB back together. I now have the ZomB Dashboard reading data properly - graphs are giving me the values I want, switches are responding how they should - but it's very, very slow. Slow enough that the "Elapsed Time" counter in the Driver Station isn't counting consistently. I have the ZomB dashboard set to only update once every thousand CPU cycles right now - should it be a larger number? Also, I remember reading this before but can't figure it out now, how do I have the Driver Station open the ZomB Dash by default? As it is the default NI/FRC dash opens when Driver Station is run (either by logging in to Driver or running it from Developer). I've replaced Dashboard.exe in C:\Program Files\FRC Dashboard with the ZomB Dashboard but the default one still opens instead. And I've replaced it and tried both leaving the ZomB dashboard named DefaultDash.exe and Dashboard.exe and either way the default opens instead. I thought I read something about changing a .ini or .txt file but I can't find which file that is now. Update: Had to leave the shop at 6:00 today so I didn't get to do too much more testing, but besides being slow, the dashboard also rarely has camera feed (at all, it isn't just slow, it's just not there, or it will show a frozen frame). Still haven't figured out how to have ZomB open as the default dashboard. But I also noticed today that we're having the Watchdog Not Fed error again, which I had solved before our first regional. Not sure why it came back up between the robot leaving Atlanta and arriving here, so I'll have to take a look at the Classmate tomorrow and see what could be causing that (last time the solution was to change the power management settings and some stuff in the BIOS to do with power management and CPU speed). I think it's very possible that the camera not feeding, the slow performance and the Watchdog error might all have a common source. But other than that, ZomB is working fine now. I have spk1, spk2, sw1 and sw2 showing solenoid statuses for testing purposes, and grph1 and grph2 showing joystick Y values, "right" showing whether our compressor is running, "go" showing which mode autonomous is set to... and everything is behaving relatively properly :D. |
Re: ZomB: a C# Drag and Drop Dashboard
To change the dashboard: There is a .ini file in one of the User folders (will say DS or Driver Station I think). In it there is a key that points to the normal Dashboard. Just change that and it should open your's. Also, make sure you have protections against multiple instances opening of your dashboard (for some reason the DS opens Dashboard twice)
|
Re: ZomB: a C# Drag and Drop Dashboard
Yea, I read about the anti-multi-instance-Dashboard solutions and I'll be sure to do that as well.
So in one of the User folders, as in under My Documents? I don't have the Classmate available to me right now so I can't go exploring for it :p |
Re: ZomB: a C# Drag and Drop Dashboard
The ZomB has automatic instance protection
Renaming the DefaultDash.exe to Dashboard.exe and putting it in the C:\Program files\FRC Dashboard\ folder did the trick for us, you might want to move the first dashboard out, and then put the ZomB in. As for the slowness, was it slow with updating the graphs/controls? (ie. push a button, wait a second, shows up) or just with mouse/keyboard feedback (ie. move mouse over button, wait one second, ui cues show up) I have noticed the mouse/keyboard feedback lag increases in driver mode for both the ZomB and the DS by about 1 second every 3 hours, which needs a full reboot to cure. (I don't think it took you 3 hours, but you still might have this problem) for the delay (on the robot side) if you are just testing, use Thread.Sleep(20) to get maximum throughput Code:
while(istelop())//?Code:
Timer t(also make sure you have a camera instance in your code) You say it worked with the dash.commit() line? EDIT: BTW, have you seen the awesomeness of the taco yet? (its a -1 to 1 float value) (full documentation on its awesomeness: http://firstforge.wpi.edu/sf/wiki/do...wiki/TacoMeter) |
Re: ZomB: a C# Drag and Drop Dashboard
It was slow as in the Dashboard had a lag to it - for example the spk and sw indicators that I set to show solenoid statuses would be a few seconds delayed in showing the status changes. The UI cues though came up quickly enough.
I found the .ini file and edited the line pointing to the Dashboard and it now opens ZomB by default, so that problem is solved. I'm just about to put in the timer to update ZomB now, I'll edit this post later after I get to test it. EDIT: Oh, and yes I believe it was dash.commit(); that fixed it. I don't recall making any other changes before it started working. And I haven't tried using the Tacometer yet, but I'll find a use for it :p |
Re: ZomB: a C# Drag and Drop Dashboard
The only things that I can think of that would be causing the delay would be network traffic, or (kinda doubt it) slowness in sending the data. I know running at comps and wired and wireless at home I have seen little delay. Not sure what your issue is though
|
Re: ZomB: a C# Drag and Drop Dashboard
Yea it's weird, the lag only showed up after we got back from ATL, so I'm trying to figure out what's happening. It's more pronounced when running ZomB it seems but it's still present when running the default Dashboard. We ran a disk cleanup and defrag today though as well as removing some less necessary programs we had installed, so perhaps that will help it out. We also reformatted and reimaged the cRIO. If all that doesn't help then I won't know what to do next :D.
Oh, and I don't think it's network issues, because I'm doing these tests through tethered ethernet haha. |
Re: ZomB: a C# Drag and Drop Dashboard
You may want to open the Task manager and see what the CPU load is ... both when running the DS and DB, and when running nothing. I've sometimes seen the classmate successfully connect to the wireless network and the update programs phone home and try to determine which virus scanner, OS patch, etc are needed. The task manager should show what the computer is up to.
Greg McKaskle |
Re: ZomB: a C# Drag and Drop Dashboard
CPU load seemed normal and I didn't note any unfamiliar running processes when I checked, but then again I wasn't constantly monitoring it... if the lag hasn't been resolved tomorrow morning I'll take a look at that too of course. Thanks.
|
| All times are GMT -5. The time now is 21:33. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi