Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 29 additions & 19 deletions source/docs/software/vscode-overview/creating-robot-program.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,38 +112,48 @@ Once we've decided on a base class, we can create our new robot project. Bring
.. image:: images/creating-robot-program/create-new-project.png
:alt: Highlights the "WPILib: Create a new project" command.

This will bring up the "New Project Creator Window:"
This will bring up the "WPILIb New Project Creator"

.. image:: images/creating-robot-program/new-project-creator.png
:alt: The new project creator screen.
:alt: The project type selector of the WPILib New Project Creator

The elements of the New Project Creator Window are explained below:
The **Project Type** chooses between an empty template project of one of the base classes, or a :doc:`WPILib example project </docs/software/examples-tutorials/wpilib-examples>`. Additionally, a template exists for :ref:`Command-based <docs/software/commandbased/commands-v2/what-is-command-based:What is "command-based" programming?>` projects, which are built on the :code:`TimedRobot` base class but include a number of additional features - this type of robot program is highly recommended for new teams.

1. **Project Type**: The kind of project we wish to create. This can be an example project, or one of the project templates provided by WPILib. Templates exist for each of the robot base classes. Additionally, a template exists for :ref:`Command-based <docs/software/commandbased/commands-v2/what-is-command-based:What is "command-based" programming?>` projects, which are built on the :code:`TimedRobot` base class but include a number of additional features - this type of robot program is highly recommended for new teams.
2. **Language**: This is the language (C++ or Java) that will be used for this project.
3. **Base Folder**: If this is a template project, this specifies the type of template that will be used.
4. **Project Location**: This determines the folder in which the robot project will be located.
5. **Project Name**: The name of the robot project. This also specifies the name that the project folder will be given if the Create New Folder box is checked.
6. **Create a New Folder**: If this is checked, a new folder will be created to hold the project within the previously-specified folder. If it is *not* checked, the project will be located directly in the previously-specified folder. An error will be thrown if the folder is not empty and this is not checked.
7. **Team Number**: The team number for the project, which will be used for package names within the project and to locate the robot when deploying code.
8. **Enable Desktop Support**: Enables unit test and simulation support (see :doc:`/docs/software/wpilib-tools/robot-simulation/introduction`).
After making the selections, click :guilabel:`Next`.

- **Java**: This option has no effect and can be left checked or unchecked
- **C++**: Checking this option enables desktop compilation, which is required for simulation and unit tests
- **Romi/XRP**: This option has no effect for Romi and XRP templates and can be left checked or unchecked
This will bring up the language and base selection window.

.. note:: While WPILib fully supports desktop builds, some third-party vendor libraries may not. If a library doesn't support desktop compilation, your C++ code may not compile or may crash when running simulation.
.. image:: images/creating-robot-program/new-project-creator-language.png
:alt: The language and base page of the WPILib New Project Creator

Once all the above have been configured, click "Generate Project" and the robot project will be created.
1. **Language**: This is the language (C++ or Java) that will be used for this project.
2. **Project Base**: This box is used to select the base class or example to generate the project from.

.. note:: Any errors in project generation will appear in the bottom right-hand corner of the screen.
After making the selections, click :guilabel:`Next`.

This will bring up the Project and Configuration window.

.. image:: images/creating-robot-program/new-project-creator-location.png
:alt: The project and configuration page of the WPILib New Project Creator

1. **Base Folder**: This determines the folder in which the robot project will be located.
2. **Project Name**: The name of the robot project. This also specifies the name that the project folder will be given if the Create New Folder box is checked.
3. **Create a New Folder**: If this is checked, a new folder will be created to hold the project within the previously-specified folder. If it is *not* checked, the project will be located directly in the previously-specified folder. An error will be thrown if the folder is not empty and this is not checked.
4. **Team Number**: The team number for the project, which will be used for package names within the project and to locate the robot when deploying code.
5. **Enable Desktop Support**: Enables unit test and simulation support (see :doc:`/docs/software/wpilib-tools/robot-simulation/introduction`).

.. warning:: Creating projects on OneDrive is not supported as OneDrive's caching interferes with the build system. Some Windows installations put the Documents and Desktop folders on OneDrive by default.

An example after all options are selected is shown below.
Once all the above have been configured, click :guilabel:`Next`.

This will bring up the Review and Create window.

.. image:: images/creating-robot-program/new-project-creator-configured.png
:alt: The new project creator screen filled out.
:alt: The review and create page of the WPILib New Project Creator

Double check all the settings and click :guilabel:`Create Project`. If anything is not correct, click :guilabel:`Back` and make the necessary corrections.

.. note:: Any errors in project generation will appear in the bottom right-hand corner of the screen.

## Opening The New Project

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,49 @@ Due to changes in the project, it is necessary to update the build files for a p

To make it easy for teams to import previous years gradle projects into the current year's framework, WPILib includes a wizard for importing previous years projects into VS Code. This will generate the necessary gradle components and load the project into VS Code. In place upgrades are not supported.

.. important:: The import process copies your project source files from the current directory to a new directory and completely regenerates the gradle files. Additionally, it updates the code for the package changes made in 2025. If you made non-standard updates to the ``build.gradle``, you will need to make those changes again. For this reason, in place upgrades are not supported. It is also necessary to import vendor libraries again, since last year's vendor libraries must be updated to be compatible with this year's projects.
.. important:: The import process copies your project source files from the current directory to a new directory and completely regenerates the gradle files. Additionally, it updates the code for the package changes and reorganization made in 2027. If you made non-standard updates to the ``build.gradle``, you will need to make those changes again. For this reason, in place upgrades are not supported. It is also necessary to import vendor libraries again, since last year's vendor libraries must be updated to be compatible with this year's projects.

### Launching the Import Wizard

.. image:: images/importing-previous-project/ImportPopup.png

When you open a previous year's project, you will be prompted to import that project. Click :guilabel:`yes`.

Alternately, you can chose to import it from the menu. Press :kbd:`Ctrl+Shift+P` and type "WPILib" or click the WPILib icon to locate the WPILib commands. Begin typing "Import a WPILib 2020-2024 Gradle project" and select it from the dropdown as shown below.
Alternately, you can chose to import it from the menu. Press :kbd:`Ctrl+Shift+P` and type "WPILib" or click the WPILib icon to locate the WPILib commands. Begin typing "Import a WPILib 2025 Gradle project" and select it from the dropdown as shown below.

.. image:: images/importing-previous-project/ImportGradleMenu.png

.. image:: images/importing-previous-project/VSCodeImport.png
.. image:: images/importing-previous-project/VSCodeImport-source.png
:alt: The Select Source Project:alt: The Select Source Project window of the WPILib Project Importer

You'll be presented with the WPILib Project Importer window. This is similar to the process of creating a new project and the window and the steps are shown below. This window contains the following elements:
You'll be presented with the WPILib Project Importer window. This is similar to the process of creating a new project.

1. **Gradle Project**: Selects the project to be imported. Users should select the build.gradle file in the root directory of the gradle project.
2. **Project Location**: This determines the folder in which the robot project will be located.
1. **Gradle Project**: Selects the project to be imported. Users should select the build.gradle file in the root directory of the gradle project. If you started the importer by openeing a previous year's project, this will be pre-populated

After making the selections, click :guilabel:`Next`.

This will bring up the Configure Project window.

.. image:: images/importing-previous-project/VSCodeImport-source.png
:alt: The Configure Project window of the WPILib Project Importer

2. **Base Folder**: This determines the folder in which the robot project will be located.
3. **Project Name**: The name of the robot project. This also specifies the name that the project folder will be given if the Create New Folder box is checked. This must be a different directory from the original location.
4. **Create a New Folder**: If this is checked, a new folder will be created to hold the project within the previously-specified folder. If it is *not* checked, the project will be located directly in the previously-specified folder. An error will be thrown if the folder is not empty and this is not checked.
5. **Team Number**: The team number for the project, which will be used for package names within the project and to locate the robot when deploying code.
6. **Enable Desktop Support**: If this is checked, simulation and unit test support is enabled. However, there are some cases where this will do some unexpected things. In addition, all vendor libraries need desktop support which not all libraries do.
7. **Import Romi Project**: If this is checked, the project is imported using the Romi gradle template. This should only be checked for Romi projects.
7. **Hardware Platform**: Choose where this project will be run, Systemcore, Romi, or XRP.

.. warning:: Creating projects on OneDrive is not supported as OneDrive's caching interferes with the build system. Some Windows installations put the Documents and Desktop folders on OneDrive by default.

Click :guilabel:`Import Project` to begin the upgrade.
After making the selections, click :guilabel:`Next`.

This will bring up the Review & Import window.

.. image:: images/importing-previous-project/VSCodeImport-review.png
:alt: The Review & Import window of the WPILib Project Importer

Double check all the settings and click :guilabel:`Import Project` to begin the upgrade.

The gradle project will be upgraded and copied into the new project directory. You can then either open the new project immediately using the pop-up below or open it later using the :kbd:`Ctrl+O` (or :kbd:`Command+O` for macOS) shortcut.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,47 @@ Bring up the Visual Studio Code command palette with :kbd:`Ctrl+Shift+P`. Then,
.. image:: /docs/software/vscode-overview/images/creating-robot-program/create-new-project.png
:alt: Choose "WPILib: Create a new project".

This will bring up the "New Project Creator Window:"
This will bring up the "WPILIb New Project Creator"

.. image:: /docs/software/vscode-overview/images/creating-robot-program/new-project-creator.png
:alt: The different parts of the new project creation window.
:alt: The project type selector of the WPILib New Project Creator

The elements of the New Project Creator Window are explained below:
The **Project Type** chooses between an empty template project, or a :doc:`WPILib example project </docs/software/examples-tutorials/wpilib-examples>`. For this example, select :guilabel:`Example` and then choose :guilabel:`Next`.

1. **Project Type**: The kind of project we wish to create. For this example, select **Example**
2. **Language**: This is the language (C++ or Java) that will be used for this project.
3. **Project Base**: This box is used to select the base class or example to generate the project from. For this example, select **Getting Started**
4. **Base Folder**: This determines the folder in which the robot project will be located.
5. **Project Name**: The name of the robot project. This also specifies the name that the project folder will be given if the Create New Folder box is checked.
6. **Create a New Folder**: If this is checked, a new folder will be created to hold the project within the previously-specified folder. If it is *not* checked, the project will be located directly in the previously-specified folder. An error will be thrown if the folder is not empty and this is not checked. project folder will be given if the Create New Folder box is checked.
7. **Team Number**: The team number for the project, which will be used for package names within the project and to locate the robot when deploying code.
8. **Enable Desktop Support**: Enables unit test and simulation. While WPILib supports this, third party software libraries may not. If libraries do not support desktop, then your code may not compile or may crash. It should be left unchecked unless unit testing or simulation is needed and all libraries support it. For this example, do not check this box.
This will bring up the language and base selection window.

Once all the above have been configured, click "Generate Project" and the robot project will be created.
.. image:: /docs/software/vscode-overview/images/creating-robot-program/new-project-creator-language.png
:alt: The language and base page of the WPILib New Project Creator

.. note:: Any errors in project generation will appear in the bottom right-hand corner of the screen.
1. **Language**: This is the language (C++ or Java) that will be used for this project.
2. **Project Base**: This box is used to select the base class or example to generate the project from. For this example, select **Getting Started**

After making the selections, click :guilabel:`Next`.

This will bring up the Project and Configuration window.

.. image:: /docs/software/vscode-overview/images/creating-robot-program/new-project-creator-location.png
:alt: The project and configuration page of the WPILib New Project Creator

1. **Base Folder**: This determines the folder in which the robot project will be located.
2. **Project Name**: The name of the robot project. This also specifies the name that the project folder will be given if the Create New Folder box is checked.
3. **Create a New Folder**: If this is checked, a new folder will be created to hold the project within the previously-specified folder. If it is *not* checked, the project will be located directly in the previously-specified folder. An error will be thrown if the folder is not empty and this is not checked.
4. **Team Number**: The team number for the project, which will be used for package names within the project and to locate the robot when deploying code.
5. **Enable Desktop Support**: Enables unit test and simulation support (see :doc:`/docs/software/wpilib-tools/robot-simulation/introduction`). While WPILib supports this, third party software libraries may not. If libraries do not support desktop, then your code may not compile or may crash. It should be left unchecked unless unit testing or simulation is needed and all libraries support it. For this example, do not check this box.

.. warning:: Creating projects on OneDrive is not supported as OneDrive's caching interferes with the build system. Some Windows installations put the Documents and Desktop folders on OneDrive by default.

Once all the above have been configured, click :guilabel:`Next`.

This will bring up the Review and Create window.

.. image:: /docs/software/vscode-overview/images/creating-robot-program/new-project-creator-configured.png
:alt: The review and create page of the WPILib New Project Creator

Double check all the settings and click :guilabel:`Create Project`. If anything is not correct, click :guilabel:`Back` and make the necessary corrections.

.. note:: Any errors in project generation will appear in the bottom right-hand corner of the screen.

## Opening The New Project

.. image:: /docs/software/vscode-overview/images/importing-previous-project/opening-project.png
Expand Down