Cheatography
https://cheatography.com
General ReferenceRoboRIO Address: | roborio-1418-frc.local | Default Gateway | 10.14.18.1 | Robot Router SSID: | 1418 |
DocumentationRobotPy Setup: | | PyFRC / WPILib: | | PyFRC Extras: | |
Veiwing Network TablesUse
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 = NetworkTable.getTable('SmartDashboard')
Push value (In robot loop)
self.sd.putNumber("Value name", value))
Viewing Network Tables
1) Install robotpy'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: roborio-1418.local
5) Click Start Client |
PythonStatements
if expression:
statements
elif expression:
statements
else:
statements
Loops
while expression:
statements
for var in collection:
statements
for i in range(start, end):
statements
|
| | GitPull 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/path>
| Commit: | git commit -m "<insert comment here>"
| Push: | git push <repo/remote> <branchname>
| Check Status: | git status
|
Command Line / TerminalChange Folder/Directory: | cd <folder name>
| List Files: | ls
| Delete File: | rm <file name>
| Move File: | mv <file name> <new file name/path>
| Create Folder: | mkdir <folder name>
|
Python Robot SimulatorUse
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-robot/robot/
2) Run the simulator with python3 robot.py sim |
Deploy To RoborioDeploying
1) Change your wifi to the robot's wifi 1418
2) Navigate to the 2016-robot/robot/ directory in terminal.
3) Use command python3 robot.py deploy to start deploying.
4) Use the robot address roborio-1418.local when prompted
Tests
If no tests are in the 2016-robot/tests/ directory then your will have to deploy with --builtin
Troubleshooting
Update pyfrc: pip3 install --upgrade --user pyfrc |
|
Help Us Go Positive!
We offset our carbon usage with Ecologi. Click the link below to help us!
Created By
Metadata
Favourited By
Comments
Resurgence-Robotics 1080 likes this idea! hope you don't mind if we make a similar sheet :)
Resurgence-Robotics 1080 likes this idea! hope you don't mind if we make a similar sheet :)
Add a Comment
More Cheat Sheets by carter.fendley