Skip to content

manager.py: support multiple application processes#284

Draft
anishk85 wants to merge 1 commit into
JdeRobot:humble-develfrom
anishk85:feature/multi-agent-support
Draft

manager.py: support multiple application processes#284
anishk85 wants to merge 1 commit into
JdeRobot:humble-develfrom
anishk85:feature/multi-agent-support

Conversation

@anishk85
Copy link
Copy Markdown

@anishk85 anishk85 commented Jun 3, 2026

replaces the single self.application_process with a self.application_processes dict so RAM can manage N processes by name instead of just one. needed this for multi-agent exercises like drone cat-mouse where we run the students code and a pre-programmed mouse at the same time. added a _kill_all_applications() helper that loops through the dict and kills each process tree — replaces the old copy-pasted kill logic in terminate, disconnect, and signal_handler.

the intresting part is the syncronized startup: after spawning all processes we freeze them with SIGSTOP, unpause gazebo, then SIGCONT everthing together so all agents start at the exact same sim-time. also if the student zip has a processB/ subdir inside it, we launch that as a second agent automatically (its server-side code so we skip linting it later i will see if needed)

existing single-agent exercises just end up with one entry {"agentA": proc} in the dict. tested pause/resume/stop/disconnect with two processes in the real GUI, evrything works as expected.

ra.webm

@anishk85
Copy link
Copy Markdown
Author

anishk85 commented Jun 3, 2026

Hi @jmplaza @pariaspe,
here's the pr for the RAM part.

Comment thread robotics_application_manager/manager/manager.py Outdated
Comment thread robotics_application_manager/manager/manager.py Outdated
Comment thread robotics_application_manager/manager/manager.py Outdated
Comment thread robotics_application_manager/manager/manager.py Outdated
Comment thread robotics_application_manager/manager/manager.py Outdated
Comment thread robotics_application_manager/manager/manager.py Outdated
Comment thread robotics_application_manager/manager/manager.py Outdated
@anishk85
Copy link
Copy Markdown
Author

anishk85 commented Jun 3, 2026

Hi @javizqh ,
I've addressed the requested changes. The comments you pointed out were written earlier and I rewrote some of them while working on the integration, which likely caused a few mismatches. I also fixed the spelling mistakes that slipped through.

Thanks for the review!

@anishk85 anishk85 force-pushed the feature/multi-agent-support branch from 1e3ab4c to 4360326 Compare June 3, 2026 16:56
shutil.rmtree("/workspace/code", ignore_errors=False)
os.mkdir("/workspace/code")

# Extract app config
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing comment. Please revert

@anishk85 anishk85 marked this pull request as draft June 5, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants