{"id":3511,"date":"2023-09-14T23:37:41","date_gmt":"2023-09-15T03:37:41","guid":{"rendered":"https:\/\/team2869.org\/?p=3511"},"modified":"2023-09-14T23:37:42","modified_gmt":"2023-09-15T03:37:42","slug":"preseason-september-13th-summary","status":"publish","type":"post","link":"https:\/\/team2869.org\/?p=3511","title":{"rendered":"Preseason: September 13th Summary"},"content":{"rendered":"\n<h2>Operations:<\/h2>\n\n\n\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\"><figure class=\"wp-block-media-text__media\"><img decoding=\"async\" src=\"https:\/\/team2869.org\/wp-content\/uploads\/2023\/09\/IMG_0181-775x1024.jpg\" alt=\"\" class=\"wp-image-3512 size-full\"\/><\/figure><div class=\"wp-block-media-text__content\">\n<p>Created the JDRF One Walk Team and a flyer for the event. We posted everything in FIRST Together to give information and we printing out these flyers in color in order to hang around Bethpage High to inform our peers. As well as this, we began planning on what snacks to offer for our annual Regal Eagle movie night. We came up with ideas and policies for this years season of FRC. Miraj Shah (Drive Coach) and Ankur Raghavan (VP of Engineering) from our team met with new FLL coaches and helped them understand this season better while giving advice for what is needed for a good project and team. We look forward to provide mentorship as the year progresses.<\/p>\n<\/div><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2>Programming:<\/h2>\n\n\n\n<p>All arm movement commands have been generalized to ArmMove.java with inputs of an enum and delay for pivot and wrist. All commands have been replaced by &#8220;command wrappers&#8221; which are sequential command groups with one command &#8211; ArmMove &#8211; and the correct enum\/delay. Made it so position is only set once, so the adjustments work properly, even if command doesn&#8217;t end. We removed unused code + old auto stuff, need to make auto stuff with pathplanner next. The code has a function where the values for our arm setpositions can be adjusted live on the fly by our operator. The operator can then save the position and that position will be used from that point onwards. This is accomplished by all of our pivot and wrist setpoints being written to a text file in the deploy directory. When the robot starts it will read that file to find the setpoints. Then when the positions are adjusted and saved, the file gets overwritten with the new setpoints. This way the setpoints are able to be changed in code and persist across save files. One thing we are looking to add is a backup system that automatically backs up old versions of the setpoints in case we accidentally save it in a bad position and we don&#8217;t have time to go back and find the correct spot.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package frc.robot.commands;\r\n\r\nimport edu.wpi.first.wpilibj2.command.CommandBase;\r\nimport frc.robot.Constants;\r\nimport frc.robot.Constants.PivotConstants;\r\nimport frc.robot.Constants.WristConstants;\r\nimport frc.robot.Constants.PivotConstants.PositionsPivot;\r\nimport frc.robot.Constants.WristConstants.PositionsWrist;\r\nimport frc.robot.subsystems.PivotSubsystem;\r\nimport frc.robot.subsystems.WristSubsystem;\r\n\r\npublic class ArmMove extends CommandBase {\r\n\tprivate boolean hasRun = false;\r\n\r\n\tprivate double startTime;\r\n\r\n\tprivate final PivotSubsystem pivot;\r\n\tprivate final WristSubsystem wrist;\r\n\r\n\tprivate final double targetPivotPos;\r\n\tprivate final double targetWristPos;\r\n\r\n\tprivate final PositionsPivot pivotEnum;\r\n\tprivate final PositionsWrist wristEnum;\r\n\r\n\tprivate final double pivotDelay;\r\n\tprivate final double wristDelay;\r\n\r\n\tprivate int pivotCounter;\r\n\tprivate int wristCounter;\r\n\r\n\tprivate boolean pivotDone;\r\n\tprivate boolean wristDone;\r\n\r\n\tprivate boolean hasSetPivot = false;\r\n\tprivate boolean hasSetWrist = false;\r\n\r\n\tpublic ArmMove(PositionsPivot pivotEnum, PositionsWrist wristEnum, double pivotDelay, double wristDelay) {\r\n\t\tpivot = PivotSubsystem.getInstance();\r\n\t\twrist = WristSubsystem.getInstance();\r\n\r\n\t\tthis.pivotEnum = pivotEnum;\r\n\t\tthis.wristEnum = wristEnum;\r\n\r\n\t\tthis.targetPivotPos = PivotConstants.getTargetPos(pivotEnum);\r\n\t\tthis.targetWristPos = WristConstants.getTargetPos(wristEnum);\r\n\r\n\t\tthis.pivotDelay = pivotDelay;\r\n\t\tthis.wristDelay = wristDelay;\r\n\r\n\t\taddRequirements(pivot);\r\n\t\taddRequirements(wrist);\r\n\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void execute() {\r\n\t\tif (!hasRun) {\r\n\t\t\tstartTime = Constants.autoTimer.get();\r\n\t\t\tSystem.out.println(startTime + \": Arm Movement:\" + pivotEnum.name());\r\n\t\t\thasRun = true;\r\n\t\t}\r\n\r\n\t\tif((Constants.autoTimer.get()-startTime)>pivotDelay &amp;&amp; !hasSetPivot){\r\n\t\t\tpivot.position(targetPivotPos);\r\n\t\t\tpivot.setCurrentPosition(pivotEnum);\r\n\t\t\thasSetPivot = true;\r\n\t\t}\r\n\r\n\t\tif((Constants.autoTimer.get()-startTime)>wristDelay &amp;&amp; !hasSetWrist){\r\n\t\t\twrist.position(targetWristPos);\r\n\t\t\twrist.setCurrentPosition(wristEnum);\r\n\t\t\thasSetWrist = true;\r\n\t\t}\r\n\t}\r\n\r\n\t@Override\r\n\tpublic boolean isFinished() {\r\n\t\tpivotDone = Math.abs(pivot.getAngle() - targetPivotPos) &lt; PivotConstants.tolerance;\r\n\t\twristDone = Math.abs(wrist.getAngle() - targetWristPos) &lt; WristConstants.tolerance;\r\n\r\n\t\tif (wristDone) {\r\n\t\t\twristCounter++;\r\n\t\t} else {\r\n\t\t\twristCounter = 0;\r\n\t\t}\r\n\t\tif (pivotDone) {\r\n\t\t\tpivotCounter++;\r\n\t\t} else {\r\n\t\t\tpivotCounter = 0;\r\n\t\t}\r\n\t\tif (pivotCounter > Constants.pidTimer &amp;&amp; wristCounter > Constants.pidTimer) {\r\n\t\t\tSystem.out.println(Constants.autoTimer.get() + \": Arm Movement Done:\" + pivotEnum.name());\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void end(boolean isInterrupted) {\r\n\t}\r\n}<\/code><\/pre>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile\"><div class=\"wp-block-media-text__content\">\n<p>At the end of the 2023 season, we realized that we needed more buttons than were on a standard xbox controller. The solution? Two xbox controllers. At champs, the operator used the buttons across 2 xbox controllers to control the different setpoints of the arm and the intake. Post-season we looked into different button boards, and ended up purchasing the X-Keys 60. We have planned out and programmed each of the buttons on this new button board. Here is a photo of the button board layout. We decided to make every action across 2 buttons, so they will be easier for the operator to press. Stopping the Arm\/Intake is across 8 and 4 buttons respectively because they are more important buttons. The top row besides the stop button is used for on the fly adjustment. The left-most column is for scoring from the back, center left is for pickup, center right for scoring from the front, and right-most for intake.<\/p>\n<\/div><figure class=\"wp-block-media-text__media\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"888\" src=\"https:\/\/team2869.org\/wp-content\/uploads\/2023\/09\/IMG_1030-1024x888.jpg\" alt=\"\" class=\"wp-image-3514 size-full\" srcset=\"https:\/\/team2869.org\/wp-content\/uploads\/2023\/09\/IMG_1030-1024x888.jpg 1024w, https:\/\/team2869.org\/wp-content\/uploads\/2023\/09\/IMG_1030-300x260.jpg 300w, https:\/\/team2869.org\/wp-content\/uploads\/2023\/09\/IMG_1030-768x666.jpg 768w, https:\/\/team2869.org\/wp-content\/uploads\/2023\/09\/IMG_1030-1536x1333.jpg 1536w, https:\/\/team2869.org\/wp-content\/uploads\/2023\/09\/IMG_1030-2048x1777.jpg 2048w, https:\/\/team2869.org\/wp-content\/uploads\/2023\/09\/IMG_1030-1245x1080.jpg 1245w, https:\/\/team2869.org\/wp-content\/uploads\/2023\/09\/IMG_1030-600x521.jpg 600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Operations: Created the JDRF One Walk Team and a flyer for the event. We posted everything in FIRST Together to give information and we printing out these flyers in color in order to hang around Bethpage High to inform our peers. As well as this, we began planning on what snacks to offer for our&hellip; <br \/> <a class=\"read-more\" href=\"https:\/\/team2869.org\/?p=3511\">Read more<\/a><\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[97],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/team2869.org\/index.php?rest_route=\/wp\/v2\/posts\/3511"}],"collection":[{"href":"https:\/\/team2869.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/team2869.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/team2869.org\/index.php?rest_route=\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/team2869.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3511"}],"version-history":[{"count":2,"href":"https:\/\/team2869.org\/index.php?rest_route=\/wp\/v2\/posts\/3511\/revisions"}],"predecessor-version":[{"id":3515,"href":"https:\/\/team2869.org\/index.php?rest_route=\/wp\/v2\/posts\/3511\/revisions\/3515"}],"wp:attachment":[{"href":"https:\/\/team2869.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/team2869.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/team2869.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}