SITL Multi-vehicle Swarm Simulator

Hi,

I'm trying to setup a simulation environment for a multi-vehicle system using ArduCopter SITL. Right now I have a script that starts multiple ArduCopter instances but I need to change the ID of the UAV in order to be able to distinguish between them.

I can do "param set SYSID_THISMAV 2" for the second UAV but the changes only take place once I restart the ArduCopter instance. 

I tried modifying sim_vehicle.sh and adding "--cmd= param set SYSID_THISMAV 2" when initialising mavproxy but I get the following output: "Unable to find parameter 'SYSID_THISMAV'. The result is that the ID doesn't change. 

I'm able to start an instance, change the ID manually and restart but the process is tedious and it would be very useful to set it up from the start. 

Any help is highly appreciated!

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi! I'm trying to simulate multiple UAVs in PX4 SITL. I am trying to start two instances of jmavsim , but I am kinda stuck. How did you configure udp ports for different instances?

    Pere Molins Ayuso said:

    Hi,

    What I ended up doing is creating multiple folders with the ArduCopter code. Each corresponds to one UAV with its own configuration and SYSID. (ardupilot/ArduCopter1 , ardupilot/ArduCopter2, ...)

    Then I start a terminal with the different instances from each folder:

    gnome-terminal \
    --tab -t ArduCopter1 -e "bash -c \"cd ~/ardupilot/ArduCopter;sim_vehicle.sh -v ArduCopter -I 1 -L LOC1; exec bash\"" \
    --tab -t ArduCopter2 -e "bash -c \"sleep 2; cd ~/ardupilot/ArduCopter2;sim_vehicle.sh -v ArduCopter -I 2 -L LOC2;exec bash\"" \
    --tab -t ArduCopter3 -e "bash -c \"sleep 5; cd ~/ardupilot/ArduCopter3;sim_vehicle.sh -v ArduCopter -I 3 -L LOC3;exec bash\"" \

    I'm sure there are other (probably cleaner) ways to do it but this works for me.

  • Hello i am very much interested in a similar setup for my research . How did you go about changing the port for each Arducopter instance.. cause i think it uses port 14550 by default right??..and if this is not changed it leads to a lot of conflict.

    thanks  for any help .

  • Could you please share the script that starts multiple ArduCopter instances and the way how you manage to do it? Thanks.

    • Hi,

      What I ended up doing is creating multiple folders with the ArduCopter code. Each corresponds to one UAV with its own configuration and SYSID. (ardupilot/ArduCopter1 , ardupilot/ArduCopter2, ...)

      Then I start a terminal with the different instances from each folder:

      gnome-terminal \
      --tab -t ArduCopter1 -e "bash -c \"cd ~/ardupilot/ArduCopter;sim_vehicle.sh -v ArduCopter -I 1 -L LOC1; exec bash\"" \
      --tab -t ArduCopter2 -e "bash -c \"sleep 2; cd ~/ardupilot/ArduCopter2;sim_vehicle.sh -v ArduCopter -I 2 -L LOC2;exec bash\"" \
      --tab -t ArduCopter3 -e "bash -c \"sleep 5; cd ~/ardupilot/ArduCopter3;sim_vehicle.sh -v ArduCopter -I 3 -L LOC3;exec bash\"" \

      I'm sure there are other (probably cleaner) ways to do it but this works for me.

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @SahikaGenc: AWS DeepRacer & Hot Wheels Track https://youtu.be/4H0Ei07RdR4 via @YouTube
Monday
DIY Robocars via Twitter
Sep 8
DIY Robocars via Twitter
RT @davsca1: We are releasing the code of our Fisher Information Field, the first dedicated map for perception-aware planning that is >10x…
Sep 8
DIY Robocars via Twitter
RT @SmallpixelCar: How this works: 1)object detection to find cones in single camera image, 30 frames/sec on @NVIDIAEmbedded Xavier. 2)comp…
Sep 8
DIY Robocars via Twitter
RT @SmallpixelCar: Use two color cones to guide the robocar. No map needed, on onsite training needed. Just place the cones and it will fol…
Sep 7
DIY Robocars via Twitter
Sep 7
DIY Robocars via Twitter
RT @roboton_io: Great to see http://roboton.io running at 60fps on the cheapest #chromebook we could find! #edtech #robotics #educat…
Sep 3
DIY Robocars via Twitter
RT @openmvcam: Crazy in-depth article about using the OpenMV Cam for Astrophotography: https://github.com/frank26080115/OpemMV-Astrophotography-Gear https://t.co/BPoK9QDEwS
Sep 3
DIY Robocars via Twitter
RT @openmvcam: Hi folks, it's finally here! Our first draft of our Arduino Interface Library is out! It works over SoftwareSerial, Hardware…
Sep 3
DIY Robocars via Twitter
RT @chr1sa: Please let them have an open API. This would be perfect for @DIYRobocars races https://twitter.com/NintendoAmerica/status/1301513099707658246
Sep 3
DIY Robocars via Twitter
RT @SmallpixelCar: Lanenet pretty much used all my GPU power on @NVIDIAEmbedded Xavier since I optimized with tensorRT. I need to run anoth…
Sep 3
xemone liked Max Gilson's profile
Aug 31
DIY Robocars via Twitter
RT @LyftLevel5: Our @kaggle competition on Motion Prediction for Autonomous Vehicles is now live! Experiment with the largest-ever self-dri…
Aug 24
DIY Robocars via Twitter
RT @chr1sa: Our next @DIYRobocars virtual AI car race will be on Sept 26th. Sign up here https://www.meetup.com/DIYRobocars/events/272786977/ https://t.co/UENKGSOWO8
Aug 24
DIY Robocars via Twitter
New ready-to-run @NVIDIAEmbedded JetRacer car from Waveshare. Perfect for the next @diyrobocars race as soon as we… https://twitter.com/i/web/status/1297960223013867520
Aug 24
DIY Drones via Twitter
RT @chr1sa: The US government just approved 5 US-made drones for purchase, all based on the @Dronecode @PX4Autopilot standard. Great news f…
Aug 20
More…