|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
|||
|
|||
|
Re: Changing parameters on the fly?
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...
|
|
#17
|
||||
|
||||
|
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. |
|
#18
|
||||
|
||||
|
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 |
|
#19
|
||||
|
||||
|
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 |
|
#20
|
||||
|
||||
|
Re: Changing parameters on the fly?
You can always declare a driver station object and make use of the GetAnalogIn which has four inputs.
|
|
#21
|
|||
|
|||
|
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. |
|
#22
|
||||
|
||||
|
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 |
|
#23
|
||||
|
||||
|
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. ![]() |
|
#24
|
|||
|
|||
|
Re: Changing parameters on the fly?
Quote:
http://firstforge.wpi.edu/sf/tracker....wpilib_c_bugs Thanks, -Joe |
|
#25
|
||||
|
||||
|
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.
|
|
#26
|
||||
|
||||
|
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:
|
|
#27
|
|||
|
|||
|
Re: Changing parameters on the fly?
Quote:
![]() 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 ) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|