This guide contains a number of examples showing how to use DroneKit on Solo. These are stored on Github in separate folders under solodevguide/examples.
The examples can be run locally from your development computer to communicate with either Solo or a simulated copter, or they can be run on Solo itself.
The following instructions can be used to package each of the examples on a host computer, then deploy and run them on Solo:
Clone the solodevguide repo and navigate to your target example (in this example: "helloworld"):
git clone https://github.com/3drobotics/solodevguide
cd solodevguide/examples/helloworld
Connect your host computer and Solo to the Internet
(using the solo wifi
command).
Package the current example folder for installation on Solo using the solo script pack command
:
solo script pack
After some processing, this will create an archive called solo-script.tar.gz
in your current directory, or display an error if the process could not complete.
Install the script archive on Solo and run a specified script
using the solo script run
command (your computer
must be connected to the Solo wifi). In this example we start helloworld.py:
solo script run helloworld.py
The following instructions explain how to run the examples locally from a host PC, communicating with Solo.
Clone the solodevguide repo and navigate to your target example (in this example: "helloworld"):
git clone https://github.com/3drobotics/solodevguide
cd solodevguide/examples/helloworld
Connect your PC to the Solo WiFi network.
Run the target script as shown:
python helloworld.py
The following instructions explain how to run the examples locally from a host PC, communicating with a simulated device.
Set up a simulated vehicle using the instructions in the DroneKit documents here.
Clone the solodevguide repo and navigate to your target example (in this example: "helloworld"):
git clone https://github.com/3drobotics/solodevguide
cd solodevguide/examples/helloworld
Run the target script, specifying the SITL loopback address as shown:
python helloworld.py 127.0.0.1:14550