Go to Post There is no offseason. - Jeff Rodriguez [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 15-04-2013, 11:16
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Using Processing for custom dashboard

Hello! I'm asking this question on behalf of a few of my colleagues whose area of expertise is in the language Processing. They're fantastic programmers, and can make any GUI you can imagine. I believe it's a highly object-oriented dialect of Java (I don't program with it myself, so I'm not sure), and apparently there are libraries you can import to compile it as regular Java. Our actual robot is programmed in C++, and we've never used network tables before. Is it possible to construct a dashboard that can send data to and from the robot using Processing? Thanks!
  #2   Spotlight this post!  
Unread 15-04-2013, 11:26
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Using Processing for custom dashboard

Why not just use Smartdashboard?
__________________
All opinions are my own.
  #3   Spotlight this post!  
Unread 15-04-2013, 12:47
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,102
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Using Processing for custom dashboard

If you want to use Java, just extract the NetworkTables bindings from SmartDashboard. They have a separate jar file available that has them. The JAR is also distributed with the C++ stuff, look in C:\WindRiver\WPILib\desktop-lib

We did our custom dashboard in python, also using NetworkTables.

As long as both sides are using a common communication mechanism (like NetworkTables), it doesn't matter what language either side is written in.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #4   Spotlight this post!  
Unread 15-04-2013, 15:22
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Using Processing for custom dashboard

Quote:
Originally Posted by joelg236 View Post
Why not just use Smartdashboard?
Like I said, we're not sure what we're doing, but if we could use Processing, everything would be perfect.
Quote:
We did our custom dashboard in python, also using NetworkTables.
You're kind of the team that inspired us to make a custom dashboard.... Would we simply extract the NetworkTables Jar file into an eclipse workspace and add "some code" to send and receive values on the dashboard and robot-side programs?
  #5   Spotlight this post!  
Unread 15-04-2013, 18:00
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,102
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Using Processing for custom dashboard

Quote:
Originally Posted by ekapalka View Post
Would we simply extract the NetworkTables Jar file into an eclipse workspace and add "some code" to send and receive values on the dashboard and robot-side programs?
Yup.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #6   Spotlight this post!  
Unread 15-04-2013, 18:47
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Using Processing for custom dashboard

Can you inform me of somewhere I could go to learn? Thanks, by the way
  #7   Spotlight this post!  
Unread 15-04-2013, 18:52
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,600
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Using Processing for custom dashboard

This document covers getting the client (ie dashboard) side of network tables running in netbeans. http://wpilib.screenstepslive.com/s/...client-pc-side
  #8   Spotlight this post!  
Unread 18-04-2013, 13:12
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Using Processing for custom dashboard

Network tables seem fairly straightforward from the example on that page. I was wondering if there is much lag/delay between sending and receiving information. We would like to send information from the keyboard to a Motor controller, which I believe has to be updated once every 10ms or so... so that's a lot of information. Do we need to add delay (such as a wait statement or state machine) to both sides of the code or should it be okay to just attempt to send data back and forth in real-time? Also, should we create separate network tables for input and output communication? Thanks!
  #9   Spotlight this post!  
Unread 18-04-2013, 13:39
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,102
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Using Processing for custom dashboard

Quote:
Originally Posted by ekapalka View Post
We would like to send information from the keyboard to a Motor controller, which I believe has to be updated once every 10ms or so... so that's a lot of information. Do we need to add delay (such as a wait statement or state machine) to both sides of the code or should it be okay to just attempt to send data back and forth in real-time?
Even the joysticks for the driver station aren't updated enough to be used in latencies less than 100ms if that's what you care about. Chances are, that isn't really what you care about, and so the latency is low enough that you won't notice it. But the NetworkTables lag could easily be in the 100ms range or higher.

Quote:
Also, should we create separate network tables for input and output communication? Thanks!
You should use different elements in the table, but no need to create separate tables. What we've traditionally done is just used the 'SmartDashboard' table, that way we can use all of the SmartDashboard infrastructure on the robot side and use the SmartDashboard itself.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #10   Spotlight this post!  
Unread 18-04-2013, 14:29
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,722
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: Using Processing for custom dashboard

We use raw Java on the display and custom network code to get custom packets from the cRIO. The data structure is 200 bytes, and contains every input, sensor, motor output, pneumatic state, and vision targeting parameter we have. Then we use Java reflection to open up the data structure and print it on the screen in a panel for quick debugging -- reflection avoids the need to update the data printer every time the software kids need the data structure change to change. We found that using custom packets is less processing and bandwidth-intensive than the Network Tables since we can control the data rate directly. The display also stores the data to file in a .CSV format for quick telemetry analysis post-match. Avoiding Network Tables also avoids "heavy weight" library dependencies, which has bitten us in the past when we've swapped laptops around.

The kids wrote some code around the data structure for a GUI. We may do touch-screen next year, but not at the expense of our current goals (plus a physical button board is better for the offseason stuff we do).

Our software goals for the display are more along the lines of quick integration debugging, sensor tuning, & match replay rather than live match control. Our drivers rarely take their eyes off the field.

I've never heard of "Processing" until now. Will have to look that one up.
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub

Last edited by JesseK : 18-04-2013 at 14:43.
  #11   Spotlight this post!  
Unread 18-04-2013, 14:51
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Using Processing for custom dashboard

Thanks everyone! Hypothetically, we now have all the knowledge to make a custom GUI than except the camera display (just the display, not vision processing. Eventually, we'll do that on-board). I believe there's a lot of stuff in WPI for that. Would we have to set up an entire robot project (configured and everything as if we were actually controlling the robot with it) to utilize that or just import it like we did with NetworkTables?
  #12   Spotlight this post!  
Unread 18-04-2013, 18:52
mman1506's Avatar
mman1506 mman1506 is offline
Hater of Tiny Molex Connectors
AKA: Marcus Quintilian
no team (WARP7)
Team Role: Alumni
 
Join Date: Mar 2012
Rookie Year: 2012
Location: Toronto
Posts: 808
mman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond reputemman1506 has a reputation beyond repute
Re: Using Processing for custom dashboard

If you do this please document it. I really like the processing language.
__________________
2014-2015: FRC 865 Warp7 Team Captain
2016: FRC 865 Mentor

2017: Free Agent Mentor, Inspector
  #13   Spotlight this post!  
Unread 21-04-2013, 15:17
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Using Processing for custom dashboard

So can images be transferred via network tables, too?
  #14   Spotlight this post!  
Unread 21-04-2013, 15:32
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Using Processing for custom dashboard

I wouldn't transfer images in network tables. You could technically do some small ones, but why not do it more efficiently. As for the latency of network tables. The variables are written into the local table rather quickly, like in a millisecond or so. The update rate is used to determine how often modified values are replicated to other clients. This value varies by language, and the LV default is 100ms. If you wire up a different number, it will have a bit more overhead, but less latency. The other option is to call flush yourself, to force the update when something interesting happened, like you finished processing an image.

Other than the delayed updates, there shouldn't be much more latency than straight TCP communications.

Greg McKaskle
  #15   Spotlight this post!  
Unread 21-04-2013, 16:33
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Using Processing for custom dashboard

How exactly does that work? I've been looking everywhere on socket communication (which might be what you're talking about) to transmit mid-high resolution images at a high frame rate in real time. As of yet, we're not planning on doing any vision processing; just a GUI.
Closed Thread


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 03:26.

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