Skip to content

Conversation

Copy link

Copilot AI commented Nov 3, 2025

The model.sdf contained both MulticopterAttitudeControl and MulticopterAccelerationControl plugins running simultaneously. Both publish to command/motor_speed and control the same rotors, causing conflicts when users send commands to multiple topics.

Changes

Separated controller configurations into dedicated model files:

  • model_attitude.sdf - attitude controller only (subscribes to cmd/att)
  • model_acceleration.sdf - acceleration controller only (subscribes to cmd/acc)
  • model.sdf - now contains only attitude controller for backward compatibility

Added launch-time controller selection:

  • New controller argument in start_sim.launch.xml (defaults to attitude)
  • Dynamically loads model_$(var controller).sdf based on user selection

Documentation:

  • CONTROLLERS.md - detailed controller comparison and usage
  • Updated README.md with selection examples

Usage

# Attitude control (default)
ros2 launch rmf_gz start_sim.launch.xml controller:=attitude

# Acceleration control
ros2 launch rmf_gz start_sim.launch.xml controller:=acceleration

Only one controller loads per instance, preventing motor command conflicts.

Original prompt

This section details on the original issue you should resolve

<issue_title>Simultaneous / conflicting controllers?</issue_title>
<issue_description>There are two control plugins operating simultaneously within the model.sdf.

I,e, the acceleration and attitude controllers.

If the user chooses to even send a message to more than one during simulation, they both will conflict with each other and become unusable? How can we over come this? Would a launch file argument help for this?

Ref:

Here:

<plugin filename="libgz-sim-multicopter-attitude-control-system.so" name="gz::sim::systems::MulticopterAttitudeControl">

and
here:
<plugin filename="libgz-sim-multicopter-acceleration-control-system.so" name="gz::sim::systems::MulticopterAccelerationControl">

</issue_description>

<agent_instructions>Suggest solutions to fix discrepancies that may occur due to this setup in a clean way.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 3, 2025 13:41
- Created model_attitude.sdf with only attitude controller
- Created model_acceleration.sdf with only acceleration controller
- Modified default model.sdf to use only attitude controller (backward compatibility)
- Updated launch file to support controller selection via launch argument
- Added comprehensive documentation in CONTROLLERS.md
- Updated README.md with controller selection instructions

Co-authored-by: mihirk284 <[email protected]>
- Fixed README.md to correctly indicate attitude controller is the default
- Fixed inconsistent indentation (tabs to spaces) in model files

Co-authored-by: mihirk284 <[email protected]>
Copilot AI changed the title [WIP] Simultaneous / conflicting controllers? Fix conflicting multicopter controllers via launch-time selection Nov 3, 2025
Copilot AI requested a review from mihirk284 November 3, 2025 13:46
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.

Simultaneous / conflicting controllers?

2 participants