Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes mavlink id starting at 2 for sitl_multiple_run #23529

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

av-jeroen
Copy link

Solved Problem

Fixes #23480

Solution

  • Fixes off by one error.

Changelog Entry

For release notes:

Bugfix: Fixes mavlink id starting at 2 for sitl_multiple_run for gazebo_classic

Alternatives

We could also leave it as is. mav_sys_id=2 is not perse wrong, just unexpected.

Test coverage

not added

Context

not added

Copy link
Member

@Jaeyoung-Lim Jaeyoung-Lim left a comment

Choose a reason for hiding this comment

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

This is undoing the changes from #21183

@beniaminopozzan Can you chime in here?

@beniaminopozzan
Copy link
Member

So, the idea behind having the multi instance script starting the vehicles with MAV_ID = 2 instead of one was to separate the logic between single and multi-vehicle in sim w.r.t. the uxrcedds client:

  • Single vehicle: no additional namespace
  • Multi vehicle: use additional namespace

It is adopted here:

uxrce_dds_ns=""
if [ "$px4_instance" -ne "0" ]
then
# for multi intances setup, add namespace prefix
uxrce_dds_ns="-n px4_$px4_instance"
fi

And documented here: https://docs.px4.io/main/en/ros2/multi_vehicle.html#principle-of-operation

I am not against reverting this as long as it remains consistent with the documentation please.

FYI @av-jeroen you missed the second possible call of spawn_model:

spawn_model ${target_vehicle}${LABEL} $(($n + 1)) $target_x $target_y

@github-actions github-actions bot added the stale label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] sitl_multiple_run for gazebo-classic starts with wrong mav_sys_id
3 participants