package Ġorg . first insp ires . ft c . team code Ċ Ċ import Ġcom . david . re char ged kotlin library . internal . hardware . Hardware Maker Ċ import Ġcom . qual comm . robot core . event loop . op mode . Linear Op Mode Ċ import Ġcom . qual comm . robot core . event loop . op mode . Tele Op Ċ import Ġcom . qual comm . robot core . hardware . Dc Motor Simple Ċ import Ġkotlin . math . absolute Value Ċ Ċ @ Tele Op Ċ class ĠMotor Testing Ġ: ĠLinear Op Mode () Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġrun Op Mode () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlf Ġ= ĠHardware Maker . Dc Motor Ex . make ( hardware Map , Ġ" lf ") ĊĠĠĠĠĠĠĠ Ġval Ġlb Ġ= ĠHardware Maker . Dc Motor Ex . make ( hardware Map , Ġ" lb ") ĊĠĠĠĠĠĠĠ Ġval Ġrf Ġ= ĠHardware Maker . Dc Motor Ex . make ( hardware Map , Ġ" rf ", ĠD c Motor Simple . Direction . RE VERSE ) ĊĠĠĠĠĠĠĠ Ġval Ġrb Ġ= ĠHardware Maker . Dc Motor Ex . make ( hardware Map , Ġ" rb ", ĠD c Motor Simple . Direction . RE VERSE ) ĊĊĠĠĠĠĠĠĠ Ġval Ġlift L Ġ= ĠHardware Maker . Dc Motor Ex . make ( hardware Map , Ġ" lift L ") ĊĠĠĠĠĠĠĠ Ġval Ġlift R Ġ= ĠHardware Maker . Dc Motor Ex . make ( hardware Map , Ġ" lift R ", ĠD c Motor Simple . Direction . RE VERSE ) ĊĊĠĠĠĠĠĠĠ Ġval Ġextension Ġ= ĠHardware Maker . Dc Motor Ex . make ( hardware Map , Ġ" extension ", ĠD c Motor Simple . Direction . RE VERSE ) ĊĠĠĠĠĠĠĠ Ġval Ġint ake Ġ= ĠHardware Maker . Dc Motor Ex . make ( hardware Map , Ġ" int ake ", ĠD c Motor Simple . Direction . RE VERSE ) ĊĊĠĠĠĠĠĠĠ ĠwaitFor Start () ĊĊĠĠĠĠĠĠĠ Ġwhile Ġ( op Mode IsActive ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtelemetry . add Line (" gamepad 1 Ġleft Y Ġfor Ġleft Side ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtelemetry . add Line (" gamepad 1 Ġright Y Ġfor Ġright Side ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtelemetry . add Line (" gamepad 1 Ġtriggers Ġfor Ġlift ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtelemetry . add Line (" gamepad 2 Ġleft Y Ġfor Ġint ake ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtelemetry . add Line (" gamepad 2 Ġright Y Ġfor Ġextension ") ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġleft Signal Ġ= Ġ- gamepad 1 . left _ stick _ y . toDouble () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġright Signal Ġ= Ġ- gamepad 1 . right _ stick _ y . toDouble () ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġlift Signal Ġ= Ġ( gamepad 1 . right _ trigger Ġ- Ġgame pad 1 . left _ trigger ). toDouble () ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġint ake Signal Ġ= Ġ- gamepad 2 . left _ stick _ y . toDouble () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġextension Signal Ġ= Ġ- gamepad 2 . right _ stick _ y . toDouble () ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġlf . power Ġ= Ġleft Signal . clip Main Threshold () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlb . power Ġ= Ġleft Signal . clip Main Threshold () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrf . power Ġ= Ġright Signal . clip Main Threshold () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrb . power Ġ= Ġright Signal . clip Main Threshold () ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġlift L . power Ġ= Ġlift Signal . clip Main Threshold () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlift R . power Ġ= Ġlift Signal . clip Main Threshold () ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġint ake . power Ġ= Ġint ake Signal . clip Main Threshold () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġextension . power Ġ= Ġextension Signal . clip Main Threshold () ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġtelemetry . update () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun ĠDouble . clip Main Threshold () Ġ= Ġclip Threshold ( 0 . 1 ) Ċ fun ĠDouble . clip Threshold ( threshold : ĠDouble ) Ġ= Ġif Ġ( this . absolute Value Ġ< Ġthreshold ) Ġ 0 . 0 Ġelse Ġthis