Members Only

PedroPathing: Auto Examples

kr 0,00 NOK

Quick example of how to write an autonomous program using PedroPathing 2.0. This program assumes your robot is lined up parallel with the BLUE goal depot, with both wheels touching.

This is set up to give you an idea of how to program an autonomous path using PedroPathing. It is not intended in it's current state to be a drag + drop code (as my robot test chassis' PIDF is likely significantly different than yours) 

There are x2 paths attached. 

1. SampleAutoPathing

(November) This is the code snipped that corresponds to the following tutorial. (Goes live on Youtube Monday, Nov 24th, but Members get early access in posts tab) 

2. PedroPathingAutoTest

(October) In this code, there are more advanced features added. all locations are ARBITRARY. They do NOT correlate presently to the actual spike markers, and are simply tests to run on the limited tiles I had at home. 

The robot will:

  1. drive away from the goal
  2. pause to simulate shooting
  3. drive slowly towards spike mark 1
  4. drive to shooting position & pause to simulate shooting
  5. drive slowly toward spikemark 2
  6. drive to shooting position & pause to simulate shooting
  7. return to starting position

Note: you should NOT return to starting position, as you want to gain the LEAVE points for ranking points in auto. 

3 & 4. Autonomous + Actions

FlywheelExampleServo & SampleActions

How to have additonal state machines running in conjunction with your pathing state machine. 

Accessing STEP Files

STEP files are uploaded in a .zip folder. You must first unzip the folder in order to import the file into your CAD program of choice. 

Autodesk Fusion 360

  1. After unzipping the downloaded folder, open Fusion 360.

  2. Click the "Show Data Panel" icon in the upper-left corner (it looks like a grid/waffle).

  3. Navigate to your desired project and folder.

  4. Click the "Upload" button.

  5. Select the .step or .stp file from your computer and click "Open."

  6. Once the upload is complete, the file will appear in your Data Panel, ready to be inserted into your design.

Detailed Instructions

Onshape

  1. After unzipping the downloaded folder, log in to your Onshape account.

  2. From the "Documents" page, click the "Create" button and select "Import files...".

  3. Alternatively, inside an existing document, click the "+" icon in the bottom-left corner and select "Import."

  4. Select the .step or .stp file from your computer.

  5. Choose your desired import options in the dialog box.

  6. The imported file will appear as a new tab in your document.

Detailed Instructions

SolidWorks

  1. After unzipping the downloaded folder, open SolidWorks.

  2. Go to "File" > "Open."

  3. In the "Open" dialog box, change the file type to "STEP files (*.step, *.stp)."

  4. Navigate to and select the STEP file you wish to import.

  5. Click "Open."

  6. SolidWorks may prompt you to run "Import Diagnostics" to check for and fix any potential issues with the imported geometry. It is recommended to do so.

Detailed Instructions

3D Printing Tips

If the design includes 3D printed parts, I highly recommend you print the part out of PCTG. It has some of the highest impact resistance and non-catastrophic breaking for robot parts.

  • If you're looking for a brand, 3D-Fuel is pretty solid in the Americas
  • Azure is better in the EU

For Mechanical/structural parts, I recommend: 

  • 0.6mm Nozzles over 0.4mm. Wider nozzles produce stronger prints in shorter periods of time over thinner nozzles. 
  • Minimum 4 walls. 
  • 30-40% gyroid infill