Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autonomous Period #4

Open
sprice134 opened this issue Jan 23, 2020 · 4 comments
Open

Autonomous Period #4

sprice134 opened this issue Jan 23, 2020 · 4 comments

Comments

@sprice134
Copy link
Collaborator

sprice134 commented Jan 23, 2020

Screen Shot 2020-01-22 at 7 06 14 PM

Our Robot will stat somewhere on the initiation line. Rules state
  • "Each TEAM stages their ROBOT such that at least part of its BUMPERS are intersecting the infinite vertical volume created by the corresponding ALLIANCE’S INITIATION LINE. If order placement matters to either or both ALLIANCES, the ALLIANCE must notify the Head REFEREE during setup for that MATCH. Upon notification, the Head REFEREE will require ALLIANCES to alternate placement of all ROBOTS. In a Qualification MATCH, ROBOTS are placed in the following order: Red Station 1 ROBOT, Blue Station 1 ROBOT, Red Station 2 ROBOT, Blue Station 2 ROBOT, Red Station 3 ROBOT, Blue Station 3 ROBOT. In a PLAYOFF MATCH, the same pattern is applied, but instead of Blue ALLIANCE placing last, the higher-seeded ALLIANCE (regardless of color) places last"

Which by my understanding means that we can position it wherever we want and at whatever angle we want so long as we maintain the proper order. The Initiation Line is 10 feet from the wall which ideally we will be able to shoot from. By this, we can line the robot best we can before booting up. And once the autonomous period starts, to auto-line up whatever corrective angle we need. After lining up, and shooting (which will gain us somewhere between 12 and 18 points) then all we need to do is move off of the initiation line to gain the 5 points. Arguably it would be best to just move enough to get off the line and not attempt to navigate the field (to not incite tech foul of 15 points or potentially harming alliance robot) We can build two functions one to move forward and one to move back just enough to get off the line and then sit and wait until autonomous is over (only a couple seconds) and then resume play in teleop. limited movement would be ideal in autonomous

@cmarley3-14
Copy link
Collaborator

cmarley3-14 commented Jan 23, 2020

So then after we auto-align the angle, we either vary distance to the goal (drive forward/backward), shooting power, or shooting angle?

  • Unless we have an excellent encoder on the shooter, we probably shouldn't angle it.
  • A motor can supply consistent voltage for shooting power, and some trial and error should get us a formula (started 10 ft from wall, rotated # degrees, find hypotenuse, calculate new trajectory velocity)
  • If we got the imu (gyro/accel-meter), then moving back and forth shouldn't be a problem either. Actually, we can't figure out our rotated angle without a gyro, so it's also necessary for above point too
  • Worst-case scenario: We position the robot a known distance along the initiation line and again use trig to find new trajectory velocity, and use the vision tracking to align that way.

(which will gain us somewhere between 12 and 18 points)

Very optimistic. Realistically, 0 to 18. 😉 😋

Team preference should be lining up to the left of the power port, and backing up (easy coding!) after auto. We steal the balls off the blue rendezvous barrier or our trench. Then... skill, practice, and luck.

@sprice134
Copy link
Collaborator Author

We do not actually need an encoder to modify the angle. If we mount the camera to the targeting system such that when the targeting system angles, the camera moves with it, a simple position will tell us if we are lined up or not.
I agree about the gyro/accel that we "need" it but we don't need it for this. Lining up would be done by vision tracking not angle relative to the field and all we need to get the points for moving off of the initiation line is to no longer be in contact with it. That doesn't actually mean a controlled movement. Send current to the motor for 2 seconds and poof we met the requirement.

And come on, if we are being realistic, it is 5-18 points. If we aren't even getting the points for moving off of the line, we didn't do our job properly.

Also, our location in regards to the left middle or right with an alliance is entirely random. We could tell the referee beforehand that we had to be on the one side, but after a couple of matches I see the referee getting mighty displeased

@amhsrobotics4681
Copy link
Owner

amhsrobotics4681 commented Feb 6, 2020

When we get the time (i.e. friday or saturday)

Add/Change in BallSystem.java

public void ballSystemInit() {
    currentlyShooting = true; // for autonomous purposes --> see Robot.java changes
}

public boolean currentlyShooting() {
    return currentlyShooting;
}

// if we have variable shooting power, this is a modification we can make
public void resetShooter(int distance) {
    double power = FUNCTION(distance); // need to create function to determine this
    m_shooter.set(power);
}

Add/Change in Robot.java

@Override
public void autonomousPeriodic() {
    // align function
    if (aligned)
        m_ball.resetShooter();
    if (!m_ball.currentlyShooting() && getDistance < 180)
        m_drive.arcadeDrive(-1,0); // drive backwards 5 feet ^^^
    m_ball.mainMethod();
}
// Add stuff with the LIDAR sensor
// Also put new DIO in constants for this

Add/Change in Wheel.java

public void rotationControl() {
    if (!status.equals("Rotation")) {// so we don't reset during rotation control

^^^ Between lines 44 and 45

@cmarley3-14
Copy link
Collaborator

Eric and Ben suggest doing an align toggle (which I agree with) (or course, this won't be necessary if we can't vision align...) (just part of an ongoing to do list)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants