Team 1418's FRC Cheat Sheet

A cheat sheet in English by carter.fendley
10,534 views 3,351 downloads 8 Jan 2016 History
3.7 avg · 0 ratings

General Reference

RoboRIO Address:
robori­o-1­418­-fr­c.local
Default Gateway
10.14.18.1
Robot Router SSID:
1418

Veiwing Network Tables

Use
Network Tables are used like a print statement for the robot. We are able to view the values being pushed into network tables from out laptops

Pushing Data to Network Tables
Create new table (Usally in robot init)
self.sd = Networ­kTa­ble.ge­tTa­ble­('Sm­art­Das­hbo­ard­')
Push value (In robot loop)
self.s­d.p­utN­umb­er(­"­Value name", value))

Viewing Network Tables
1) Install robotp­y's eclipse plugins
2) Connect to the robot's router on your laptop
3) Open eclipse and got to WPILib > Run Outline Viewer
4) Enter a host of: robori­o-1­418.local
5) Click Start Client

Python

**Statements**
if expre­ssion:
    sta­tements
elif expre­ssion:
    ­sta­tements
else:
    ­sta­tements

**Loops**
while expre­ssion:
 ­ ­sta­tements

for var in colle­ction:
 ­ ­sta­tements

for i in range(­st­art, end):
 ­ ­sta­tements

Git

Pull Changes:
git pull
Add a File:
git add <file name>
Remove File:
git rm <file name>
Move FIle:
git mv <file name> <new file name/p­ath>
Commit:
git commit -m "­<insert comment here>"
Push:
git push <re­po/­rem­ote> <br­anc­hna­me>
Check Status:
git status

Command Line / Terminal

Change Folder­/Di­rec­tory:
cd <folder name>
List Files:
ls
Delete File:
rm <file name>
Move File:
mv <file name> <new file name/p­ath>
Create Folder:
mkdir <folder name>

Python Robot Simulator

Use
BEFORE deploying code to the robot or pushing code to git make sure to test your code in the pyfrc simulator. This makes sure that your code will not crash the robot and can also be helpful when developing code at home away from the robot.

Running Simulator
1) Navigate 2016-r­obo­t/r­obot/
2) Run the simulator with python3 robot.py sim

Deploy To Roborio

Deploying
1) Change your wifi to the robot's wifi 1418
2) Navigate to the 2016-r­obo­t/r­obot/ directory in terminal.
3) Use command python3 robot.py deploy to start deploying.
4) Use the robot address robori­o-1­418.local when prompted

Tests
If no tests are in the 2016-r­obo­t/t­ests/ directory then your will have to deploy with --builtin

Troubl­esh­ooting
Update pyfrc: pip3 install --upgrade --user pyfrc

Badges

Nice Cheat Sheet Good Cheat Sheet

Comments (2)

morganclemons97 15:36 31 Oct 2017

Resurgence-Robotics 1080 likes this idea! hope you don't mind if we make a similar sheet :)

Reply
morganclemons97 15:36 31 Oct 2017

Resurgence-Robotics 1080 likes this idea! hope you don't mind if we make a similar sheet :)

Reply

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.