|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Need A Little Help On How To Make Autonomous Switcher
I would use SmartDashboard/SendableChooser, it'll be easier.
|
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
Re: Need A Little Help On How To Make Autonomous Switcher
Quote:
|
|
#4
|
||||
|
||||
|
Re: Need A Little Help On How To Make Autonomous Switcher
Quote:
It should be pretty easy to write an equivalent in Java using reflection/etc. I'm surprised I've never seen one. |
|
#5
|
||||
|
||||
|
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 |
|
#6
|
|||
|
|||
|
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.
|
|
#7
|
||||
|
||||
|
Re: Need A Little Help On How To Make Autonomous Switcher
Quote:
|
|
#8
|
||||
|
||||
|
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.
|
|
#9
|
|||
|
|||
|
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. |
|
#10
|
|||
|
|||
|
Re: Need A Little Help On How To Make Autonomous Switcher
Quote:
|
|
#11
|
|||||
|
|||||
|
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 ![]() |
|
#12
|
||||
|
||||
|
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|