Go to Post The energy source of the future is brain power. - Michael R. Lee [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-07-2014, 01:04
zinthorne's Avatar
zinthorne zinthorne is offline
Registered User
AKA: Avery
FRC #5827 (Code Purple)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Seattle
Posts: 139
zinthorne will become famous soon enough
Hypothetical auto proggraming method

I am not a programmer, so I was wondering if the idea I had would even be plausible or worthwhile. In many video games the cpu will record your key presses and other various actions you make with a d-pad. Example the Fifa soccer app can replay what you just did on the game and show what motions you did with your finger on the screen. Forza 3 also has the capability of when you are using a racing wheel and pedal set to replay what you did on screen, and move the steering wheels accordingly to what you did.
This leads me to the idea:
Have a driver drive the autonomous mode on the practice field. While he is doing this, record the key presses and d-pad movements. Then the programming team for could write a program that just sends the 10 seconds of commands that the driver did to the robot for the autonomous. It would be a quick way to make a deadly autonomous.
I think this could lead to so many more variations for autonomous if it actually worked.

Is it actually possible for this to be done? I am not a programmer so I would assume that this would take a lot of programming to actually make it work. Being a driver myself and having to set up for autonomous it would be great to be able to just go spend a minute on the practice field and fix the autonomous between matches if it doesn't work.
Reply With Quote
  #2   Spotlight this post!  
Unread 10-07-2014, 01:12
faust1706's Avatar
faust1706 faust1706 is offline
Registered User
FRC #1706 (Ratchet Rockers)
Team Role: College Student
 
Join Date: Apr 2012
Rookie Year: 2011
Location: St Louis
Posts: 498
faust1706 is infamous around these partsfaust1706 is infamous around these parts
Re: Hypothetical auto proggraming method

That is actually a brilliant idea and it is possible.

You'd have to devise a method for recording what buttons (and joystick positions) are pressed and for how long, then find a way to read that in order during autonomous.

This could be as simple as saving everything to a logfile(like an excel file) and having the first column be time, the second column be if a was pressed (1 or zero) 2nd be b, 3rd could be y position of a joystick.

This is a brilliant idea.
__________________
"You're a gentleman," they used to say to him. "You shouldn't have gone murdering people with a hatchet; that's no occupation for a gentleman."
Reply With Quote
  #3   Spotlight this post!  
Unread 10-07-2014, 01:20
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 800
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: Hypothetical auto proggraming method

While this sounds great in theory, robots don't do the same thing twice without software support.

For example, different batteries have different internal resistances and hold different charges, resulting in different amounts of power being supplied to the wheels. This results in them responding differently.

When you drive a robot, as the tread and carpet wear, it responds differently when turning, and will coast different amounts when power is cut.

Different starting positions will run the robot over different carpet (the floor isn't flat), or the robot will rock a different way at critical points in the path, resulting in the wheels catching on the carpet differently, resulting in different motion.

It is really hard to control every last variable so that the robot responds the exact same way each time. This is typically solved by implementing feedback loops to correct for deviations in the response. You could implement all your driver controls so that they provide inputs to feedback loops. That would make replaying the driver commands during auto mode work like you imagined, assuming that the error left over from your feedback loops is low enough to achieve the goal.
Reply With Quote
  #4   Spotlight this post!  
Unread 10-07-2014, 01:22
EricH's Avatar
EricH EricH is offline
New year, new team
FRC #1197 (Torbots)
Team Role: Engineer
 
Join Date: Jan 2005
Rookie Year: 2003
Location: SoCal
Posts: 19,720
EricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond repute
Re: Hypothetical auto proggraming method

Incidentally, this technique is used to set up industrial robots. Generally, those do the same thing over and over... but I suspect that it wouldn't be too difficult to program an FRC robot to pull different "training logs" to do different things.


However, there is one minor issue.

Practice fields at FRC events are NOT representative of actual field distances. They are practice elements (that match up in terms of size to actual elements) that are set up in some semblance of the actual thing, on a patch of carpet of whatever size is available in whatever space is available. But there is no guarantee of same distance, same reaction when hit by a ball, etc.

I suggest that in view of that, some effort be taken by the hardware side to have passed inspection in time to take a lot of trips through the filler line to the competition field, and have one button designated as the "train" button, triggering a different savelog every time it is pressed and held.
__________________
Past teams:
2003-2007: FRC0330 BeachBots
2008: FRC1135 Shmoebotics
2012: FRC4046 Schroedinger's Dragons

"Rockets are tricky..."--Elon Musk

Reply With Quote
  #5   Spotlight this post!  
Unread 10-07-2014, 01:29
markmcgary's Avatar
markmcgary markmcgary is online now
Software Mentor
FRC #4322 (Clockwork Oranges)
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Fullerton, CA
Posts: 169
markmcgary is just really nicemarkmcgary is just really nicemarkmcgary is just really nicemarkmcgary is just really nicemarkmcgary is just really nice
Re: Hypothetical auto proggraming method

I think this is a great idea. It's so good, it's been done. There have been a couple of additional attempts to use this method in the past as well. I searched threads for 'autonomous record playback'.
Reply With Quote
  #6   Spotlight this post!  
Unread 10-07-2014, 01:31
safiq10's Avatar
safiq10 safiq10 is offline
Registered User
FRC #2950 (DEVASTATORS)
Team Role: Mechanical
 
Join Date: Jan 2013
Rookie Year: 2009
Location: Waco tx
Posts: 528
safiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond reputesafiq10 has a reputation beyond repute
Re: Hypothetical auto proggraming method

This sounds very similar to what 1717 did in the book " The New Cool" and in real life. They would record their autonomous with robot on the practice field and replay it. Te user above has graciously shared this programs link above (thanks markmcgary for saving me some time)
__________________

2014 Dallas Semi-Finalist (Thanks 3847 & 231)
2014 OKC Semi-Finalist (Thanks 2341 & 2461)
Reply With Quote
  #7   Spotlight this post!  
Unread 10-07-2014, 06:24
RKazmer RKazmer is offline
FIRST Volunteer
AKA: Richard Kazmer
FRC #2363
Team Role: Alumni
 
Join Date: Jun 2014
Rookie Year: 2012
Location: Newport News
Posts: 36
RKazmer is on a distinguished road
Re: Hypothetical auto proggraming method

2363 did this in Ultimate Ascent for the tower hang. They used a program that,when the button was pressed, would take the signals from the driver and save them. Then when the game was about to end, the driver would hit a button and the entire hanging process was automated. As long as the robot was aligned with the pyramid, it would hang perfectly. Although it was during the teleop period, I think the same type of thing could work with basic maneuvering.

Last edited by RKazmer : 10-07-2014 at 06:40.
Reply With Quote
  #8   Spotlight this post!  
Unread 10-07-2014, 07:07
Aren Siekmeier's Avatar
Aren Siekmeier Aren Siekmeier is offline
on walkabout
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: 대한민국
Posts: 735
Aren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond repute
Re: Hypothetical auto proggraming method

Quote:
Originally Posted by AustinSchuh View Post
While this sounds great in theory, robots don't do the same thing twice without software support.

For example, different batteries have different internal resistances and hold different charges, resulting in different amounts of power being supplied to the wheels. This results in them responding differently.

When you drive a robot, as the tread and carpet wear, it responds differently when turning, and will coast different amounts when power is cut.

Different starting positions will run the robot over different carpet (the floor isn't flat), or the robot will rock a different way at critical points in the path, resulting in the wheels catching on the carpet differently, resulting in different motion.

It is really hard to control every last variable so that the robot responds the exact same way each time. This is typically solved by implementing feedback loops to correct for deviations in the response. You could implement all your driver controls so that they provide inputs to feedback loops. That would make replaying the driver commands during auto mode work like you imagined, assuming that the error left over from your feedback loops is low enough to achieve the goal.
And with control loops good enough to reproduce that variety of inputs, the inputs probably end up looking a lot like "follow this path" and "do this at this time" instead of direct control over actuators. Which is exactly what existing top-notch autonomous modes already do: schedule goal states for existing control loops.

Edit: To elaborate a little more. If we know what the bot will do in autonomous ahead of time (up to reading a switch/sensor/packet to select paths or hot goals), programming the precise goal states we want will give better results than supplying these goal states by recording joystick inputs. The human piece of the puzzle always comes in when the system needs to adapt, and sacrifices precision in the results.

I believe the recording used in training industrial robots only captures waypoints for the motion. These need to be provided by a human who knows the process. The control system for the articulation fills in the gaps in the motion.

Last edited by Aren Siekmeier : 10-07-2014 at 07:15.
Reply With Quote
  #9   Spotlight this post!  
Unread 11-07-2014, 17:51
zinthorne's Avatar
zinthorne zinthorne is offline
Registered User
AKA: Avery
FRC #5827 (Code Purple)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Seattle
Posts: 139
zinthorne will become famous soon enough
Re: Hypothetical auto proggraming method

Quote:
Originally Posted by compwiztobe View Post
And with control loops good enough to reproduce that variety of inputs, the inputs probably end up looking a lot like "follow this path" and "do this at this time" instead of direct control over actuators. Which is exactly what existing top-notch autonomous modes already do: schedule goal states for existing control loops.

Edit: To elaborate a little more. If we know what the bot will do in autonomous ahead of time (up to reading a switch/sensor/packet to select paths or hot goals), programming the precise goal states we want will give better results than supplying these goal states by recording joystick inputs. The human piece of the puzzle always comes in when the system needs to adapt, and sacrifices precision in the results.

I believe the recording used in training industrial robots only captures waypoints for the motion. These need to be provided by a human who knows the process. The control system for the articulation fills in the gaps in the motion.
could you expand some more on what you mean? You mean record the joystick and have the computer just drive to certain points in it?
Reply With Quote
  #10   Spotlight this post!  
Unread 11-07-2014, 18:23
Aren Siekmeier's Avatar
Aren Siekmeier Aren Siekmeier is offline
on walkabout
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: 대한민국
Posts: 735
Aren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond repute
Re: Hypothetical auto proggraming method

Quote:
Originally Posted by zinthorne View Post
could you expand some more on what you mean? You mean record the joystick and have the computer just drive to certain points in it?
Recording joystick inputs involves a human supplying output states at all points along the motion. The resulting motion can be erratic, and may not even end up in the right spot, or follow the right path at all.

The closed loop controllers that exist in FRC already take a setpoint in the form of an encoder position or velocity and transform them in a way to get outputs that converge quickly on the setpoint. Since we know in autonomous where we want to be or how fast to go, we can give the controller these setpoints exactly instead of bothering with the fuzzy joystick interface. Some controllers are even good enough that we can give them multiple setpoints in quick succession in order to follow a desired path. But this path can also be computed to satisfy certain criteria for smoothness, rate, etc., rather than relying on a human to "draw" it very approximately with a joystick.
Reply With Quote
  #11   Spotlight this post!  
Unread 11-07-2014, 23:14
BBray_T1296's Avatar
BBray_T1296 BBray_T1296 is offline
I am Dave! Yognaut
AKA: Brian Bray
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Rockwall, TX
Posts: 947
BBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond repute
Re: Hypothetical auto proggraming method

The way we have programmed our robot's autonomous has been very similar to that for years now (at least since 2009)

Our autonomous mode is a simple script (similar to ABS) that in essence spoofs any button command, like
Code:
Forward 1.0 10.0
Wait 2.000
Shoot
would drive forward at 100% for 10 feet, wait 2 seconds, then fire.
It allows us to quickly change autonomous mode while testing and such, because we are only altering a .txt file that doesn't have to compile.

All we are missing is some bit of software (on the DS or cRIO) that would provide a record function and spit out a .txt
__________________
If molecular reactions are deterministic, are all universes identical?

RIP David Shafer: you will be missed


Reply With Quote
  #12   Spotlight this post!  
Unread 12-07-2014, 09:08
Epsilon 5 Epsilon 5 is offline
Registered User
FRC #4678
 
Join Date: Mar 2014
Location: Waterloo
Posts: 4
Epsilon 5 is an unknown quantity at this point
Re: Hypothetical auto proggraming method

For the actual movement during auto, you should not be recording the joystick movement. If you want it to be accurate, you should put encoders on the wheels, and record how far each side travels. This would allow you to compensate for different voltages and surfaces, because you are not sending the motors a specific power for a specific time, instead you are telling them to move for a specific distance.
Reply With Quote
  #13   Spotlight this post!  
Unread 12-07-2014, 12:37
John's Avatar
John John is offline
Registered User
AKA: John Gillespie
FRC #1153 (Roborebels)
Team Role: Mechanical
 
Join Date: Sep 2011
Rookie Year: 2009
Location: Walpole MA
Posts: 71
John is just really niceJohn is just really niceJohn is just really niceJohn is just really niceJohn is just really nice
Re: Hypothetical auto proggraming method

Quote:
Originally Posted by markmcgary View Post
I think this is a great idea. It's so good, it's been done. There have been a couple of additional attempts to use this method in the past as well. I searched threads for 'autonomous record playback'.
Figured I should chime in, as one of the writers of that code.

It worked by writing the joystick axes and buttons to a file on the CRIO 10 ms increments (it doesn't actually write every 10 ms, it stores the values in an array until the recording finishes and then performs the write). The values are then played back one by one at the same 10 ms intervals.

We never used it in competition, nor did we expect this version to be good enough for competition. There are too many unknown factors (battery, mechanical wear, etc.) for open loop control to meet our expectations. But it did perform fairly well: our robot could consistently drive ~10 feet and end up within a foot of the destination. This is "good enough" for some applications.

Some teams only use open loop control in auto. Sensors are often expensive or tricky to implement, and a 90-100% consistent auto just isn't a big enough priority for these teams to use them. For these teams, a playback auto should be just as good as their normal autonomous, and may be easier to implement. It also may give them more options than they would have had previously.

The further step we wanted to make was to implement closed-loop playback. The setpoint would be inferred from the sensor values during recording (maybe the gains for the control loop could also be inferred from the joystick values). This would hopefully give the reliability of a hand-tuned closed-loop autonomous, but allow the quick implementation of new auto modes.

Unfortunately, our documentation and instructions for the existing code is quite poor. This is a large impediment to its use, as the "target audience" is teams that struggle to implement autonomous at all, or who only do the bare minimum. If we do further work, I would want to rewrite the code using the Motor Get Values vi instead of requiring the user to manually wire the values into a vi. This would hopefully allow the creation of two standalone vi's: one that gets placed in timed tasks and just runs and records on demand, and the other that gets placed in auto. Maybe with this rewrite and better documentation it would be more accessible to teams.

TL;DR We targetted this towards teams that otherwise couldn't do auto, and we need to improve documentation/ease of use to make it helpful.
Reply With Quote
  #14   Spotlight this post!  
Unread 12-07-2014, 13:44
efoote868 efoote868 is offline
foote stepped in
AKA: E. Foote
FRC #0868
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Noblesville, IN
Posts: 1,376
efoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond repute
Re: Hypothetical auto proggraming method

I know my old team did that way back in 2003, 2 years before I started. Their reason to record joystick movements with dead reckoning instead of using sensors with logic was the very limited amount of memory the controller had, as well as the more limited options / experience with sensors. If I recall correctly, they printed time stamps with controller inputs, then manually coded it into an array.

Now, you can get quite a few digital sensors (I2C) for very cheap, and compared to controllers of old, you have pretty much unlimited memory and processing power. The amount of control you have is staggering.
__________________
Be Healthy. Never Stop Learning. Say It Like It Is. Own It.

Like our values? Flexware Innovation is looking for Automation Engineers. Check us out!
Reply With Quote
  #15   Spotlight this post!  
Unread 13-07-2014, 21:34
Sohaib's Avatar
Sohaib Sohaib is offline
Registered User
AKA: Sohaib Nadeem
FRC #5036 (The Robo Devils)
Team Role: Coach
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Toronto, Ontario
Posts: 129
Sohaib is a glorious beacon of lightSohaib is a glorious beacon of lightSohaib is a glorious beacon of lightSohaib is a glorious beacon of lightSohaib is a glorious beacon of light
Re: Hypothetical auto proggraming method

Robots generally have a hard time replicating the exact same things in such a manner as there are too many variables. What would be interesting however is to record sensor feedback on the drive train while the driver performs the auto-mode, and use that for autonomous.
__________________

2014 Season:
- Drive Coach
- Rookie All-Star Award (GTR-E)
2015 Season:
- Driver
- Deans List Semi-Finalist (GTR-E)
2016 Season:
- Driver
- Alliance Captain (GTR-E)
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 13:53.

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