Showcase of traveling salesman problem on a mavlink drone. Demo video: https://www.youtube.com/watch?v=jAG2CS-mqwM
The program generates random points within given boundaries (here it's SJSU campus). Then, it looks for the optimal (shortest total distance) order to visit the points (traveling salesman problem).
- First, run gazebo simulation. Here, for simplicity it is run in a docker container. You can set the starting location using flags (e.g.
PX4_HOME_LAT=37.335404
)
docker run --rm -it --env PX4_HOME_LAT=37.335404 --env PX4_HOME_LON=-121.883400 --env PX4_HOME_ALT=488.0 jonasvautherin/px4-gazebo-headless:v1.9.2
- Run mavproxy to route traffic from simulation to multiple ports
mavproxy.py --master=udp:0.0.0.0:14550 --out=udp:localhost:14551 --out=udp:localhost:14552
- Install required packages:
pip3 install -r requirements.txt
- Run the program
python3 control/mission.py
- Run Qgroundcontrol to observe real-time trajectory of the drone.
Below there are non-optimized and optimized flight paths.
Optimized (video, 10x speed):