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

Add multi_mavsdk_server.sh util #1937

Merged
merged 1 commit into from
Dec 13, 2022

Conversation

antonio-sc66
Copy link
Contributor

@antonio-sc66 antonio-sc66 commented Nov 29, 2022

Bash script that eases spawning multiple mavsdk_server processes. Useful to perform multi vehicle testing, both in SITL and real executions.

Instances are spawned following the next pattern:

./mavsdk_server -p 50040 udp://:14540
./mavsdk_server -p 50041 udp://:14541
./mavsdk_server -p 50042 udp://:14542

Mavsdk-Server executable name can easily be selected by editing a constant, same with the spawned process name.

It Kills the already running mavsdk_server instances when it's launched and then clears the spawned processes at exit

I use it in conjunction with scripts like sitl_multiple_run.sh

Execution example:
User has the mavsdk_server_manylinux2010-x64 binary in the parent folder and executes the script:

./multi_mavsdk_server.sh -n 3
Killing already running mavsdk-server instances
Spawning: 3 instances
Instance:  0 udp://: 14540 -p 50050  PID: 114123
Instance:  1 udp://: 14541 -p 50051  PID: 114124
Instance:  2 udp://: 14542 -p 50052  PID: 114125
[09:12:27|Info ] MAVSDK version: v1.4.9 (mavsdk_impl.cpp:20)
[09:12:27|Info ] MAVSDK version: v1.4.9 (mavsdk_impl.cpp:20)
[09:12:27|Info ] Waiting to discover system on udp://:14540... (connection_initiator.h:20)
[09:12:27|Info ] Waiting to discover system on udp://:14542... (connection_initiator.h:20)
[09:12:27|Info ] MAVSDK version: v1.4.9 (mavsdk_impl.cpp:20)
[09:12:27|Info ] Waiting to discover system on udp://:14541... (connection_initiator.h:20)

Bash script that eases spawning multiple mavsdk_server processes.
Useful to perform multi vehicle testing, both in SITL and real executions
Copy link
Collaborator

@julianoes julianoes left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for the contribution @antonio-sc66.

@julianoes julianoes merged commit 66a69e9 into mavlink:main Dec 13, 2022
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.

3 participants