Skip to content

Enabling dual robot communication - #25

Open
MarcioCamposJr wants to merge 38 commits into
BiomagLab:mainfrom
MarcioCamposJr:feature/dualrobot-interface
Open

MarcioCamposJr wants to merge 38 commits into
BiomagLab:mainfrom
MarcioCamposJr:feature/dualrobot-interface

Conversation

@MarcioCamposJr

@MarcioCamposJr MarcioCamposJr commented Sep 14, 2025 •

Copy link
Copy Markdown
Collaborator

This PR is part of the "Simultaneous visualization and control of Two Robots for Dual Transcranial Magnetic Stimulation" project, and introduces support for communication with multiple robots (currently up to 2) through key modifications to the message handling and control logic. The changes enable better scalability and coordination in multi-robot environments.

⚠️ Warning: This modification will only work from the integration with the associated InVesalius pull request: invesalius/invesalius3#1024.

Main Changes

1. Robot ID Specification in Relay Server Messaging

  • Messages sent to and received from the relay_server now include a robot_id field.
  • This allows the system to properly route commands and telemetry to/from the correct robot.

2. Main Loop: Additional Flag for Second Robot

  • Added a flag robot_id in the main loop to enable interaction with a second robot.
  • Both robots can now operate concurrently with separate communication and control paths.

3. New Utility Functions

  • Introduced functions to clear errors and reset robot state
  • These ensure more robust and recoverable operation, especially in multi-agent scenarios.

4. Dynamic PID Adjustment for Collision Control

  • Implemented an adaptive PID tuning algorithm to respond to proximity and potential collision scenarios.
  • This allows the system to dynamically optimize movement parameters to prevent collisions in real-time.

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.

1 participant