Skip to content

Only show QGC virtual joystick when simulating a single vehicle#37

Merged
JacopoPan merged 3 commits intomainfrom
feat/single_rc_sim
Jan 29, 2026
Merged

Only show QGC virtual joystick when simulating a single vehicle#37
JacopoPan merged 3 commits intomainfrom
feat/single_rc_sim

Conversation

@JacopoPan
Copy link
Copy Markdown
Owner

@JacopoPan JacopoPan commented Jan 28, 2026

Motivation:

  • Quads and VTOLs require different throttle centering
  • With multiple vehicles switching vehicle focus in QGC is interpreted as RC loss/reconnection from the autopilot SITL

TODOs

  • test missions

Notes:

  • no virtual joystick makes ArduCopter "LOITER" mode not hold altitude when exiting/aborting an Offboard action, using "BRAKE" instead (while keeping "LOITER" for ArduPlane)
  • this PR disables the virtual joystick for multi-drone simulation, this makes PX4 vehicle appear in QGC in a yellow warning state for "No RC Input", this warning is harmless and can be removed by setting COM_RC_IN_MODE to 4

Alternatively one could add to Dockerfile.simulation

RUN mkdir /airframes
# Copy all airframes and create no-RC variants with COM_RC_IN_MODE=4
RUN find /temp_folder -type f -regex '.*/[0-9]+_.*' | while read -r filepath; do \
        filename=$(basename "$filepath"); \
        cp "$filepath" "/airframes/$filename"; \
        airframe_id=${filename%%_*}; \
        vehicle_name=${filename#*_}; \
        no_rc_airframe_id=$((airframe_id + 1000)); \
        no_rc_filename="${no_rc_airframe_id}_${vehicle_name}_no_rc"; \
        cp "$filepath" "/airframes/$no_rc_filename"; \
        echo "param set-default COM_RC_IN_MODE 4" >> "/airframes/$no_rc_filename"; \
    done

and to `simulation.yml.erb

    if autopilot == 'px4'
      if num_quads + num_vtols == 1
        autostart = is_quad ? 5140 : 5141
      else
        autostart = is_quad ? 6140 : 6141
      end

but it seems needlessly complicated

@JacopoPan JacopoPan self-assigned this Jan 28, 2026
@JacopoPan JacopoPan added the enhancement New feature or request label Jan 28, 2026
@JacopoPan JacopoPan marked this pull request as ready for review January 29, 2026 15:38
@JacopoPan JacopoPan removed their assignment Jan 29, 2026
@JacopoPan JacopoPan merged commit 1422245 into main Jan 29, 2026
10 of 13 checks passed
@JacopoPan JacopoPan deleted the feat/single_rc_sim branch January 29, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant