A testbed for drone-server communications
home location - 14.079140, 100.609484
Run dronekit-sitl copter --home=14.079140,100.609484,584,353
This runs the SITL sim on port 5760 with the specified home location(lat,lng,alt,yaw).
(IMPORTANT) There is a version conflict for pymavlink with the dronekit sim (2.0.6) and mavproxy (2.3.4). A workaround is to
- Install the reqs for dronekit sim -
pip install dronekit-sitl
- Install the reqs for mavproxy -
pip install MAVProxy
TODO
(IMPORTANT) Requirements: Python 2.7
Pip packages: dronekit, dronekit-sitl(optional), MAVProxy
Run python hello-drone.py --connection_string--
to get a basic status message.
The connection_string
can be USB, serial or network.
For example: python hello-drone.py tcp:127.0.0.1:5760
will connect to a SITL simulator running at port TCP 5760 on the local machine.
Run python mission.py --connection_string-- --lattitude-- --longitude-- --drone_id--
to execute a mission to the specified destination.
The connection_string
can be USB, serial or network.
- connection_string
- latitude
- longitude
- drone_id (optional)(default=1) This is to specify to use the simultor(id=2) or the real drone(id=1).
python mission.py --help
for more info.
mavproxy.py --master tcp:127.0.0.1:5760 --out 127.0.0.1:14550 --out 127.0.0.1:14551 --aircraft S500
Use mavproxy to forward mavlink stream from 5760 to 14550 and 14551. In this case, the connection_string
in the CLI args would be udp:127.0.0.1:14551
.
NOTE: These streams are UDP only.
- Start SIM
- Start mavproxy.py
- Connect with scripts
- python ~/drone/drone-comms/drone/thrift/server.py udp:127.0.0.1:14550 --path /home/adam/drone/drone-comms/drone/thrift/gen-py
- python drone/thrift/delivery.py 14.076550 100.614012 5 --path /home/adam/drone/drone-comms/drone/thrift/gen-py --drone_id 1
-
python drone/thrift/farm.py "14.3,23.2 12.3,23.2" 5 --path /home/adam/drone/drone-comms/drone/thrift/gen-py --drone_id 3
-
python drone/thrift/farm.py "14.079013,100.609091 14.079751,100.60958130 14.079095,100.610117" --path /home/adam/drone/drone-comms/drone/thrift/gen-py --drone_id 3
- python ~/drone-comms/drone/thrift/server.py tcp:127.0.0.1:5760 --path /home/ubuntu/drone-comms/drone/thrift/gen-py