Open a terminal:
cd ~/PX4-Autopilot
make px4_sitl gz_standard_vtol
Open another terminal:
source /opt/ros/humble/setup.bash
ros2 launch mavros px4.launch fcu_url:=udp://:14540@
This starts the MAVROS node and connects to PX4 SITL.
Confirm it’s connected with:
ros2 topic echo /mavros/state
You should see connected: True
.
Open a new terminal:
source /opt/ros/humble/setup.bash
ros2 topic echo /mavros/local_position/pose