Go to Post Anything released in a game hint is subject to enough misinterpretation and "nah, they'll never do that" to deflect any possibility of something being actionable. - EricH [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 18-02-2011, 22:22
lucoytoa's Avatar
lucoytoa lucoytoa is offline
Programmer
AKA: Nicolas Xiong
FRC #2276 (STARS of Cypress)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Spring, TX
Posts: 20
lucoytoa is an unknown quantity at this point
Please Review My Autonomous Codes

Please help review my autonomous code with line tracking. We haven't tested it yet so if you see anything wrong let me know. The sequence begins
after the sensors have reached the T.

We will be testing it tomorrow at a scrimmage.
Attached Thumbnails
Click image for larger version

Name:	Autonomous2.png
Views:	195
Size:	48.6 KB
ID:	10209  
__________________
FRC - STARS of Cypress, 2008, 2009, 2010
FTC - SOAR Club - 2011
FLL - DNAbots - 2009, 2010
BEST - STARS of Cypress - 2008, 2009, 2010
MATE - STARS of Cypress - 2008
MATE - SOAR Club - 2011
VEX - Discobots - 2010
Robofest - 2008
Houston: Energy City of the Future - RNKL Engineering - 2009
Reply With Quote
  #2   Spotlight this post!  
Unread 19-02-2011, 07:24
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Please Review My Autonomous Codes

There are a number of things you may want to change. First off, unless you have disabled the safety for the motors, you cannot set the speed of a motor and simply leave it on for 1 or two seconds. If you don't tell it to stay on, it will turn off after 100ms.

I've attached a VI that I really wish we'd put into the palettes. It works the same as last year's Delay and Feed VI, but instead of feeding the watchdog it updates the given motor. You can use it like the delay block, but wire in seconds, and also wire in the error I/O for sequencing and the motor refnum for updating. Don't worry too much about the nap time input.

The snapshot shows what the equivalent diagram looks like with this. I've also attached a subVI, Autonomous Clipboard.vi, with the code --in case you want to copy/paste instead of rebuilding it.

Be sure to put the WPIMotor...DelayAndFeed VI into Program Files\National Instruments\LabVIEW 8.6\vi.lib\Rock Robotics\WPI\Motor Control folder before you use it.

Other considerations? -1 seems really fast to be reversing the robot for three seconds while moving the arm. I suspect that you'll need to dial that down. I also wouldn't be surprised if you need to lower the arm and then start backing up. But that dead-reckoning adjustment is something you should work out at or during the scrimmage.

Good luck.
Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Screen shot 2011-02-19 at 6.12.08 AM.png
Views:	175
Size:	22.0 KB
ID:	10211  
Attached Files
File Type: vi WPI_MotorControlDelayAndUpdate.vi (21.3 KB, 74 views)
File Type: vi Autonomous Clipboard.vi (8.1 KB, 57 views)
Reply With Quote
  #3   Spotlight this post!  
Unread 14-03-2011, 20:52
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Please Review My Autonomous Codes

Quote:
Originally Posted by Greg McKaskle View Post
There are a number of things you may want to change. First off, unless you have disabled the safety for the motors, you cannot set the speed of a motor and simply leave it on for 1 or two seconds. If you don't tell it to stay on, it will turn off after 100ms.

I've attached a VI that I really wish we'd put into the palettes. It works the same as last year's Delay and Feed VI, but instead of feeding the watchdog it updates the given motor. You can use it like the delay block, but wire in seconds, and also wire in the error I/O for sequencing and the motor refnum for updating. Don't worry too much about the nap time input.

The snapshot shows what the equivalent diagram looks like with this. I've also attached a subVI, Autonomous Clipboard.vi, with the code --in case you want to copy/paste instead of rebuilding it.

Be sure to put the WPIMotor...DelayAndFeed VI into Program Files\National Instruments\LabVIEW 8.6\vi.lib\Rock Robotics\WPI\Motor Control folder before you use it.

Other considerations? -1 seems really fast to be reversing the robot for three seconds while moving the arm. I suspect that you'll need to dial that down. I also wouldn't be surprised if you need to lower the arm and then start backing up. But that dead-reckoning adjustment is something you should work out at or during the scrimmage.

Good luck.
Greg McKaskle
Hey Greg
I have a week before my team competes at our regional, and i am still attempting to make an autonomous mode. Our robot is basically a 6wd arcade drive with 4 motors. We are unsure about using the sensors because we haven't mounted them yet. My mentors wanted me to write a code for the line sensors, and one for if we don't have the line sensors. For the code without the line sensors, i was trying to use your attached code, but i ran into a problem because our arm is a relay, not a motor like shown, and i couldn't figure out a way to make it work. For the code WITH the line sensors, i have having trouble finding the spot to add my extra stuff. I know to keep the default line code, but we want some other things done. This is what we are trying to attempt in order of occurence: Follow the line to the T. Not following the Y. Next, or as its moving, raise our arm for x amount of time. Our arm is run by a spike relay. Next, have the robot move forward for let's say half a second to put the tube over the peg. Next, have the arm drop for x amount of time. Lastly, drive away for x seconds. Its a long wish list, but it would mean a lot. I'm a rookie programmer, and if i can get autonomous working with the help of others, would be a great feeling. All the timing and such, i can figure out, i am just stuck in where to put the stuff and how to make this code effectively.

Thanks,
Jared
Reply With Quote
  #4   Spotlight this post!  
Unread 15-03-2011, 23:00
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Please Review My Autonomous Codes

If I understand what your idea, you want to move the arm independently and begin the loop that follows the line.

My suggestion would be to use timers, relays, and a sequence structure to do the arm in parallel with the line follower code. Put code after the line follower loop that will reverse the relay for some time, release the tube, and drive away.

I know that isn't a ton of detail, but start with the initial stuff and once it works, add the next element in. Once you get started, I think the sequencing will become more obvious.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 16-03-2011, 21:21
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Please Review My Autonomous Codes

Quote:
Originally Posted by Greg McKaskle View Post
If I understand what your idea, you want to move the arm independently and begin the loop that follows the line.

My suggestion would be to use timers, relays, and a sequence structure to do the arm in parallel with the line follower code. Put code after the line follower loop that will reverse the relay for some time, release the tube, and drive away.

I know that isn't a ton of detail, but start with the initial stuff and once it works, add the next element in. Once you get started, I think the sequencing will become more obvious.

Greg McKaskle
Hey Grey,
Yes, I want the robot to first follow the lines, then raise the arm once the robot reaches the T. I have my autonomous code posted at this link. http://www.chiefdelphi.com/forums/sh...=check+my+code
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 08:13.

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