Skip to content

One parameter world constructor for parallel scripts#155

Open
jonyMarino wants to merge 1 commit into
mainfrom
feature/parallel_scripts
Open

One parameter world constructor for parallel scripts#155
jonyMarino wants to merge 1 commit into
mainfrom
feature/parallel_scripts

Conversation

@jonyMarino
Copy link
Copy Markdown
Contributor

enables running script after scripts and multiple service-only scripts

Fixes: #

About

This pull request introduces several new example scripts for controlling drones in a simulation and refactors the client and drone code to support "service-only" mode, where pub-sub topics are disabled if another topic client is already connected. The changes enable running multiple clients (e.g., for multi-vehicle scenarios)

New Example Scripts:

  • Added hello_drone_secondary.py, demonstrating how to fly a drone using only service calls (no topic subscriptions), intended for use as a secondary controller.
  • Added two_drones_split_drone1.py and two_drones_split_drone2.py, which show how to control two drones in a split fashion, with Drone1 loading the scene and Drone2 attaching to the existing world. These scripts illustrate proper usage of topics and service-only mode. [1] [2]

Client Refactoring and Service-Only Mode Support:

  • The ProjectAirSimClient class now detects if a topic client is already connected and, if so, disables topic functionality for subsequent clients (service-only mode). Methods that interact with topics (subscribe, publish, unsubscribe, etc.) now check for this mode and log warnings when operations are skipped. [1] [2] [3] [4] [5] [6] [7]
  • Added has_topic_client() and is_service_only_mode() methods to the client API for better control and diagnostics.

Drone Sensor Topic Setup Improvements:

  • Refactored Drone.set_sensor_topics() to support passive discovery from cached topics if configuration is missing, and to log detailed diagnostics about the topic setup source and endpoints. This ensures drones can still function in service-only mode or when config is incomplete.

These changes collectively make the system more robust for multi-client and multi-drone scenarios, and provide clear examples and error handling for users.

How Has This Been Tested?

local tests with scripts provided.

Screenshots and videos (if appropriate):

enables running script after scripts and multiple service-only scripts
@github-actions
Copy link
Copy Markdown

❌ ProjectAirSim Self-Hosted CI

  • Status: failure
  • Pytest results: tests=162, failures=1, errors=0, skipped=0
  • Artifacts: test-results

View full workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant