Windows 용 PX4 개발환경 설치 문서 [5] 를 따라가되, 일부 수정을 한다.
1. PX4 개발환경 설치하기
1.1 PX4 소스파일 받기
1.1.1 PX4를 최신 버전으로 받는다 (Stable 버전이 아닌, lastest 버전이다.)
git clone https://github.com/PX4/PX4-Autopilot.git px4 # clone PX4 repo as px4 directory
1.1.2 원하는 버전이 있다면 PX4를 특정 tag으로 받아보자. [3]
git clone https://github.com/PX4/PX4-Autopilot.git px4 # clone PX4 repo as px4 directory
cd px4
git checkout v1.15.2
그러면 아래와 같은 메시지와 함께 HEAD를 전환할 수 있다.
Note: switching to 'v1.15.2'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 4817c0618a mRo boards: Fix for USART clock selection (#23524)
git 상태를 봐도 동일하게 변경된 것을 확인할 수 있다.

1.2 PX4 폴더에서 서브모듈을 업데이트한다.
git submodule update --init --recursive
1.3 Ubuntu 용 PX4 개발환경 설치 배치파일을 실행한다.
bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
1.4 쉘에서 WSL 을 재실행하자.
exit
wsl --shutdown
wsl
1.5 다시 PX4 폴더로 가서 px4 가 잘 빌드되는지 확인해보자.
make px4_sitl
2. Gazebo classic 실행하기
Gazebo Classic 은 별 이슈 없이 잘 실행된다.
make px4_sitl gazebo-classic # Default Quadcopter
make px4_sitl gazebo-classic_plane # High-wing and Conventional type rc-airplane

3. WSL 내에서 QGC 실행하기
QGC 실행파일을 위해 아래와 같은 사전작업을 수행한다. [2]
sudo usermod -a -G dialout $USER
sudo apt-get remove modemmanager -y
sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl -y
sudo apt install libfuse2 -y
sudo apt install libxcb-xinerama0 libxkbcommon-x11-0 libxcb-cursor-dev -y
아래 명령어로 QGC를 다운로드 받는다. 아래 주소는 항상 바뀔 수 있다. QGC 다운로드 링크를 복붙하면 된다.
wget https://d176tv9ibo4jno.cloudfront.net/latest/QGroundControl.AppImage
Ubuntu 상에서 권한을 변경해준다.
sudo chmod 777 QGroundControl.AppImage
그리고 실행한다.
./QGroundControl.AppImage
Windows11 의 WSL (Ubuntu 20.04)에서 아래와 같은 에러가 나타난다.
어떤 라이브러리 파일이 없다는 이야기인 것 같다.

아래와 같이 libpulse-dev 를 설치하여 해결하자. [1]
sudo apt install libpulse-dev
[1] https://askubuntu.com/questions/1034047/where-to-get-libpulse-mainloop-glib-0-9-19
[3] https://docs.px4.io/main/en/contribute/git_examples.html#get-a-specific-release
[4] https://docs.px4.io/main/en/contribute/git_examples.html#contributing-code-to-px4
[5] PX4, Windows Development Environment (WSL2-Based), https://docs.px4.io/main/en/dev_setup/dev_env_windows_wsl.html
** EOF **
'SW' 카테고리의 다른 글
Windows11 - WSL 설치 정리 (0) | 2025.02.09 |
---|---|
Add input argument in ROS2 Subscriber callback (0) | 2024.10.15 |
CMake 바이너리 혹은 소스 설치 방법 (0) | 2024.07.08 |
빌드 시스템 meson 버전 업그레이드 하기 (0) | 2024.07.05 |
Mavlink Router 설치 및 사용방법 (0) | 2024.07.05 |