SITL(Software-In-the-Loop) 시뮬레이션은 비행 스택이 컴퓨터(동일한 컴퓨터 또는 동일한 네트워크의 다른 컴퓨터)에서 실행되는 시뮬레이션이다. 오직 컴퓨터만으로 시뮬레이션을 실행한다.
ROS with Gazebo Simulation | PX4 User Guide
Gazebo Simulation | PX4 User Guide
빌드
cd ~/PX4-Autopilot
DONT_RUN=1 make px4_sitl_default gazebo
실행방법
cd ~/PX4-Autopilot
source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Tools/sitl_gazebo
roslaunch px4 posix_sitl.launch
# 다른 기체로 실행하고 싶은 경우,(default는 iris이다. (작은 쿼드로터))
roslaunch px4 posix_sitl.launch vehicle:=standard_vtol
모델의 위치: PX4-Autopilot/Tools/sitl_gazebo/models 안에 있음
이렇게 하면 가제보가 실행되고 기체가 생성된다. QGroundControl을 실행하면 자동으로 연결될 것이다. 여기에 mavros를 연결해서 제어하면 된다. mavros는 다른 페이지서 설명할 것.
참고한 파일
vmware 상에서 가제보 실행 안될때, 그래픽 가속 설정 해제
https://answers.ros.org/question/365478/about-the-gazebo_gui-3-process-has-died/
실행 시 에러뜨며 안되는 경우 참고