Fresh start ; created for the 2025 season; transition to python
This repository contains the code for our FRC robot using Python, PyRobot, and WPILib.
-
Create a python based profile in your VS Code: optional profile file
-
Make sure you have Python 3.12.5
python --version ------------------------ OUTPUT: Python 3.12.5
1a. If not go to [Other Resources] and download it.
- Clone the repository:
git clone https://github.com/Team2556/RobotPython2025.git cd RobotPython2025
- ??automatic for newcomer?? Activate the virtual environment:
On Windows: venv\Scripts\activate On macOS/Linux: source venv/bin/activate
- ??automatic for newcomer?? Install the dependencies:
pip install . #the dot references your current directory
- Run the robot code:
python src/robot.py
- We plan to use the following structure.
FRC-Robot-Project/ ├── robot.py ├── constants.py ├── subsystems/ │ ├── __init__.py │ └── example_subsystem.py ├── commands/ │ ├── __init__.py │ └── example_command.py ├── autonomous/ │ ├── __init__.py │ └── example_command.py ├── pathplanner/deploy/pathplanner/ │ ├── autos │ └── paths ├── tests/ │ ├── __init__.py │ └── test_robot.py ├── .gitignore ├── README.md ├── pyproject.toml └── venv/
- Download python (3.12.5): https://www.python.org/downloads/windows/
- Python tutorial: https://docs.python.org/3.12/tutorial/index.html
- More instructions from WPI: https://docs.wpilib.org/en/stable/docs/zero-to-robot/step-2/python-setup.html
- deploy Python to RoboRIO: https://docs.wpilib.org/en/stable/docs/software/python/subcommands/deploy.html
- Command based programming: https://docs.wpilib.org/en/latest/docs/software/commandbased/what-is-command-based.html
TODO: Refer to our main github readme or sync here.... In the VS Code Extensions sidbar, these codes should help you find usefull extensions (well.. Git and Python are required)
- ms-python.python
- github.vscode-pull-request-github
- github.copilot
- ms-python.black-formatter
- njpwerner.autodocstring
- tamasfe.even-better-toml
- streetsidesoftware.code-spell-checker
- Clone the repository:
git clone https://github.com/Team2556/RobotPython2025.git cd RobotPython2025
- Create a vertual environment (from a terminal; in the repo directry on your pc)
python -m venv venv
- Activate the virtual environment:
On Windows: venv\Scripts\activate On macOS/Linux: source venv/bin/activate
- initialize robotpy
py -m robotpy init
- Run the robotpy sync to get the RoboRIO python
py -m robotpy sync
- Run the robot code:
python src/robot.py