$ make
Connect the USB programming cable to your Pixhawk.
If you want to be able to interact with this example in Pixhawk's NuttX shell, you'll need a Telemetry Radio or an FTDI developer's cable. See the Exploration section below for more detail.
Also Note: Using a UART (serial) connection should be preferred over using the USB port for flying systems. The reason being that the driver for the USB port is much more complicated, so the UART is a much more trusted port for flight-critical functions. To learn how this works though the USB port will be fine and instructive.
You have to pick a port name, try searching for it with
$ ls /dev/ttyACM*
$ ls /dev/ttyUSB*
Alternatively, plug in Pixhawk USB cable again and issue the command:
$ dmesg
The device described at the bottom of dmesg's output will be the port on which the Pixhawk is mounted.
The Pixhawk USB port will show up on a ttyACM*
, an FTDI cable will show up on a ttyUSB*
.
Run the example executable on the host shell:
$ ./mavlink_control -d /dev/ttyACM0 -b 57600 -a -f 1000
# usage: mavlink_control [-d <devicename> -b <baudrate>] [-u <udp_ip> -p <udp_port>] [-a ] [-f <syn_frequency>]
To stop the program, use the key sequence Ctrl-C
.