WinWSL — Build and Development Environment¶
WinWSL is a build and development environment packaged and integrated by the RflySim toolchain based on the WSL (Windows Subsystem for Linux) and Ubuntu system framework. It provides users with complete Linux development capabilities on the Windows platform, without the need to configure a virtual machine or dual-boot system.
Why WinWSL?¶
| Requirement | Description |
|---|---|
| PX4 Source Code Compilation | PX4 firmware requires cross-compilation in a Linux environment |
| ROS 1/2 Development | The ROS ecosystem is based on Ubuntu, and vision/swarm algorithms need to run in ROS |
| Onboard Algorithm Testing | Test algorithms locally in a Linux environment before deployment to ARM platforms such as Jetson |
| Docker Support | WSL2 supports Docker containerized deployment |
Pre-installed Components¶
The WinWSL environment comes pre-installed with the following core components to build a ready-to-use R&D platform:
| Component | Function Description |
|---|---|
| Ubuntu 20.04/22.04 | Base operating system |
| ROS 1 (Noetic) | Robot Operating System (classic version) |
| ROS 2 (Humble/Jazzy) | Robot Operating System (next-generation version) |
| OpenCV | Image processing and computer vision library |
| PX4 Cross-compilation Toolchain | PX4 firmware build environment |
| ArduPilot Build Support | ArduPilot firmware build environment |
| Python 3.x | Python runtime environment |
| Gazebo | Simulator supporting ROS |
| NS-3 | Network protocol simulator |
| Graphical Desktop | Visual operation experience close to real onboard systems |
WSL1 vs WSL2¶
| Feature | WSL1 | WSL2 |
|---|---|---|
| Architecture | System call translation layer | Hyper-V lightweight virtual machine |
| Linux Kernel | No complete kernel | Complete Linux kernel |
| Cross-system File Performance | ✅ Excellent | ❌ Relatively weak |
| Internal Linux I/O | Medium | ✅ Excellent |
| Docker Support | ❌ Not supported | ✅ Supported |
| GPU Acceleration | ❌ Not supported | ✅ Supported |
| Memory Usage | ✅ Low | ❌ Relatively high |
| Networking with Windows | ✅ Shared network stack | Port mapping configuration required |
Default Selection
RflySim uses WSL1 by default, as it is lightweight, fast to compile, and has simple cross-system communication. You can switch to WSL2 when Docker/GPU acceleration is required.
Version Switching¶
Use the desktop shortcut RflyTools\WslSwitch2 or execute the command in CMD:
wsl --set-version RflySim-20.04 2 # Switch to WSL2
wsl --set-version RflySim-20.04 1 # Switch back to WSL1
ROS Version Switching¶
WinWSL supports switching between ROS 1 and ROS 2 via a one-click script:
- Use the shortcut
RflyTools\RosSwitch - Or execute the switching script in the WinWSL terminal
GPU Acceleration Environment (WSL2)¶
For advanced users requiring GPU acceleration, RflySim provides a complete AI algorithm development environment based on WSL2, pre-installed with:
- Docker algorithm deployment
- NVIDIA CUDA / cuDNN
- TensorFlow / PyTorch GPU support
- Large model decision frameworks
- End-to-end control training
- Reinforcement learning training environment
Related Examples
For more information on the WSL2 GPU acceleration environment, see: RflySimAPIs\1.RflySimIntro\2.AdvExps\e13.WinWSL2-GPU
Common Commands¶
| Command | Function |
|---|---|
ls |
List files in the current directory |
cd ~ |
Return to the user home directory |
uname -a |
View current system and WSL version information |
roscore |
Start the ROS 1 Master node |
ros2 run <pkg> <node> |
Run a ROS 2 node |
gazebo |
Start the Gazebo simulator |
make px4_sitl_default |
Compile PX4 SITL firmware |
docker --version |
Check Docker version (WSL2 only) |