Go to Post I knew you guys were really smokin' at Championships. I just didn't realize how much! - Mark McLeod [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 20-01-2014, 19:00
cad321 cad321 is offline
Jack of all trades, Master of none
AKA: Brian Wagg
FRC #2386 (Trojans)
Team Role: Alumni
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Burlington, Ontario
Posts: 318
cad321 is just really nicecad321 is just really nicecad321 is just really nicecad321 is just really nice
sending variables from driver station to robot?

I have been experimenting with some PID loops for our drive this year and want to be able change the setpoint and/or the p, i and d values from the driver station instead of having to upload new code each time. I have been able to figure out how to use the send-able chooser but that only allows me to choose preset things like an autonomous chooser. How might I go about being able to change these variables on the smart dashboard? Btw I am using Java and am currently coding using the iterative robot template.
Reply With Quote
  #2   Spotlight this post!  
Unread 20-01-2014, 19:10
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,543
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: sending variables from driver station to robot?

In general, you can call SmartDashboard.putNumber in an init method (so that it gets loaded on the SmartDashboard), and then call SmartDashboard.getNumber to read the current value on the Smart Dashboard.

If you are using the PIDController class, there is already a PID widget on Smart Dashobard that lets you change P, I, and D, and the setpoint. You can add the PIDController as an actuator with LiveWindow, and test whatever you want.

See:
http://wpilib.screenstepslive.com/s/...ewindow-values
http://wpilib.screenstepslive.com/s/...smartdashboard
Reply With Quote
  #3   Spotlight this post!  
Unread 20-01-2014, 21:00
SuperBK's Avatar
SuperBK SuperBK is offline
Registered User
AKA: BrianK
FRC #1225 (Amperage Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Henersonville, NC
Posts: 357
SuperBK is just really niceSuperBK is just really niceSuperBK is just really niceSuperBK is just really nice
Re: sending variables from driver station to robot?

How about using the virtual inputs on the driver's IO tab station? I used them a few years ago for tuning a PID loop. After I had good values, I hard coded them so they couldn't be changed.
__________________
Brian K
Team 1225 Robotics Mentor
Reply With Quote
  #4   Spotlight this post!  
Unread 20-01-2014, 21:40
cad321 cad321 is offline
Jack of all trades, Master of none
AKA: Brian Wagg
FRC #2386 (Trojans)
Team Role: Alumni
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Burlington, Ontario
Posts: 318
cad321 is just really nicecad321 is just really nicecad321 is just really nicecad321 is just really nice
Re: sending variables from driver station to robot?

Quote:
Originally Posted by SuperBK View Post
How about using the virtual inputs on the driver's IO tab station? I used them a few years ago for tuning a PID loop. After I had good values, I hard coded them so they couldn't be changed.
How might I go about using these? I have known about them for a little while but have no idea how to program them. Would it just be like an if statement where if virtual_joystick button 1 = true, then...
Reply With Quote
  #5   Spotlight this post!  
Unread 02-03-2014, 17:36
James Lightfoot James Lightfoot is offline
Programming & Electrical Mentor
FRC #3737 (Rotoraptors)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Wayne County, NC
Posts: 21
James Lightfoot is just really niceJames Lightfoot is just really niceJames Lightfoot is just really niceJames Lightfoot is just really niceJames Lightfoot is just really nice
Re: sending variables from driver station to robot?

Quote:
Originally Posted by Joe Ross View Post
In general, you can call SmartDashboard.putNumber in an init method (so that it gets loaded on the SmartDashboard), and then call SmartDashboard.getNumber to read the current value on the Smart Dashboard.

If you are using the PIDController class, there is already a PID widget on Smart Dashobard that lets you change P, I, and D, and the setpoint. You can add the PIDController as an actuator with LiveWindow, and test whatever you want.

See:
http://wpilib.screenstepslive.com/s/...ewindow-values
http://wpilib.screenstepslive.com/s/...smartdashboard
Please pardon me if my question seams redundant.

We are using Java for our cRIO and the Java version of the Smart Dashboard. How can we have an operator/driver enter number values
in the Smart Dashboard (or other software interface) and have them "pushed" to the cRIO as values to use in certain parts of the code?

For example, we have an ultrasonic sensor that feeds the cRIO an analog signal based on how far the sensor is from the wall (front mount). We know that we need our robot to be 7'/84" from the wall to shoot for and make the high goal. In autonomous, I would like to have the ability for the driver to enter that value in the driver station and have it passed to that filed in the autonomous code to allow on site tweaking w/o having to do multiple downloads to the cRIO.

Thanks.
Reply With Quote
Reply


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 17:16.

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