Skip to content

Starting the Vehicle

Evan Shui edited this page Dec 13, 2018 · 11 revisions

Both

Environment

Python

Make sure that when you execute python, that you are running python2.7 and that you have installed all of the modules detailed in the modules wiki page.

Simulating

Hardware

The only hardware you need for simulating your vehicle is your laptop.

Software

We will be using dronekit-sitl to simulate a vehicle. In order to simulate the vehicle, you need to run at least three commands.

Instantiating a 'vehicle':

dronekit-sitl copter --home=35.9835973,-95.8742309,0,180 --model=quad

Running mavproxy:

mavproxy.py --master tcp:127.0.0.1:5760 --out udp:127.0.0.1:14551 --out udp:127.0.0.1:14550

Running your script:

python {script_name} --connect udp:127.0.0.1:14551

If you want to use a ground station to visualize your simulator, connect on udp port 14551. Since there is no physical connection being established, baud rate is not necessary to simulate vehicles.

In Real Life

Hardware

buad rate

click here for a more in-depth definition of baud rate. You can see what buad rate the pixhawk is currently set to (for Serial 0) by looking up its parameters in Q Ground Control. If they don't match, then you won't be able to establish a connection with the Pixhawk.

telem2 wires

Make sure that the connector connected to the telem2 wires is in it's correct orientation. If they aren't, the raspberry pi won't be able to establish a connection with the Pixhawk. In order to make sure that there is a proper connection established between the raspberry pi and the Pixhawk, execute this: sudo -s mavproxy.py --master=/dev/serial0 --baudrate 57600 --aircraft MyCopter If SERIAL0_BAUD on Pixhawk is different than 57600, then change to that value. /dev/serial0 corresponds to the pins on the raspberry pi. Your terminal should look like this: this.
Look here for a more detailed explanation of connectin the raspberry pi to the pixhawk.

Pixhawk Colors

Click here to see what the colors mean.

Arming

In order to properly arm the vehicle, make sure that the DX8 controller is on and that the hardware safety switch has been turned off.

If the Pixhawk is blinking green by now, the drone should be ready to fly.