Pure Python codebase using RobotPy with the MagicBot framework.
-
If not already installed, install UV and git.
- Not used git before? Be sure to set your username and email.
-
Clone the GitHub repo. One way is to run this command in a terminal:
git clone git@github.com:Phrogz/MagicBotTestFramework.git
-
In a terminal in the working directory for the cloned files (hint:
cd MagicBotTestFramwork), run:uv sync # Create a virtual python environment with necessary pre-requisites uv run robotpy sync # Install all the robotpy libraries
-
Open the folder in VS Code.
- Though there's little likelihood of conflict, you may wish to create a new VS Code profile with only the recommended VS Code extensions installed.
See lots of sample code in RobotPy Examples for isolated snippets demonstrating how to accomplish common tasks.
Open a Terminal in VS Code (hint: ctrl+`, or ), and then run robotpy sim to start the simulator.
-
Note that when you open a Terminal inside VS Code it should automatically activate the virtual environment for you. This is what enables
robotpyas its own command, without theuv runprefix.If VS Code does not activate the virtual environment automatically, you can run
source .venv/bin/activate. 🤮 -
If you connect a PS4 controller, you should be able to drive the robot around in the simulator using the left and right sticks.
Note that the first time you will need to drag the controller from the "System Joysticks" window onto "Joystick 0" in the "Joysticks" window to connect the controller to the right joystick "port".