Go to Post This thread is going to make me spend my entire tax return on multitools. - Lil' Lavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 28-02-2012, 11:33
mbram mbram is offline
Registered User
FRC #3502
 
Join Date: Jan 2011
Location: Florida
Posts: 11
mbram is an unknown quantity at this point
Re: Changing parameters on the fly?

Quote:
Originally Posted by bob.wolff68 View Post
1) You **MUST** use the smartdashboard app on a separate computer due to the fact that hitting ENTER will disable the robot.
Is there any other way to do this without having to have a second computer? It would not be ideal to have to laptops running at the operator's console...
Reply With Quote
  #17   Spotlight this post!  
Unread 01-03-2012, 18:14
ericand's Avatar
ericand ericand is offline
Registered User
AKA: Eric Anderson
FRC #3765 (Terrabots)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: St. Paul, MN
Posts: 148
ericand is a jewel in the roughericand is a jewel in the roughericand is a jewel in the rough
Re: Changing parameters on the fly?

It is possible to save data to a text file on the cRIO,
and to read it back. Team 1425 has done this in the past.
Having a robot ability to update tunable parameters without firing
up WindRiver workbench is a great time saver.

This works wonders when you need to calibrate some component that is
likely to get adjusted during normal maintenance and repair during
competition.

I'm currently trying to get the team I'm working with in MN (3765)
to recreate this.

The neat thing about creating ascii based files is that you can use external tools to view them.

Last night I was showing the team how you can use the robot's built in FTP server to look at the file system on the cRIO. We looked at the system install files and noted the changes and deletions that happen when code is deployed and undeployed from workbench. We also used the ftp server to create a team data directory on the robot as a location to create our persistent data files.

On a PC that is connected to your team's robot, you can use ftp to browse the robot's file system by opening a web browser and using the URL:

ftp://10.XX.YY.2/
10.XX.YY.2 being the standard FIRST defined IP address for your robot.
Note that the protocol part of the URL is ftp - not http like you see during
regular web browsing.

This will give you a file listing of the root of the robot file system, and you can browse down into the various sub-directories.

The web browser is a good place to start since it gives a read-only view of the file system. You want to be sure that you don't modify any of the existing files there, without fully understanding the consequences.
Reply With Quote
  #18   Spotlight this post!  
Unread 01-03-2012, 22:32
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Changing parameters on the fly?

We ftp text files to the robot and read them all the time. Our autonomous behavior is implemented with a special script language.

HTH
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #19   Spotlight this post!  
Unread 02-03-2012, 19:19
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 157
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Changing parameters on the fly?

I will be working this weekend on doing a non-2nd-laptop SmartDashboard text-input experiment which you could try yourself if you're so inclined...

Basically, it is my understanding that the text box is "filled" and noted as such when you tab away or change focus, but the "GetString()" call doesn't notice it yet. So, I'm thinking that if we put a BUTTON on the screen which says "Commit Changes", that possibly in that function, we can do the GetString() and maybe get the changed values back out.

We'll see...

bob
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote
  #20   Spotlight this post!  
Unread 02-03-2012, 22:57
eaglesfan51520's Avatar
eaglesfan51520 eaglesfan51520 is offline
Lead Programming Mentor
AKA: Steve
FRC #1687
Team Role: Mentor
 
Join Date: Mar 2011
Rookie Year: 2009
Location: US
Posts: 15
eaglesfan51520 is an unknown quantity at this point
Re: Changing parameters on the fly?

You can always declare a driver station object and make use of the GetAnalogIn which has four inputs.
Reply With Quote
  #21   Spotlight this post!  
Unread 04-03-2012, 15:03
pafwl pafwl is offline
Franciose
AKA: Frank Larkin
FRC #0272 (Cyber Crusaders)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 1998
Location: Lansdale, Pennsylvania
Posts: 108
pafwl has much to be proud ofpafwl has much to be proud ofpafwl has much to be proud ofpafwl has much to be proud ofpafwl has much to be proud ofpafwl has much to be proud ofpafwl has much to be proud ofpafwl has much to be proud ofpafwl has much to be proud ofpafwl has much to be proud of
Re: Changing parameters on the fly?

We do this all the time. We have many variables that we can adjust all the time.
you can see the code as part of our 2010 code.

http://www.frc272.com/seminar/Archive/.

We call the LCConfig.cpp. You can change the config file, save it via FTP to the Crio, press a button and have it read in to the running code then have it apply the new settings. Once you like them leave it there. The config is read in when we boot up. Very flexible.
Reply With Quote
  #22   Spotlight this post!  
Unread 05-03-2012, 02:31
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 157
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Changing parameters on the fly?

Well - we gave a shot at the interactive input on SmartDashboard with no luck. It all works on a separate computer as we've all noted, but otherwise...sigh. We tried to also put a button on the SmartDashboard so we could interactively click on the button ... no go...

So, SmartDashboard::GetInstance()->GetDouble() doesn't work... so we use GetString() and then sscanf() to turn it into a double.

Also, using Preferences::GetInstance()->PutString() doesn't work, but PutDouble() and PutInt() work just fine.

bob
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote
  #23   Spotlight this post!  
Unread 05-03-2012, 13:28
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,050
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: Changing parameters on the fly?

You should check out the SendablePIDController, which is part of the SmartDashboard. I'm not sure if it works in C++ because of the double issue... but it works for me in python

And, before there was SmartDashboard, there was WebDMA, which does the same thing as SmartDashboard except with a webserver on your robot.
__________________
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
Reply With Quote
  #24   Spotlight this post!  
Unread 06-03-2012, 01:46
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Changing parameters on the fly?

Quote:
Originally Posted by bob.wolff68 View Post
Well - we gave a shot at the interactive input on SmartDashboard with no luck. It all works on a separate computer as we've all noted, but otherwise...sigh. We tried to also put a button on the SmartDashboard so we could interactively click on the button ... no go...

So, SmartDashboard::GetInstance()->GetDouble() doesn't work... so we use GetString() and then sscanf() to turn it into a double.

Also, using Preferences::GetInstance()->PutString() doesn't work, but PutDouble() and PutInt() work just fine.

bob
Have you filed trackers for these issues? If they aren't tracked we don't know about them and are less likely to fix them.

http://firstforge.wpi.edu/sf/tracker....wpilib_c_bugs

Thanks,
-Joe
Reply With Quote
  #25   Spotlight this post!  
Unread 10-03-2012, 19:34
garyk garyk is offline
Programming Mentor: 668, 972, 2643
FRC #0668 (Apes of Wrath)
Team Role: Mentor
 
Join Date: Dec 2006
Rookie Year: 2005
Location: Santa Clara (Silicon Valley) Calif.
Posts: 89
garyk is a jewel in the roughgaryk is a jewel in the roughgaryk is a jewel in the roughgaryk is a jewel in the rough
Re: Changing parameters on the fly?

We code joystick->GetZ() to use the "throttle" input roller to return a float in the range -1.0 to 1.0 inclusive. One can then tune with several joysticks while observing the the behaviour of the 'bot. Or fine-tune by dividing the z axis value by 10.0, etc.
__________________

Silicon Valley Regional 2005, 2006 972
Silicon Valley Regional 2007 668 Xerox Creativity Award
Championship Event 2007 668
Portland Regional 2008 668
Silicon Valley Regional 2008 668, 972
Beta Test Team 2008 668 (with 100 & 254)
Silicon Valley Regional 2009 668 Regional Chairman's Award; 2643
Sacramento Regional 2009 668 Winning Alliance (thanks, 1717 & 2473!), 2010 Winning Alliance 3256
CalGames 2006, 2007, 2008, 2009, 2010, 2011 Field Tech
NorCal FTC Regional 2008, 2009 Inspector
Championship Event 2009
San Diego, Silicon Valley Regionals; Champ. Event 2010 668, 2643, 3256
Silicon Valley, Madera Regional 2012 2643
WRRF Programming Instructor 2006-2016
Regional Woodie Flowers Award 2014 2643 Utah Regional

Reply With Quote
  #26   Spotlight this post!  
Unread 12-03-2012, 12:58
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 157
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Changing parameters on the fly?

Joe,
Thanks for the link to the trackers -- I filed 3 for:
- SmartDashboard::GetDouble() doesn't work for interactive data.
- Preferences:utString() doesn't work at all
- SmartDashboard:utInt() graphs/logs an incorrect (huge) value once in a blue moon causing graphs to become unreadable until the errant data-point scrolls off the graph.

Bob Wolff

Quote:
Originally Posted by jhersh View Post
Have you filed trackers for these issues? If they aren't tracked we don't know about them and are less likely to fix them.

http://firstforge.wpi.edu/sf/tracker....wpilib_c_bugs

Thanks,
-Joe
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote
  #27   Spotlight this post!  
Unread 15-03-2012, 11:15
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Changing parameters on the fly?

Quote:
Originally Posted by eaglesfan51520 View Post
You can always declare a driver station object and make use of the GetAnalogIn which has four inputs.
I just noticed the analog and digital inputs in the driver station last night, wasn't quite sure if they did what I thought they did

Seems like a more smooth way of tuning these things, I'll have to give it a try (we wound up swapping our tires which messed with all the PIDs )
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 12:38.

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