MAVProxy is a powerful command-line ground control station for UAVs. It allows you to monitor, control, and configure your drone from your terminal. Below is a guide on common MAVProxy commands and examples on how to use them effectively.
Before diving into MAVProxy commands, ensure you have completed the steps in the Installing ArduPilot and MAVProxy on Ubuntu 20.04 guide.
Start MAVProxy with the following command:
mavproxy.py --master=<connection_string>
To connect to a flight controller over USB:
mavproxy.py --master=/dev/ttyUSB0 --baudrate 115200 --aircraft MyCopter
Replace /dev/ttyUSB0
with your specific device path.
Once MAVProxy is running, you can issue commands via the console. Below are some of the essential commands:
-
arm throttle: Arms the drone, enabling the motors.
arm throttle
Example:
arm throttle
-
disarm: Disarms the drone, stopping the motors.
disarm
-
mode <mode_name>: Changes the flight mode.
mode GUIDED
Example:
mode LOITER
-
takeoff : Commands the drone to take off to a specified altitude.
takeoff 10
-
wp load : Loads a mission plan from a file.
wp load mission.txt
Example:
wp load /path/to/mission.txt
-
wp list: Lists all waypoints in the current mission.
wp list
-
wp clear: Clears the current mission waypoints.
wp clear
-
guided : Commands the drone to fly to a specified location in GUIDED mode.
guided 37.7749 -122.4194 50
-
status: Displays the current status of the drone, including GPS, battery, and more.
status
-
altitude: Shows the current altitude of the drone.
altitude
-
battery: Displays the current battery voltage and current usage.
battery
-
attitude: Shows the current attitude (pitch, roll, yaw) of the drone.
attitude
-
param set : Sets a parameter to a specified value.
param set ALT_HOLD_RTL 1000
-
param show: Lists all the parameters and their current values.
param show
-
module load <module_name>: Loads a MAVProxy module.
module load map
-
module unload <module_name>: Unloads a MAVProxy module.
module unload map
mavproxy.py --master=/dev/ttyUSB0 --baudrate 115200 --aircraft MyCopter
In the MAVProxy console:
arm throttle
Start MAVProxy:
mavproxy.py --master=/dev/ttyUSB0 --baudrate 115200 --aircraft MyCopter
In the MAVProxy console:
mode GUIDED
takeoff 10
To land the drone:
mode LAND
Start MAVProxy:
mavproxy.py --master=/dev/ttyUSB0 --baudrate 115200 --aircraft MyCopter
In the MAVProxy console:
mode GUIDED
guided 37.7749 -122.4194 50
Start MAVProxy:
mavproxy.py --master=/dev/ttyUSB0 --baudrate 115200 --aircraft MyCopter
In the MAVProxy console:
wp load /path/to/mission.txt
mode AUTO
These commands and examples provide a basic understanding of how to use MAVProxy to control your drone. For more advanced usage and detailed command options, refer to the MAVProxy Documentation.