Go to Post Mentors are the guardrails: Show the students how to do what they need to do, Step back and let the students do what they need to do, Nudge them back on course when they need a nudge, Insist, when necessary, that no one tries to juggle the chainsaws - gblake [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 07-05-2013, 12:42
sarah_storer's Avatar
sarah_storer sarah_storer is offline
Georgia Tech RoboJackets Outreach
AKA: Sarah Storer
FRC #5332 (Toaster Tech)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Atlanta, GA
Posts: 147
sarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to behold
Record Robot Actions

My coach asked me on the way home from Championship to find out if there was a way to record robot actions and then play them back. My searching so far has proved fruitless and so I decided to post on CD.

Any help would be greatly appreciated!
__________________

TEAM 3753 BULAH BOTS ALUMNI
2012-2015: Code, pneumatics, and electrical for BULAH BOTS Team 3753
2013: Bayou Regional 1st seed alliance captain and regional winners (With 118 and 4589)
2014, 2015: Bayou Regional semi-finalist
2016-?: Mentor for TOASTER TECH Team 5332
2016: Columbus District 3rd seed alliance captain, semi-finalist; Kennesaw District 3rd seed alliance 1st pick, semi-finalist; Peachtree District State Championship 4th seed alliance captain, quarter-finalist, Industrial Design Award, World Championship qualification
Reply With Quote
  #2   Spotlight this post!  
Unread 07-05-2013, 13:04
bumblebee3339's Avatar
bumblebee3339 bumblebee3339 is offline
Team's main account
FRC #3339 (BumbleBee)
 
Join Date: Feb 2013
Rookie Year: 2009
Location: Israel
Posts: 34
bumblebee3339 is an unknown quantity at this point
Re: Record Robot Actions

Quote:
Originally Posted by thetimemachine View Post
My coach asked me on the way home from Championship to find out if there was a way to record robot actions and then play them back. My searching so far has proved fruitless and so I decided to post on CD.

Any help would be greatly appreciated!
In theory, you only need to find a way to record axis values and buttons,
and then use them to operate the robot.

I can't think right now of an efficient way to do it,
but I think you can try to create an array for each button that represents time in ms when the button changed it's value.
using the same method for the axis can take a lot of memory so let others comment with better ways
Reply With Quote
  #3   Spotlight this post!  
Unread 07-05-2013, 13:23
akoscielski3's Avatar
akoscielski3 akoscielski3 is offline
Mentor (1114), Alumni (772)
AKA: Aaron Koscielski
FRC #1114 (Simbotics)
Team Role: Mentor
 
Join Date: Jul 2010
Rookie Year: 2006
Location: LaSalle, Ontario, Canada
Posts: 1,066
akoscielski3 has a reputation beyond reputeakoscielski3 has a reputation beyond reputeakoscielski3 has a reputation beyond reputeakoscielski3 has a reputation beyond reputeakoscielski3 has a reputation beyond reputeakoscielski3 has a reputation beyond reputeakoscielski3 has a reputation beyond reputeakoscielski3 has a reputation beyond reputeakoscielski3 has a reputation beyond reputeakoscielski3 has a reputation beyond reputeakoscielski3 has a reputation beyond repute
Re: Record Robot Actions

We did do this a while ago, i brlieve preseason for 2012. It was cool to see but since there are so many variables that can change how much a arm moves or how far you drive it wasn't as useful as we thought. If you wanted to do this it would be better to record encoder information and make the robot play that back, but we didbt do that.
Ours was used to attempt a recorded auto, which didn't work like planned.
__________________
Hall of Fame Team 1114 Simbotics
2013-Present
Host of Simbot Solidworks Series
Team 772 Sabre Bytes
2010-2013

Dean's List Finalist 2013 Waterloo Regional
Reply With Quote
  #4   Spotlight this post!  
Unread 07-05-2013, 14:50
BrianArneson BrianArneson is offline
Registered User
FRC #0662 (Rocky Mountain Robotics)
Team Role: Mentor
 
Join Date: Apr 2013
Rookie Year: 2009
Location: Colorado
Posts: 15
BrianArneson is an unknown quantity at this point
Re: Record Robot Actions

I know a team has done it and got it working well, so it is possible. Recording the gyro and encoder and other sensor values seems like what you would been to do.
__________________
7 year FRC participant
Mentor on FIRST Team 662 - 2 years
Former student FIRST Team 4550 - 1 year
Former student FIRST Team 443 - 4 years
Reply With Quote
  #5   Spotlight this post!  
Unread 07-05-2013, 16:27
NeatNit's Avatar
NeatNit NeatNit is offline
Alumni Programmer
FRC #1577 (Steampunk)
Team Role: Teacher
 
Join Date: Sep 2011
Rookie Year: 2011
Location: Israel
Posts: 60
NeatNit is an unknown quantity at this point
Re: Record Robot Actions

I think you should first of all see how it handles the head-against-the-wall method of recording every state of every button every 5 ms, and later being able to play it back. It's very likely it would run out of memory very fast, but this is the basic version.
From here there are many tricks that can make it more reliable for longer recordings: saving each button separately and only when it toggles, instead of every 5 ms; saving the joystick positions less often (every 20 ms?) and using the VI that extrapolates between points during playback (I forgot what it was called). Those are just two powerful examples, and will likely get the job done.
Reply With Quote
  #6   Spotlight this post!  
Unread 07-05-2013, 16:45
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Electrical/Programming Mentor
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,791
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: Record Robot Actions

How you do it might be dependent on exactly what you hope to accomplish with it. Are you trying to duplicate your robot's movements in a previous match? Are you trying to capture certain movements in order to program an autonomous mode?

There are really three types of information that can be captured: driver input, motor/pneumatic output, and sensor input. I'll deal with each one separately.

Driver input: This can be thought through the easiest: Capture the axis values and button pushes, with timestamped values. Play those back in as input instead of actually driving the robot. This is also possibly the least informative type of recording you can do - it's highly dependent on the conditions on the field (starting position, where other robots push you, how your robot might slip or tilt when driving over a Frisbee).

Motor/pneumatic output: Where as with Drive Input you're feeding the input through the code to determine the output, here you directly capture the output. It's a little less intuitive than dealing with Driver Input, as you essentially have to ignore what the code says and provide the output directly.

Sensor input: This is perhaps the most precise, but is more difficult to get right - you're relying on sensors connected to the motors and moving parts to tell you when those items run and how far they go. This lets you precisely mimic motions.

We did this for our climbing routine this year. We had the potentiometer values from the associated axis being spit out to the console, and then we manually moved the robot through its motions. This allowed us to capture exactly how we wanted it to move, and based on that data create waypoints (critical positions the mechanism needed to hit in its motion) for the motors to move through in our PID loop, essentially recreating the manual motions we made. (go to position A, then B, then C... the exact motion from A to B may not have been identical to the manual motion, but the final positions were)

This same process could be used with an autonomous mode pretty easily. start the robot, then manually move it through what you want it to do (roll it forward to pick up disks, or turn and follow the center line, for example), capturing output from the encoders on the console. Then you know that to get to a specific waypoint in the process, you need to hit X number of encoder counts on each side of the drive train.

For capturing and playing back an entire match... I would question the use. Another robot bumping into you will completely throw off the data you gathered, and make it nearly impossible to reproduce.
__________________
2007 - Present: Mentor, 2177 The Robettes
LRI: North Star 2012-2016; Lake Superior 2013-2014; MN State Tournament 2013-2014, 2016; Galileo 2016; Iowa 2017
2015: North Star Regional Volunteer of the Year
2016: Lake Superior WFFA
Reply With Quote
  #7   Spotlight this post!  
Unread 08-05-2013, 11:00
sarah_storer's Avatar
sarah_storer sarah_storer is offline
Georgia Tech RoboJackets Outreach
AKA: Sarah Storer
FRC #5332 (Toaster Tech)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Atlanta, GA
Posts: 147
sarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to behold
Re: Record Robot Actions

Quote:
Originally Posted by Jon Stratis View Post
How you do it might be dependent on exactly what you hope to accomplish with it. Are you trying to duplicate your robot's movements in a previous match? Are you trying to capture certain movements in order to program an autonomous mode?
I believe that we are trying to program an autonomous for next year this way...but who knows? Maybe it would be useful in endgame next season!

By the way, thank you! Your post was very useful!

So the general consensus is that we should record encoder values?
__________________

TEAM 3753 BULAH BOTS ALUMNI
2012-2015: Code, pneumatics, and electrical for BULAH BOTS Team 3753
2013: Bayou Regional 1st seed alliance captain and regional winners (With 118 and 4589)
2014, 2015: Bayou Regional semi-finalist
2016-?: Mentor for TOASTER TECH Team 5332
2016: Columbus District 3rd seed alliance captain, semi-finalist; Kennesaw District 3rd seed alliance 1st pick, semi-finalist; Peachtree District State Championship 4th seed alliance captain, quarter-finalist, Industrial Design Award, World Championship qualification
Reply With Quote
  #8   Spotlight this post!  
Unread 08-05-2013, 15:13
bumblebee3339's Avatar
bumblebee3339 bumblebee3339 is offline
Team's main account
FRC #3339 (BumbleBee)
 
Join Date: Feb 2013
Rookie Year: 2009
Location: Israel
Posts: 34
bumblebee3339 is an unknown quantity at this point
Re: Record Robot Actions

Quote:
Originally Posted by thetimemachine View Post
I believe that we are trying to program an autonomous for next year this way...but who knows? Maybe it would be useful in endgame next season!

By the way, thank you! Your post was very useful!

So the general consensus is that we should record encoder values?
I recommend you to try both ways,
start up with sensors recording - if it works well stick with that.
You can try recording button and axis values to compare.
Reply With Quote
  #9   Spotlight this post!  
Unread 08-05-2013, 15:34
Jimmy Nichols's Avatar
Jimmy Nichols Jimmy Nichols is offline
Mentor,QCR Planning
FRC #1038 (The Thunderhawks)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Cincinnati, Ohio
Posts: 1,012
Jimmy Nichols has a reputation beyond reputeJimmy Nichols has a reputation beyond reputeJimmy Nichols has a reputation beyond reputeJimmy Nichols has a reputation beyond reputeJimmy Nichols has a reputation beyond reputeJimmy Nichols has a reputation beyond reputeJimmy Nichols has a reputation beyond reputeJimmy Nichols has a reputation beyond reputeJimmy Nichols has a reputation beyond reputeJimmy Nichols has a reputation beyond reputeJimmy Nichols has a reputation beyond repute
Send a message via Yahoo to Jimmy Nichols
Re: Record Robot Actions

This was how we programmed our auton this year. We would record the joystick values and button presses by the operators and then play them back. Where you recorded them played heavily into their accuracy on the field. If you are interested in more info, PM me and I can get you connected up with our programmer.
__________________
Jimmy - Lead Mentor, Pit Boss, Miami Valley FRC Regional Planning Committee
Lakota Robotics - FRC Team 1038

2013 - Crossroads Team Spirit,Quarter-Finalists - Queen City WFFA - Paul George,Quarter-Finalists - Ohio FRC State Championship Champions
2012 - Queen City Volunteer of the Year,Team Spirit,Finalists - Smoky Mountains Engineering Inspiration,Quarterfinalists
2011 - Pittsburgh Semifinalists - Buckeye Engineering Excellence Award,Coopertition Award,SemiFinalists
2010 - Pittsburgh Judge’s Award,Quarterfinalists - Buckeye Industrial Design Award,Finalists - IRI Mentor Round Champions
2009 - Buckeye GM Industrial Design,Champions
2008 - Midwest Engineering Inspiration,Quarterfinalist - IRI Semifinalist
2007 - Pittsburgh Motorola Quality,Finalist - Buckeye Rockwell Automation Innovative Controls,Finalist - Championship Newton Quarterfinalist
Reply With Quote
  #10   Spotlight this post!  
Unread 08-05-2013, 15:44
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,722
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Record Robot Actions

We set up recording on our drive last year and actually used it at the competitions for our hanging since it was so sensitive. What we did was record the values going into the motors instead of the joystick values. So for the drive all we had to do was save the values for the left and right sides and then play those values back again. We actually are working on getting this set up for the rest of the robot this off season also.
Reply With Quote
  #11   Spotlight this post!  
Unread 08-05-2013, 16:27
sarah_storer's Avatar
sarah_storer sarah_storer is offline
Georgia Tech RoboJackets Outreach
AKA: Sarah Storer
FRC #5332 (Toaster Tech)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Atlanta, GA
Posts: 147
sarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to behold
Re: Record Robot Actions

Quote:
Originally Posted by notmattlythgoe View Post
We set up recording on our drive last year and actually used it at the competitions for our hanging since it was so sensitive. What we did was record the values going into the motors instead of the joystick values. So for the drive all we had to do was save the values for the left and right sides and then play those values back again. We actually are working on getting this set up for the rest of the robot this off season also.
So I grasp the concept of recording but how would someone save those and play it back?

[Any example code? ....in LabVIEW]
__________________

TEAM 3753 BULAH BOTS ALUMNI
2012-2015: Code, pneumatics, and electrical for BULAH BOTS Team 3753
2013: Bayou Regional 1st seed alliance captain and regional winners (With 118 and 4589)
2014, 2015: Bayou Regional semi-finalist
2016-?: Mentor for TOASTER TECH Team 5332
2016: Columbus District 3rd seed alliance captain, semi-finalist; Kennesaw District 3rd seed alliance 1st pick, semi-finalist; Peachtree District State Championship 4th seed alliance captain, quarter-finalist, Industrial Design Award, World Championship qualification
Reply With Quote
  #12   Spotlight this post!  
Unread 08-05-2013, 16:30
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,722
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Record Robot Actions

Quote:
Originally Posted by thetimemachine View Post
So I grasp the concept of recording but how would someone save those and play it back?

[Any example code? ....in LabVIEW]
Unfortunately, we did ours in Java using the command based code design. So what we did was started a command using the drive subsystem and each run through of the command we appended the values to the end of a file. Then to play it back we started a new command that read the top line off of that file and sent the values to the subsystem. Using that structure all of the timing was handled for us. We are doing a complete code rewrite currently to clean up the implementation, I can get you samples of our code at some point if you'd like.

Last edited by notmattlythgoe : 08-05-2013 at 16:33.
Reply With Quote
  #13   Spotlight this post!  
Unread 08-05-2013, 16:33
sarah_storer's Avatar
sarah_storer sarah_storer is offline
Georgia Tech RoboJackets Outreach
AKA: Sarah Storer
FRC #5332 (Toaster Tech)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Atlanta, GA
Posts: 147
sarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to behold
Re: Record Robot Actions

Quote:
Originally Posted by notmattlythgoe View Post
Unfortunately, we did ours in Java using the command based code design. So what we did was started a command using the drive subsystem and each run through of the command we appended the values to the end of a file. Then to play it back we started a new command that read the top line off of that file and sent the values to the subsystem. Using that structure all of the timing was handled for us.
Personally text based code makes WAY more sense to me...I don't know a ton about LabVIEW but its what our robot is coded in:/....
__________________

TEAM 3753 BULAH BOTS ALUMNI
2012-2015: Code, pneumatics, and electrical for BULAH BOTS Team 3753
2013: Bayou Regional 1st seed alliance captain and regional winners (With 118 and 4589)
2014, 2015: Bayou Regional semi-finalist
2016-?: Mentor for TOASTER TECH Team 5332
2016: Columbus District 3rd seed alliance captain, semi-finalist; Kennesaw District 3rd seed alliance 1st pick, semi-finalist; Peachtree District State Championship 4th seed alliance captain, quarter-finalist, Industrial Design Award, World Championship qualification
Reply With Quote
  #14   Spotlight this post!  
Unread 08-05-2013, 16:36
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,722
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Record Robot Actions

Quote:
Originally Posted by thetimemachine View Post
Personally text based code makes WAY more sense to me...I don't know a ton about LabVIEW but its what our robot is coded in:/....
Is there a specific reason that you guys used Labview? We switched to Java last year and have absolutely loved the Command Based system. We had used Labview before that, main reason for switching was the use in school and both the other mentor and I were better versed in it.

You can see the recording used in this video to hang on the lower bar. Our driver lines up under the bar and pushes a button and the robot drives backwards and drives forward. This was recorded on the practice field at the competition when we realized that our hanging mechanism was very sensitive to the speed that you hit the bar at. After the recording was done it was an extremely reliable mechanism.

http://www.youtube.com/watch?feature...NufVQ#t=12 1s

Last edited by notmattlythgoe : 08-05-2013 at 16:45.
Reply With Quote
  #15   Spotlight this post!  
Unread 08-05-2013, 16:44
sarah_storer's Avatar
sarah_storer sarah_storer is offline
Georgia Tech RoboJackets Outreach
AKA: Sarah Storer
FRC #5332 (Toaster Tech)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Atlanta, GA
Posts: 147
sarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to beholdsarah_storer is a splendid one to behold
Re: Record Robot Actions

Quote:
Originally Posted by notmattlythgoe View Post
Is there a specific reason that you guys used Labview? We switched to Java last year and have absolutely loved the Command Based system. We had used Labview before that, main reason for switching was the use in school and both the other mentor and I were better versed in it.
Because there is theoretically more support for LabVIEW and because its supposed to be "easier" because its visual.....I fail to see the easy part:/ But I don't think we can switch to anything else because I know more [even though its just a little] LabVIEW than Java or C++ or something like that...
__________________

TEAM 3753 BULAH BOTS ALUMNI
2012-2015: Code, pneumatics, and electrical for BULAH BOTS Team 3753
2013: Bayou Regional 1st seed alliance captain and regional winners (With 118 and 4589)
2014, 2015: Bayou Regional semi-finalist
2016-?: Mentor for TOASTER TECH Team 5332
2016: Columbus District 3rd seed alliance captain, semi-finalist; Kennesaw District 3rd seed alliance 1st pick, semi-finalist; Peachtree District State Championship 4th seed alliance captain, quarter-finalist, Industrial Design Award, World Championship qualification
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 21:01.

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