Skip to content

FRC team 4941's code for 2017's game - SteamWorks

License

Notifications You must be signed in to change notification settings

dvtate/robot2017

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

main-bot-2017

This is our primary cobot code.

What We Want to Show Off:

Controller code

  • we have spent 2 years perfecting our driving code, it has better consumption characteristics and behavior than the standard arcadeDrive function
  • utils::removeGhost(double): removes input which could come from inacurate controllers
  • utils::expReduceBrownout(double, double&): averages previous value in with the first one to make changes less extreme and round edges; plots calculated input onto a curve
  • utils::linReduceBrownout(double, double, dobule&): if the change in input value is too great it changes the change to the limit given. This hasn't been tested, but could be used in combination with utils::expReduceBrownout.

Automatic Driver

  • Because the drive-train isn't perfect and the carpet doesn't give uniform traction, we can gain from being able to drive perfectly straight without veering off course.
  • utils::driveStraight(ADXRS450_Gyro&, RobotDrive&, double, double): uses the angle measurement from the gyro as the turning value. Drives straight at a given speed for a given number of seconds

Goals & Progress:

  • Side-peg autonomous:
  • (done) use gyro to drive straight and correct for imperfect drive-train
  • (nope) use ultrasonic to stop once we are the correct distance out (hardware issues)
  • (done) use vision to identify the retro-reflective tape on the sides of the peg
  • (nope) calculate degrees needed to point at the peg. We also need to account for offset camera (we have an equation for this)
  • (nope) use gyro and PIDController object to turn the calculated degrees (const calibration consumes time)

Rules for editing:

  • Put all changes in your commit description
  • If you need a text editor, I recommend you install eclipse to take full advantage of it's syntax highlighting, error detection, and integrated documentation
  • Include lots of comments (use consice language so we don't have to read an essay)
  • a great person once said "good code explains itself" : use self-explanatory names, syntax, organization, grouping, etc. and write code that is easy to read.
  • KISS = Keep It Simple Stupid
  • Have Fun :)
  • You must be a RoboBibb Student to commit/PR.

Hardware

Drive Train

  • 6 sim drive-train
  • 6 spark motor controllers
  • using 4 pwm ports

Cameras

  • front-facing AXIS 206 camera for vision
  • rear-facing Lifecam HD 3000

Winch

  • We have a winch on the back of the robot for climbing, 25:1 gear ratio

Gyro

Current Functionality (summary, may be out of date):

Tele-op:

Controls:

  • 2 X-Box 360 controllers - one for driving, the other for climbing
  • Driver - Y reverses the controls (forward-reverse swap)
  • Driver - A activates the winch
  • Driver - B stops the winch
  • Driver - X toggles slow-mode (useful when accuracy is more important than speed)
  • Driver - left stick is clutch, right stick is steering
  • Climber - winch spins while trigger is pressed

Autonomous:

Middle Peg:

  • Uses gyro to drive up to middle peg