Log in

View Full Version : Double Tube Autonomous


LeelandS
13-03-2011, 20:04
Alright Chief Delphi community, this is something that I think needs to be talked about.

We've all seen a hand full of teams include a unique ability into their autonomous: The ability to hang two tubes in autonomous. I first heard of this phenomenon after hearing of the RoboWranglers inplementation of this. I then was able to witness it live during the Pittsburgh regional, from 1114.

I want to know your thoughts on this. How did they do it? What makes it work so precisely? Obviously, the act of hanging those two uber tubes is one that requires both serious speed and precision of control. Did they use a camera? Did they follow lines? What do you think?

Chris is me
13-03-2011, 20:05
You need a roller claw, patience, and practice. If you have those three things, you've got it.

davidthefat
13-03-2011, 20:06
From the looks of it, I am not impressed by the programming, but I am impressed for being able to do the feat. I heard 33 used a potentiometer to track the angle of the robot.

mwtidd
13-03-2011, 20:17
From the looks of it, I am not impressed by the programming, but I am impressed for being able to do the feat. I heard 33 used a potentiometer to track the angle of the robot.

Actually they use a gyro for that. Encoders for distance.

What I think is also an interesting question is how accurate the teams are.
First tube and second tube accuracy.
I know 40 had a good 1 tube cap, but when they went for 2 sometimes they missed both.

PatJameson
15-03-2011, 01:11
I know 40 had a good 1 tube cap, but when they went for 2 sometimes they missed both.

This may have been because they needed to speed up their first cap in order to have time to complete a second one.

Chris is me
15-03-2011, 01:27
They really didn't miss their first cap all that often. I think the match you reference is one where they just got unlucky.

As a side note, I'm glad with the completion of autonomous mode 40 got to show the virtues of a "single scorer" alliance.

Tom Bottiglieri
15-03-2011, 01:43
Alright Chief Delphi community, this is something that I think needs to be talked about.

We've all seen a hand full of teams include a unique ability into their autonomous: The ability to hang two tubes in autonomous. I first heard of this phenomenon after hearing of the RoboWranglers inplementation of this. I then was able to witness it live during the Pittsburgh regional, from 1114.

I want to know your thoughts on this. How did they do it? What makes it work so precisely? Obviously, the act of hanging those two uber tubes is one that requires both serious speed and precision of control. Did they use a camera? Did they follow lines? What do you think?
I can't speak for every team, but the way we are shooting to do this (competing this weekend) is by creating a queue of smaller, more controllable events. You can create a bunch of commands (Drive Distance, Turn Degrees, Raise Arm, etc), tune the heck out of each one separately, and then string them together to do something more difficult. The code from 254's robot last year had a system like this: http://www.chiefdelphi.com/media/papers/2397

We did the same type of thing in Java this year by creating an Interface for AutoModeCommands and making each one of our subtasks as a class that implements the interface. We could then just make a queue of tasks and execute them one by one. Easy. If you want to see more I can send you some code snippets.

From the looks of it, I am not impressed by the programming ... I heard 33 used a potentiometer to track the angle of the robot.You may not be impressed for the same reason you think a potentiometer can keep track of robot heading.

Tom Bottiglieri
15-03-2011, 15:09
If you want to see more I can send you some code snippets.


Here is the AutoModeController. You give this guy a list of commands, and then tell it to execute them.

public class AutoModeController {
// Variables

NutronsQueue cmdList = new NutronsQueue();
AutoModeCommand curCmd = null;

// Add commands
public void addCommand(AutoModeCommand cmd) {
cmdList.push(cmd);
}

public void flush() {
cmdList.removeAllElements();
curCmd = null;
}

// Execute commands
public void handle() {
boolean firstRun = false;
if(curCmd == null) {
curCmd = (AutoModeCommand) cmdList.pop();
if(curCmd != null) {
System.out.println("Popped a command: " + curCmd);
}
firstRun = true;
}

if(curCmd != null) {
if(firstRun) {
curCmd.init();
firstRun = false;
}
if(curCmd.doWork()) {
// this will happen when command is done
// Will grab next command on next call of handle()
curCmd.finish();
curCmd = null;
System.out.println("work done");
}
}
else {
// Maybe add something for do nothing?
}
}
}


Here's an example of an AutoModeCommand (In this case, it raises the elevator)

public class SignalElevatorPosCommand implements AutoModeCommand {

double wantedPos = 0;

public SignalElevatorPosCommand(double pos) {
wantedPos = pos;
}

public boolean doWork() {
ElevatorController.getInstance().gotoScoringPositi on(wantedPos);
return true;
}

public void init() {
// Init code for this command goes here!
}

public void finish() {
// Clean up goes here!
}
}


Here's a way to set it all up:

public class MyCoolAutonomousRobot extends IterativeRobot {

AutoModeController ac = new AutoModeController();

public void autonomousInit() {
ac.flush();
ac.addCommand(new DriveDistanceCommand(10, 0.75, 10)); // 10 feet, .75 power, 10 sec timeout
ac.addCommand(new SignalElevatorPosCommand(Elevator.POS_TOP_PEG));
ac.addCommand(new CapTubeCommand());
ac.addCommand(new DriveDistanceCommand(-10,0.75,10));
ac.addCommand(new TurnDegreesCommand(-180, 1.0, 3.0); // 180 deg, 1.0 max power, 3s timeout
}

public void autonomousPeriodic() {
ac.handle();
}
}


Hope this helps!

davidthefat
16-03-2011, 18:57
You may not be impressed for the same reason you think a potentiometer can keep track of robot heading.

I assumed it was for the motors to make a giant servo.

virtuald
17-03-2011, 19:06
For some reason I was under the impression that you could only start with one ubertube? Or did they grab a tube from their teammates...

PatJameson
17-03-2011, 23:40
For some reason I was under the impression that you could only start with one ubertube? Or did they grab a tube from their teammates...

This is correct.

<G06> Each ROBOT must be in contact with one UBERTUBE. No more than one ROBOT may be contacting an UBERTUBE.

Check out some double cap videos to see how some teams do it.

Kingofl337
18-03-2011, 18:03
I posted in this thread how we did it.

We did use Java.

Linky (http://www.chiefdelphi.com/forums/showpost.php?p=1041275&postcount=32)