Go to Post I want to understand the physics. - Molten [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 09-03-2015, 13:44
Shaif Shaif is offline
Registered User
FRC #5580 (SQUAD)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2015
Location: Toronto
Posts: 17
Shaif is an unknown quantity at this point
Question Need A Little Help On How To Make Autonomous Switcher

So in this video by Ri3D (https://www.youtube.com/watch?v=WbSfOFmx8LI&t=39) the guy mentions how the thing attached to the RoboRIO can switch between different autonomous for when they're needed. I was wondering how could I assemble and program one? I'm a rookie programmer from a rookie team and one thing I learned from my first regional event (which we surprisingly ended up in 14th) is that the majority of the time between matches I'm recoding the autonomous and uploading it to my robot which reduced my time to talk with my alliance members and make a strategy as I'm also the team's driver.

Most of the time I'm either switching my autonomous to move forward to a tote pick-up and move forward and vice versa with little tweaks here and there. So having this would have pretty much been a life saver in my last event. If only I had seen this earlier.

Being a rookie programmer with knowledge only on basic Java, I was wondering how I could make something similar to what was shown in the video. I know he's using a screen with buttons on the RIOdunio, but Andy Mark is selling a whole kit with a touch screen. So what I'm asking for is pretty much a full tutorial on how to assemble and code an interface that would let me switch between different autonomous.

I'm potentially leaving for uni next year and I want to put my team's next year coder in the best possible position because learning to code a robot is a little overwhelming. This would help out tremendously.


TL : DR) What I'm asking for is pretty much a full tutorial on how to assemble and code an interface that would let me switch between different pre-coded autonomous like the one shown in here https://www.youtube.com/watch?v=WbSfOFmx8LI&t=39 rather than having to hooking up a laptop every time.
  #2   Spotlight this post!  
Unread 09-03-2015, 13:49
Joe G.'s Avatar
Joe G. Joe G. is offline
Taking a few years (mostly) off
AKA: Josepher
no team (Formerly 1687, 5400)
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2007
Location: Worcester, MA
Posts: 1,447
Joe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond repute
Send a message via AIM to Joe G.
Re: Need A Little Help On How To Make Autonomous Switcher

This can be done on the robot, but a lot of teams find it even easier to put on their driver station (perfectly legal, as long as it isn't touched or intereacted with during the actual autonomous period). Simply use a device which can pass a signal to the roboRIO, or to the TI breakout board you got in your kit of parts for custom driver station components. (could be any of a number of things...a potentiometer hooked to an analog input, a series of dip switches or jumpers on digital inputs, etc.)

In your code, you would load all possible autonomous modes on to the roboRIO. When autonomous starts, the first thing you do is read the value of this device. Using if-else statements, or a case structure, you would tell your robot to do one of any number of possible autonomous modes.
__________________
FIRST is not about doing what you can with what you know. It is about doing what you thought impossible, with what you were inspired to become.

2007-2010: Student, FRC 1687, Highlander Robotics
2012-2014: Technical Mentor, FRC 1687, Highlander Robotics
2015-2016: Lead Mentor, FRC 5400, Team WARP
2016-???: Volunteer and freelance mentor-for-hire
  #3   Spotlight this post!  
Unread 09-03-2015, 13:55
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,058
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: Need A Little Help On How To Make Autonomous Switcher

I would use SmartDashboard/SendableChooser, it'll be easier.
__________________
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
  #4   Spotlight this post!  
Unread 09-03-2015, 14:32
rich2202 rich2202 is offline
Registered User
FRC #2202 (BEAST Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Wisconsin
Posts: 1,192
rich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond repute
Re: Need A Little Help On How To Make Autonomous Switcher

On the RoboRio, you can use the Digital IO and/or the Analog IO ports.

You set up a switch (single pole, double throw), with the outside posts going to +5 and ground (red and black wires), and the middle post connected to signal (white). You then see whether the switch is on/off for DIO, or above or below 2.5 volts for AIO.

The easier way is to use smart dashboard. I prefer writing a variable to the smart dashboard, and reading it back. The variable can be changed at any time, up to the time when autonomous starts. You then read the value during Autonomous Init to determine which autonomous program to run.
  #5   Spotlight this post!  
Unread 09-03-2015, 14:56
Shaif Shaif is offline
Registered User
FRC #5580 (SQUAD)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2015
Location: Toronto
Posts: 17
Shaif is an unknown quantity at this point
Re: Need A Little Help On How To Make Autonomous Switcher

Quote:
Originally Posted by virtuald View Post
I would use SmartDashboard/SendableChooser, it'll be easier.
Quote:
Originally Posted by rich2202 View Post
On the RoboRio, you can use the Digital IO and/or the Analog IO ports.

You set up a switch (single pole, double throw), with the outside posts going to +5 and ground (red and black wires), and the middle post connected to signal (white). You then see whether the switch is on/off for DIO, or above or below 2.5 volts for AIO.

The easier way is to use smart dashboard. I prefer writing a variable to the smart dashboard, and reading it back. The variable can be changed at any time, up to the time when autonomous starts. You then read the value during Autonomous Init to determine which autonomous program to run.
I didn't think of that until now. But making the autonomous switcher seems like a cool project to work on now that my season is over.
  #6   Spotlight this post!  
Unread 09-03-2015, 15:58
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,058
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: Need A Little Help On How To Make Autonomous Switcher

Quote:
Originally Posted by Shaif View Post
I didn't think of that until now. But making the autonomous switcher seems like a cool project to work on now that my season is over.
If you were using python, we provide an object that will automatically recognize all the modules in a package (directory) and add them to SmartDashboard for you. Reference.

It should be pretty easy to write an equivalent in Java using reflection/etc. I'm surprised I've never seen one.
__________________
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
  #7   Spotlight this post!  
Unread 09-03-2015, 16:09
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 430
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Need A Little Help On How To Make Autonomous Switcher

If you're using smart dashboard and the command based robot project its real simple.

There's even a guide: http://tinyurl.com/autoChooser
__________________
http://team2168.org
  #8   Spotlight this post!  
Unread 09-03-2015, 16:55
Shaif Shaif is offline
Registered User
FRC #5580 (SQUAD)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2015
Location: Toronto
Posts: 17
Shaif is an unknown quantity at this point
Re: Need A Little Help On How To Make Autonomous Switcher

Command Based seemed a little intimidating for a rookie team like us with little man power, so we just did what we could with Iterative and we stayed as far away as possible from smart dashboard only because we didn't want to mess up anything that was already functional and not know how to fix it in time for the competition. But maybe now would be a good time to try these features out and learn how to use them to mentor the team for next year.
  #9   Spotlight this post!  
Unread 09-03-2015, 19:25
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,058
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: Need A Little Help On How To Make Autonomous Switcher

Quote:
Originally Posted by Shaif View Post
Command Based seemed a little intimidating for a rookie team like us with little man power, so we just did what we could with Iterative and we stayed as far away as possible from smart dashboard only because we didn't want to mess up anything that was already functional and not know how to fix it in time for the competition. But maybe now would be a good time to try these features out and learn how to use them to mentor the team for next year.
That's ironic given command based is supposed to be "easier to use".
__________________
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
  #10   Spotlight this post!  
Unread 10-03-2015, 10:34
gr8dragon's Avatar
gr8dragon gr8dragon is offline
Registered User
AKA: Parth Patel
no team
Team Role: Alumni
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Toronto,Canada
Posts: 39
gr8dragon is a glorious beacon of lightgr8dragon is a glorious beacon of lightgr8dragon is a glorious beacon of lightgr8dragon is a glorious beacon of lightgr8dragon is a glorious beacon of light
Re: Need A Little Help On How To Make Autonomous Switcher

In the past I know teams to have used the disabled routines in the C++/Java libraries in which they set autonomous state based on joystick button press. If joystick 1 is pressed then autonomous 1 is run and so on. Its simple and doesn't require any new hardware. I do believe this is still legal because you would do this before the MC does the countdown, and autonomous actually starts. Make sure the robot is connected fully to the driver station in order for this to actually work.
__________________
FRC 2013 World Champions 1241 (1477, 610) Thank you Team 1241 for letting me be a part of your wonderful team.
FRC 2010 GTR Regional Chairmans (188)
FRC 2009 Finger Lakes Regional Champions 188 (1507, 174)
  #11   Spotlight this post!  
Unread 12-03-2015, 20:46
JefferMC JefferMC is offline
Registered User
AKA: Jeff Corbett
FRC #1319 (Flash)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2005
Location: United States
Posts: 44
JefferMC will become famous soon enough
Re: Need A Little Help On How To Make Autonomous Switcher

We have used Sendable Chooser, but had issues with stability with SmartDashboard usage that year and quit using SmartDashboard all together.

Last year, I believe it was, we used the DigitalInput switches on the IO page the DriverStation software as switches to select an autonomous program. But those went away this year. Pity.

We are using Preferences this year, but are having problems with the preference values getting stored in the file when set in SmartDashboard. So... we've been editing the Preferences file on the DS computer, then copying to the Robot with FTP. I'm debating going back to a Sendable Chooser, or using a Sendable chooser to set the Preference.

Before SmartDashboard, et al, we would use a series of switches to select the number of the program we wanted to run.

Anyway, regardles of which of these mechanisms we've used, the chosen routine gets identified at RobotInit or AutonomousInit (depending on the actual mechanism), and executed at the appropriate time.

RE: Command Based robot vs Interative. If your robot needs to do two things at once, Command Based is the way to go. Otherwise, Iterative is okay.

Last edited by JefferMC : 12-03-2015 at 20:48.
  #12   Spotlight this post!  
Unread 12-03-2015, 22:21
Shaif Shaif is offline
Registered User
FRC #5580 (SQUAD)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2015
Location: Toronto
Posts: 17
Shaif is an unknown quantity at this point
Re: Need A Little Help On How To Make Autonomous Switcher

Quote:
Originally Posted by JefferMC View Post
We have used Sendable Chooser, but had issues with stability with SmartDashboard usage that year and quit using SmartDashboard all together.

Last year, I believe it was, we used the DigitalInput switches on the IO page the DriverStation software as switches to select an autonomous program. But those went away this year. Pity.

We are using Preferences this year, but are having problems with the preference values getting stored in the file when set in SmartDashboard. So... we've been editing the Preferences file on the DS computer, then copying to the Robot with FTP. I'm debating going back to a Sendable Chooser, or using a Sendable chooser to set the Preference.

Before SmartDashboard, et al, we would use a series of switches to select the number of the program we wanted to run.

Anyway, regardles of which of these mechanisms we've used, the chosen routine gets identified at RobotInit or AutonomousInit (depending on the actual mechanism), and executed at the appropriate time.

RE: Command Based robot vs Interative. If your robot needs to do two things at once, Command Based is the way to go. Otherwise, Iterative is okay.
So what do you think the people in the video that i attached in the original post were doing?
  #13   Spotlight this post!  
Unread 09-03-2015, 14:56
MaGiC_PiKaChU's Avatar
MaGiC_PiKaChU MaGiC_PiKaChU is offline
Drive Coach
AKA: Antoine L.
FRC #3360 (Hyperion)
Team Role: Mentor
 
Join Date: Mar 2014
Rookie Year: 2012
Location: Sherbrooke
Posts: 608
MaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond repute
Re: Need A Little Help On How To Make Autonomous Switcher

i usually use a DIO switch on the bot.

I read the value in the robot init method so when i place the bot on the field
I have to select the auto mode before turning on the power.

Works well
__________________
2012 - 3360 - Junior member
2013 - 3360 - Lead Programmer, Human player
2014 - 3360 - Lead Programmer, Human player
2015 - 3360 - Lead Programmer, Driver
2016 - 3360 - Mentor, Drive coach



  #14   Spotlight this post!  
Unread 09-03-2015, 15:29
pribusin's Avatar
pribusin pribusin is offline
Uber Alien
AKA: Mike 1
FRC #4004 (M.A.R.S. Rovers)
Team Role: Coach
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Michigan
Posts: 168
pribusin has a spectacular aura aboutpribusin has a spectacular aura aboutpribusin has a spectacular aura about
Re: Need A Little Help On How To Make Autonomous Switcher

You can also use this board https://www.estoprobotics.com/estore...d&productId=33 which plugs into your DS laptop via usb and enumerates like a joystick with analog and digital inputs. You can then build a box on your DS that has switches which you can read in your auton code to determine which auton routine to run.
Closed Thread


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 01:51.

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