package Ġorg . first insp ires . ft c . team code . hardware . drive . tank Ċ Ċ import Ġcom . ac mer obot ics . dashboard . config . Config Ċ import Ġcom . qual comm . robot core . hardware . configuration . type containers . Motor Configuration Type Ċ import Ġorg . first insp ires . ft c . team code . hardware . drive . mot ors . Yellow J acket 5 2 0 2 _ 0 0 0 2 _ 0 0 1 9 Ċ import Ġorg . first insp ires . ft c . team code . util .* Ċ import Ġorg . first insp ires . ft c . team code . util . road runner .* Ċ import Ġorg . first insp ires . ft c . team code . util . units .* Ċ import Ġorg . first insp ires . ft c . team code . util . units . Met ers PerSecond Ċ Ċ @ Config Ċ object ĠT ank Drive Constants Ġ{ ĊĠĠĠ Ġprivate Ġval ĠM OT OR _ TYPE Ġ= ĠY ellow J acket 5 2 0 2 _ 0 0 0 2 _ 0 0 1 9 :: class . java ĊĠĠĠ Ġprivate Ġval ĠM OT OR _ CONFIG Ġ= ĠMotor Configuration Type . get Motor Type ( MOTOR _ TYPE ) ĊĠĠĠ Ġprivate Ġval ĠT IC KS _ PER _ REV Ġ= ĠM OT OR _ CONFIG . ticks Per Rev ĊĠĠĠ Ġprivate Ġval ĠMAX _ RP M Ġ= ĠRe volution s Per Minute ( MOTOR _ CONFIG . max RP M ) ĊĊĠĠĠ Ġ// ĠNe cessary Ġfor Ġtuning Ġvia ĠF TC ĠDashboard ĊĠĠĠ Ġ@ Jvm Field ĊĠĠĠ Ġpublic Ġvar Ġ_ W HE EL _ RADIUS _ IN : ĠDouble Ġ= Ġ 2 . 0 ĊĊĠĠĠ Ġ@ Jvm Field ĊĠĠĠ Ġpublic Ġvar Ġ_ TRACK _ WIDTH _ IN : ĠDouble Ġ= Ġ 1 . 0 ĊĊĠĠĠ Ġpublic Ġval ĠW HE EL _ RADIUS : ĠRR Distance Ġget () Ġ= ĠIn ches (_ W HE EL _ RADIUS _ IN ). road runner () ĊĠĠĠ Ġpublic Ġval ĠTR ACK _ WIDTH : ĠRR Distance Ġget () Ġ= ĠIn ches (_ TRACK _ WIDTH _ IN ). road runner () ĊĊĠĠĠ Ġ@ Jvm Field ĊĠĠĠ Ġpublic Ġvar ĠG EAR _ RATIO : ĠDouble Ġ= Ġ 1 . 0 ĊĊĠĠĠ Ġpublic Ġval ĠW HE EL _ C IRC UM FER ENCE : ĠRR Distance Ġget () Ġ= Ġ( W HE EL _ RADIUS Ġ* ĠTWO _ PI ). road runner () ĊĠĠĠ Ġpublic Ġval ĠDIST ANCE _ PER _ RE VOL UTION : ĠRR Distance Ġget () Ġ= Ġ( W HE EL _ C IRC UM FER ENCE Ġ* ĠG EAR _ RATIO ). road runner () ĊĊĠĠĠ Ġpublic Ġval ĠFE ED FORWARD Ġ= ĠD c Motor Character ization ( k V Ġ= Ġ 1 Ġ/ Ġ( rpm To Velocity ( MAX _ RP M ). road runner (). raw ), Ġk A Ġ= Ġ 0 . 0 , Ġk Static Ġ= Ġ 0 . 0 ) ĊĊĠĠĠ Ġpublic Ġval ĠAX IAL _ PID Ġ= ĠPID Coefficient s ( 0 . 0 , Ġ 0 . 0 , Ġ. 0 ) ĊĠĠĠ Ġpublic Ġval ĠHEAD ING _ PID Ġ= ĠPID Coefficient s ( 0 . 0 , Ġ 0 . 0 , Ġ. 0 ) ĊĠĠĠ Ġpublic Ġval ĠC ROSS _ TRACK _ PID Ġ= ĠPID Coefficient s ( 0 . 0 , Ġ 0 . 0 , Ġ. 0 ) ĊĊĠĠĠ Ġ@ Jvm Field ĊĠĠĠ Ġpublic Ġval ĠBASE _ CONSTRAINT S Ġ= ĠDrive Constraints ( In ches ( 3 0 ) Ġ/ ĠSecond s ( 1 ), ĠIn ches ( 3 0 ) Ġ/ ĠSecond s ( 1 ) Ġ/ ĠSecond s ( 1 ), ĠDe grees PerSecond ( 1 8 0 ), ĠDe grees PerSecond Squared ( 1 8 0 . 0 )) ĊĊĠĠĠ Ġfun Ġrpm To Velocity ( re volution Speed : ĠAngular Velocity ): ĠRR Velocity Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrev Per Sec Ġ= ĠRe volution s PerSecond ( re volution Speed ) ĊĠĠĠĠĠĠĠ Ġreturn ĠMet ers PerSecond ( Met ers ( DISTANCE _ PER _ RE VOL UTION ). raw Ġ* Ġrev Per Sec . raw ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. road runner () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġencoder Ticks To Distance ( ticks : ĠDouble ): ĠRR Distance Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġ( DISTANCE _ PER _ RE VOL UTION Ġ* Ġticks Ġ/ ĠT IC KS _ PER _ REV ). road runner () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġencoder Ticks To Distance ( ticks : ĠInt ) Ġ= Ġencoder Ticks To Distance ( ticks . toDouble ()) Ċ }