ArduPilot VS Code Development Environment
This extension is developed to provide set of tools to improve quality of life for devs using Visual Studio Code for development. Currently only basic function to generate build tasks is added. Contributions, recommendations and issue reports are welcome!
Table of Contents
- Introduction
- Installation
- Extension Interface
- Getting Started
- Environment Validation
- Managing Build Configurations
- Working with ArduPilot Firmware
- Feature Configuration
- Connected Devices
- SITL Simulation
- Task System Integration
- Troubleshooting
- Additional Resources
Introduction
The ArduPilot VS Code Development Environment extension provides a comprehensive integrated development environment for ArduPilot firmware development directly within Visual Studio Code. This extension streamlines common development tasks and provides tools to improve your workflow when developing for ArduPilot-based systems.
Key features include:
- ArduPilot repository management
- Build configuration management for different boards and vehicle types
- Integrated firmware building and uploading
- Connected device detection and management
- MAVProxy integration
- SITL (Software-In-The-Loop) simulation support
- Environment validation
Installation
Prerequisites
Before installing the extension, ensure you have:
- Visual Studio Code 1.63.0 or newer
- Git installed and configured
- Python 3.x installed
- For hardware targets: ARM GCC toolchain (arm-none-eabi-gcc)
- For debugging: GDB (arm-none-eabi-gdb or gdb-multiarch)
Installation Steps
- Open Visual Studio Code
- Go to the Extensions view (Ctrl+Shift+X or View > Extensions)
- Search for "ArduPilot DevEnv"
- Click "Install" on the "ardupilot-devenv" extension
- The extension will automatically install required dependencies:
- Cortex-Debug extension (marus25.cortex-debug)
- C/C++ Tools extension (ms-vscode.cpptools)

Extension Interface
The extension adds a dedicated activity bar icon that provides access to four main views:
Welcome View
The Welcome view is the starting point for using the extension. It provides:
- Quick links to common actions
- Information about the extension
- Environment setup assistance

Build Configurations View
This view allows you to manage different build configurations for ArduPilot firmware:
- Create, edit, and delete build configurations
- Set the active configuration
- Build firmware for specific configurations
Each configuration includes:
- Target board (e.g., CubeOrange, Pixhawk, SITL)
- Vehicle type (e.g., copter, plane, rover)
- Build options
- Feature selections

Actions View
The Actions view provides quick access to common tasks based on your active configuration:
- Build firmware
- Debug firmware
- Upload firmware
- Run SITL simulation

Connected Devices View
This view shows USB devices connected to your computer that may be ArduPilot compatible:
- Lists all connected USB devices
- Shows device details (port, manufacturer, product)
- Provides options to connect via MAVProxy
- Shows connection status

Getting Started
Cloning the ArduPilot Repository
If you don't already have the ArduPilot source code, the extension can clone it for you:
- In the Activity Bar, click on the ArduPilot DevEnv icon
- In the Welcome view, click on "Clone ArduPilot"
- Select a destination directory
- Optionally specify a different directory name (defaults to "ardupilot")
- Wait for the cloning process to complete
- The repository will be added to your workspace

Opening an Existing Repository
If you already have an ArduPilot repository:
- In VS Code, select File > Open Folder...
- Navigate to and select your ArduPilot repository folder
- Click "Open"
- The extension will automatically detect the ArduPilot repository and enable its features
Environment Validation
The extension can validate your development environment to ensure all required tools are available:
From the Welcome view, select "Validate Environment"
The extension checks for:
- Python 3
- MAVProxy
- arm-none-eabi-gcc (ARM GCC toolchain)
- arm-none-eabi-gdb / gdb-multiarch
- ccache (recommended for faster builds)
- JLinkGDBServerCLExe (optional for SEGGER J-Link debugging)
- OpenOCD (optional for JTAG/SWD debugging)
For each tool, the validator shows:
- Tool status (Available/Missing)
- Version information
- Path where the tool was found

If a tool is installed but not in the standard location:
- In the Environment Validator, click "Configure Path" next to the missing tool
- Browse to select the executable file
- The extension will verify the tool and save the custom path
- Custom paths are remembered between sessions
To reset all custom paths:
- Click "Reset All Paths" at the bottom of the validator
- Confirm the reset when prompted

Managing Build Configurations
Creating Build Configurations
In the Build Configurations view, click the "+" icon or "New Build Configuration"
In the configuration panel:
Basic Configuration:
- Select a target board (e.g., "CubeOrange", "Pixhawk4", "SITL")
- Select a vehicle type (e.g., "copter", "plane", "rover")
Advanced Options:
- Configure Options: Add waf configure options (e.g., "--debug")
- Build Options: Add waf build options (e.g., "--upload")
- Enable Feature Configuration: Toggle to enable fine-tuning of firmware features
SITL Configuration (when SITL board is selected):
- Frame Type: Select vehicle frame (e.g., "quad", "hexa")
- Additional Parameters: Set SITL-specific options
Click "Create Build Configuration" to save

Editing Build Configurations
- In the Build Configurations view, find the configuration to edit
- Click the pencil icon or right-click and select "Edit"
- Make changes in the configuration panel
- Click "Save" to update the configuration
Deleting Build Configurations
- In the Build Configurations view, find the configuration to delete
- Click the trash icon or right-click and select "Delete"
- Confirm deletion when prompted
Setting the Active Configuration
- In the Build Configurations view, find the configuration to activate
- Click the star icon or right-click and select "Set as Active Configuration"
- The active configuration will be highlighted and available in the Actions view

Working with ArduPilot Firmware
Building Firmware
From the Build Configurations view:
- Find the configuration to build
- Click the tools icon or right-click and select "Build Firmware"
- The build process will start in a terminal window
- Build output and errors will be displayed in the terminal
- The Problems panel will show compilation errors and warnings
From the Actions view (with active configuration):
- Click "Build Firmware"
- The build will start as described above

Uploading Firmware
From the Actions view:
- Click "Upload Firmware"
- If configured, the firmware will be built first
- The compiled firmware will be uploaded to the connected board
- Upload status will be shown in the terminal

Debugging Firmware
For hardware targets:
- Connect your board via a compatible debug probe
- In the Actions view, click "Debug Firmware"
- VS Code will start a debug session using the Cortex-Debug extension
- You can set breakpoints, inspect variables, and step through code
For SITL targets:
- In the Actions view, click "Debug Firmware"
- A SITL instance will start in debug mode
- You can debug the ArduPilot code running in the simulator

Feature Configuration
When creating or editing a build configuration, you can enable the Feature Configuration option to fine-tune which ArduPilot features are included in the build.
Enabling/Disabling Features
- In the build configuration panel, check "Enable Feature Configuration"
- Initial build is required to extract features after enabling.
- The Features section will expand to show available features.
- Check or uncheck features to enable or disable them
- These selections are passed to the ArduPilot build system

Connected Devices
Viewing Connected Devices
- In the Connected Devices view, all USB devices connected to your computer will be listed
- Each device shows:
- Port (e.g., /dev/ttyACM0, COM3)
- Manufacturer and product name
- Serial number (if available)
- Icon indicating ArduPilot compatibility (when detected)
- Click the refresh button to update the list of connected devices

MAVProxy Integration
MAVProxy is a command-line ground station software that allows you to interact with ArduPilot devices.
Connecting to a device:
- In the Connected Devices view, find the device you want to connect to
- Click "Connect MAVProxy" or right-click and select "Connect MAVProxy"
- Enter the baud rate when prompted (default is 115200)
- A terminal window will open running MAVProxy connected to your device
- You can now interact with the device using MAVProxy commands
Disconnecting:
- In the Connected Devices view, find the connected device
- Click "Disconnect" or right-click and select "Disconnect"
- The MAVProxy connection will be terminated

SITL Simulation
Software-In-The-Loop (SITL) allows you to run ArduPilot code without physical hardware.
Setting Up SITL
- Create a new build configuration:
- Select "SITL" as the board
- Select your desired vehicle type (e.g., "copter", "plane", "rover")
- Configure SITL options through args:
- Frame type (e.g., -f +)
- Additional parameters (e.g., "-L CMAC" for CMAC location)
- Click "Create Build Configuration" to save
- Set this configuration as active

Running Simulations
- With a SITL configuration active, go to the Actions view
- Click "Run SITL Simulation"
- The SITL process will start in a terminal window
- By default, SITL will connect to MAVProxy for interaction

Task System Integration
The extension integrates with VS Code's task system to provide ArduPilot-specific tasks.
Task Configuration
The extension contributes a task type "ardupilot" with the following properties:
{
"type": "ardupilot",
"configure": "BoardName", // Board configuration (required)
"target": "vehicle", // Target vehicle type (required)
"configureOptions": "", // waf configure options
"buildOptions": "", // waf build options
"waffile": "", // Custom waf file location
"buildBeforeUpload": true, // Whether to build before uploading
"features": [], // Features to enable/disable
"simVehicleCommand": "" // SITL-specific options
}
Additional Resources
For issues, feature requests, or contributions:
Release Notes
0.0.1
- Add basic support of generating build tasks for ardupilot boards and vehicles
Working with Ardupilot
Refer the docs ArduPilot Development Site
Enjoy!