SITL Drone Cannot Fly Due To QGC Not Ready Status

Steps that I completed

  1. Started QGC
  2. make px4_sitl gz_x500 (in separate terminal)
  3. Run shell script to re-center map to Ireland (in another terminal)
  4. Run micro-xrce-dds-agent udp4 -p 8888 (in another terminal)
  5. in dir to run python code I did the following
  6. source /opt/ros/jazzy/setup.bash
  7. colcon build
  8. source install/local_setup.bash
  9. ros2 run proj_name node_name

QGC is in not ready status and the python code ends up doing nothing

The python code is trying to fly a mission in ROS2
The mission was previously run using MAVSDK, and upon completion the flight plan waypoints were kept on the vehicle.
So, the vehicle has waypoints, but the code that works if the QGC is in ready state does not work because the QGC is in a not Ready state

QGC Output
./QGroundControl-x86_64.AppImage
qgc.qgcapplication: Settings location “/home/afoster/.config/QGroundControl.org/QGroundControl Daily.ini” Is writable?: true
Filter rules “Log.debug=false\nqgc..debug=false\nGStreamerAPILog.debug=true\nqt.qml.connections=false”
LocalizationLog: Qt lib localization for “C” is not present
LocalizationLog: Error loading source localization for “C”
LocalizationLog: Error loading json localization for “C”
qt.multimedia.ffmpeg: Using Qt multimedia with FFmpeg version 7.1 LGPL version 2.1 or later
qt.multimedia.ffmpeg: Available HW decoding frameworks:
qt.multimedia.ffmpeg: Available HW encoding frameworks:
PX4ParameterMetaDataLog: Invalid max value, name: “VTQ_TELEM_IDS_1” type: 5 max: “4294967295” error: “Value must be within 0 and 2147483647”
PX4ParameterMetaDataLog: Invalid value for bitmask, bit: 31
PX4ParameterMetaDataLog: Invalid max value, name: “VTQ_TELEM_IDS_1” type: 5 max: “4294967295” error: “Value must be within 0 and 2147483647”
PX4ParameterMetaDataLog: Invalid value for bitmask, bit: 31
PX4ParameterMetaDataLog: Invalid max value, name: “VTQ_TELEM_IDS_1” type: 5 max: “4294967295” error: “Value must be within 0 and 2147483647”
PX4ParameterMetaDataLog: Invalid value for bitmask, bit: 31
Error loading text-to-speech plug-in “speechd”
qgc.audio.audiooutput: Failed to set the TTS engine.
VideoReceiverLog: Stop called on empty URI
VideoReceiverLog: Stop called on empty URI
qt.positioning.geoclue2: Unable to obtain the client: “org.freedesktop.DBus.Error.NoReply” “Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.”
qgc.positionmanager.positionmanager: QGCPositionManager::_setPositionSource(QGCPositionSource)::<lambda(QGeoPositionInfoSource::Error)> QGeoPositionInfoSource::AccessError
PX4ParameterMetaDataLog: Invalid max value, name: “VTQ_TELEM_IDS_1” type: 5 max: “4294967295” error: “Value must be within 0 and 2147483647”
PX4ParameterMetaDataLog: Invalid value for bitmask, bit: 31
qgc.audio.audiooutput: AudioOutput not initialized. Call init() before using say().
qgc.audio.audiooutput: AudioOutput not initialized. Call init() before using say().
FirmwarePluginLog: Unable to parse version info from file “https://api.github.com/repos/PX4/Firmware/releases
ComponentInformationTranslationLog: Locale “C” not found in json
ComponentInformationTranslationLog: Locale “C” not found in json
ParameterManagerLog: Attemping load from cache
ParameterManagerLog: Parameters cache match failed /home/afoster/.config/QGroundControl.org/ParamCache/1_1.v2
qgc.audio.audiooutput: AudioOutput not initialized. Call init() before using say().
qml: onPressed 10 224

PX4 Output
~/PX4-Autopilot$ HEADLESS=1 make px4_sitl gz_x500
[0/1] cd /home/afoster/PX4-Autopilot/build/px4_sitl_default/src/modules/simulation/…=gz_x500 GZ_IP=127.0.0.1 /home/afoster/PX4-Autopilot/build/px4_sitl_default/bin/px4


| ___ \ \ \ / / / |
| |/ / \ V / / /| |
| __/ / \ / /
| |
| | / /^\ \ ___ |
_| / / |_/

px4 starting.

INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 0
INFO [init] found model autostart file as SYS_AUTOSTART=4001
INFO [param] selected parameter default file parameters.bson
INFO [param] importing from ‘parameters.bson’
INFO [parameters] BSON document size 483 bytes, decoded 483 bytes (INT32:18, FLOAT:6)
INFO [param] selected parameter backup file parameters_backup.bson
INFO [dataman] data manager file ‘./dataman’ size is 1208528 bytes
INFO [init] Gazebo simulator
INFO [init] Starting gazebo with world: /home/afoster/PX4-Autopilot/Tools/simulation/gz/worlds/default.sdf
INFO [init] Waiting for Gazebo world…
INFO [init] Gazebo world is ready
INFO [init] Spawning model
INFO [gz_bridge] world: default, model: x500_0
INFO [lockstep_scheduler] setting initial absolute time to 4180000 us
INFO [commander] LED: open /dev/led0 failed (22)
WARN [health_and_arming_checks] Preflight Fail: ekf2 missing data
WARN [health_and_arming_checks] Preflight Fail: No connection to the ground control station
INFO [tone_alarm] home set
INFO [uxrce_dds_client] init UDP agent IP:127.0.0.1, port:8888
INFO [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 18570 remote port 14550
INFO [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14580 remote port 14540
INFO [mavlink] mode: Onboard, data rate: 4000 B/s on udp port 14280 remote port 14030
INFO [mavlink] mode: Gimbal, data rate: 400000 B/s on udp port 13030 remote port 13280
INFO [mavlink] partner IP: 127.0.0.1
INFO [logger] logger started (mode=all)
INFO [logger] Start file log (type: full)
INFO [logger] [logger] ./log/2025-04-24/20_21_44.ulg
INFO [logger] Opened full log file: ./log/2025-04-24/20_21_44.ulg
INFO [mavlink] MAVLink only on localhost (set param MAV_{i}BROADCAST = 1 to enable network)
INFO [mavlink] MAVLink only on localhost (set param MAV
{i}_BROADCAST = 1 to enable network)
INFO [px4] Startup script returned successfully
pxh> ERROR [mavlink] vehicle_command_ack lost, generation 6 → 24
ERROR [mavlink] vehicle_command_ack lost, generation 6 → 24
ERROR [mavlink] vehicle_command_ack lost, generation 6 → 24
ERROR [mavlink] vehicle_command_ack lost, generation 6 → 24
WARN [health_and_arming_checks] Preflight Fail: Strong magnetic interference
INFO [uxrce_dds_client] synchronized with time offset 1745526100177785us
INFO [uxrce_dds_client] successfully created rt/fmu/out/register_ext_component_reply data writer, topic id: INFO [uxrce_dds_client] successfully created rt/fmu/out/arming_check_request data writer, topic id: 16
INFO [uxrce_dds_client] successfully created rt/fmu/out/mode_completed data writer, topic id: 148
INFO [uxrce_dds_client] successfully created rt/fmu/out/battery_status data writer, topic id: 19
INFO [uxrce_dds_client] successfully created rt/fmu/out/collision_constraints data writer, topic id: 26
INFO [uxrce_dds_client] successfully created rt/fmu/out/estimator_status_flags data writer, topic id: 83
INFO [uxrce_dds_client] successfully created rt/fmu/out/failsafe_flags data writer, topic id: 89
INFO [uxrce_dds_client] successfully created rt/fmu/out/manual_control_setpoint data writer, topic id: 139
INFO [uxrce_dds_client] successfully created rt/fmu/out/message_format_response data writer, topic id: 145
INFO [uxrce_dds_client] successfully created rt/fmu/out/position_setpoint_triplet data writer, topic id: 183INFO [uxrce_dds_client] successfully created rt/fmu/out/sensor_combined data writer, topic id: 214
INFO [uxrce_dds_client] successfully created rt/fmu/out/timesync_status data writer, topic id: 237
INFO [uxrce_dds_client] successfully created rt/fmu/out/vehicle_land_detected data writer, topic id: 264
INFO [uxrce_dds_client] successfully created rt/fmu/out/vehicle_attitude data writer, topic id: 251
INFO [uxrce_dds_client] successfully created rt/fmu/out/vehicle_control_mode data writer, topic id: 258
INFO [uxrce_dds_client] successfully created rt/fmu/out/vehicle_command_ack data writer, topic id: 255
INFO [uxrce_dds_client] successfully created rt/fmu/out/vehicle_global_position data writer, topic id: 259
INFO [uxrce_dds_client] successfully created rt/fmu/out/vehicle_gps_position data writer, topic id: 261
INFO [uxrce_dds_client] successfully created rt/fmu/out/vehicle_local_position data writer, topic id: 265
INFO [uxrce_dds_client] successfully created rt/fmu/out/vehicle_odometry data writer, topic id: 270
INFO [uxrce_dds_client] successfully created rt/fmu/out/vehicle_status_v1 data writer, topic id: 275
INFO [uxrce_dds_client] successfully created rt/fmu/out/airspeed_validated data writer, topic id: 13
INFO [uxrce_dds_client] successfully created rt/fmu/out/vtol_vehicle_status data writer, topic id: 284
INFO [uxrce_dds_client] successfully created rt/fmu/out/home_position data writer, topic id: 121
INFO [uxrce_dds_client] time sync converged
WARN [health_and_arming_checks] Preflight Fail: Strong magnetic interference
WARN [health_and_arming_checks] Preflight: GPS Horizontal Pos Drift too high
WARN [timesync] time jump detected. Resetting time synchroniser.
WARN [uxrce_dds_client] time sync no longer converged
INFO [uxrce_dds_client] time sync converged
WARN [timesync] time jump detected. Resetting time synchroniser.
WARN [uxrce_dds_client] time sync no longer converged
INFO [uxrce_dds_client] time sync converged
WARN [commander] Arming denied: Resolve system health failures first
INFO [tone_alarm] notify negative
WARN [commander] command 16 unsupported
WARN [commander] command 16 unsupported
ERROR [mavlink] vehicle_command_ack lost, generation 36 → 38
ERROR [mavlink] vehicle_command_ack lost, generation 36 → 38
ERROR [mavlink] vehicle_command_ack lost, generation 36 → 38
ERROR [mavlink] vehicle_command_ack lost, generation 36 → 38
WARN [commander] command 16 unsupported
WARN [commander] command 16 unsupported
WARN [commander] command 16 unsupported
WARN [commander] Mission start denied! No valid mission
INFO [tone_alarm] notify negative
WARN [health_and_arming_checks] Preflight Fail: Strong magnetic interference
WARN [health_and_arming_checks] Preflight Fail: Strong magnetic interference
INFO [ekf2] 0 - New NED origin (LLA): 54.9558400000, -7.3297600000, -25.000

WARN [timesync] time jump detected. Resetting time synchroniser.
WARN [uxrce_dds_client] time sync no longer converged
INFO [uxrce_dds_client] time sync converged
WARN [commander] Arming denied: Resolve system health failures first
WARN [commander] command 16 unsupported
WARN [commander] command 16 unsupported
INFO [tone_alarm] notify negative
WARN [commander] command 16 unsupported
WARN [commander] command 16 unsupported
WARN [commander] command 16 unsupported
ERROR [mavlink] vehicle_command_ack lost, generation 48 → 53
ERROR [mavlink] vehicle_command_ack lost, generation 48 → 53
ERROR [mavlink] vehicle_command_ack lost, generation 49 → 53
ERROR [mavlink] vehicle_command_ack lost, generation 48 → 53
WARN [commander] Mission start denied! No valid mission
INFO [tone_alarm] notify negative
WARN [timesync] time jump detected. Resetting time synchroniser.
WARN [uxrce_dds_client] time sync no longer converged
INFO [uxrce_dds_client] time sync converged
WARN [timesync] time jump detected. Resetting time synchroniser.
WARN [uxrce_dds_client] time sync no longer converged
INFO [uxrce_dds_client] time sync converged
WARN [timesync] time jump detected. Resetting time synchroniser.
WARN [uxrce_dds_client] time sync no longer converged

The issue is likely that you are moving the lat/lon very far after the EKF has already initialized at the default lat/lon. Gazebo doesn’t yet support non-default lat/lon, you will need to change the lat/lon in the default.sdf world file to your location in Ireland

That may be true.
Today I implemented your suggestion to recenter the map in the startup script, and that error has not shown up.
The error is intermittent, so time will tell

On another note, I keep getting command 16, 18 and 19 are unsupported.
So, I am unable to upload waypoints in ROS2
(MAV_CMD_NAV_WAYPOINT, MAV_CMD_NAV_LOITER_TURNS, MAV_CMD_NAV_LOITER_TIME)
Are those commands unsupported or could that error be caused because I am missing something?

upload waypoints in ROS2

How are you uploading waypoints? Are you using mavros or your own implementation? Are you trying to upload a mission? Have you seen the docs for missions?

I am not sure what it would mean to use mavros.

I have a method
def publish_vehicle_cmd(self, command, **params) → None:
“”“Publish a vehicle command.”“”
msg = VehicleCommand()
msg.command = command
msg.param1 = params.get(“param1”, 0.0)
msg.param2 = params.get(“param2”, 0.0)
msg.param3 = params.get(“param3”, 0.0)
msg.param4 = params.get(“param4”, 0.0)
msg.param5 = params.get(“param5”, 0.0)
msg.param6 = params.get(“param6”, 0.0)
msg.param7 = params.get(“param7”, 0.0)
msg.source_system = self.src_system
msg.target_system = self.tgt_system
msg.source_component = self.src_component
msg.target_component = self.tgt_component
msg.from_external = True
msg.timestamp = int(self.get_clock().now().nanoseconds / 1000)

    self.vehicle_cmd_pub.publish(msg)

# end publish_vehicle_cmd

I call this with a command as VehicleCommand.VEHICLE_CMD_NAV_WAYPOINT,

self.publish_vehicle_cmd(
command=VehicleCommand.VEHICLE_CMD_NAV_WAYPOINT,
param1=hold_time_s,
param2=accept_radius_m,
param3=pass_radius_m,
param4=yaw_deg,
param5=lat_deg,
param6=lon_deg,
param7=alt_m,
)

Greetings,
I have read the links above, and am going through them again.
Are there any python examples of how to upload waypoints to a vehicle in mavros?

I have the uploading of mission waypoints working in mavsdk.
And, once the mission is loaded onto the vehicle, I can fly it using python code in mavros.
I cannot figure out how to upload the points onto the vehicle using python and mavros.

I found the mission_test.py file in the PX4 installation, but it seems to be based on python2.

I can send code snippets if that would help.
I am using the gz_x500 drone flying in px4 and using QGC.

Below is a code snippet that is the callback for the mission message

In the constructor, if I am in mission mode, I set up a timer
if use_mission_mode:
if self.way_pts is not None:
self.timer = self.create_timer(0.1, self.timer_mission_callback)

The callback is below
#---------------------------------------------------------
#---------------------------------------------------------
def timer_mission_callback(self):
self.publish_offboard_control_heartbeat_signal()

    if self.offboard_ctr == 10:
        self.engage_offboard_mode()
        self.set_home()
        self.arm()
        if self.num_way_pts > 0:
            self.set_mission_mode()
            self.upload_way_pts(way_pts=self.way_pts)

    # Engage offboard mode and Arm after 20 counts
    if self.offboard_ctr == 20:
        self.mission_start()

    if self.offboard_ctr < 30:
        self.offboard_ctr += 1

# end timer_mission_callback

When the code below is called, I get a “no valid mission” error
def mission_start(self):
“”“Navigation command to start mission”“”

    # param1 first item -- first mission item to run min:0, inc: 1
    # param2 last item  -- last mission item to run min:0, inc: 1
    self.publish_vehicle_cmd(
        command=VehicleCommand.VEHICLE_CMD_MISSION_START,
        param1=0.0,
        param2=float(self.num_way_pts - 1),
    )
    self.get_logger().info(f"Vehicle: mission start cmd sent, num way pts = {self.num_way_pts}, 1st = 0, last = {self.num_way_pts - 1}")

# end mission_start

This seems to be a C++ solution.
Is there a python example of how to upload a mission?