plutocontrol is a Python library for controlling Pluto drones. This library provides various methods to interact with the drone, including connecting, controlling movements, and accessing sensor data.
pip install plutocontrol
After installing the package, you can import and use the Pluto
class in your Python scripts.
from plutocontrol import Pluto
# Create an instance of the Pluto class
pluto = Pluto()
# Connect to the drone
pluto.connect()
# Arm the drone
pluto.arm()
# Disarm the drone
pluto.disarm()
# Disconnect from the drone
pluto.disconnect()
Commands to connect/ disconnect to the drone server.
#Connects from the drone server.
pluto.connect()
#Disconnects from the drone server.
pluto.disconnect()
Sets the IP and port for the camera connection. should be intialized before pluto.connect().
pluto.cam()
#Arms the drone, setting it to a ready state.
pluto.arm()
#Disarms the drone, stopping all motors.
Pluto.disarm()
#Sets the drone to move forward.
pluto.forward()
#Sets the drone to move backward.
pluto.backward()
#Sets the drone to move left (roll).
pluto.left()
#Sets the drone to move right (roll).
pluto.right()
#Sets the drone to yaw right.
pluto.right_yaw()
#Sets the drone to yaw left.
pluto.left_yaw()
Increase/ Decrease the drone's height.
#Increases the drone's height.
pluto.increase_height()
#Decreases the drone's height.
pluto.decrease_height()
#Arms the drone and prepares it for takeoff.
pluto.take_off()
#Commands the drone to land.
pluto.land()
Toggle Developer Mode
#Turns the Developer mode ON
pluto.DevOn()
#Turns the Developer mode OFF
pluto.DevOff()
Sets the speed of a specific motor (motor index from 0 to 3).
pluto.motor_speed(0, 1500)
#Returns the height of the drone from the sensors.
height = pluto.get_height()
#Returns the rate of change of altitude from the sensors.
vario = pluto.get_vario()
#Returns the roll value from the drone.
roll = pluto.get_roll()
#Returns the pitch value from the drone.
pitch = pluto.get_pitch()
#Returns the yaw value from the drone.
yaw = pluto.get_yaw()
Returns the accelerometer value for the x,y,z - axis.
#Returns the accelerometer value for the x-axis.
acc_x = pluto.get_acc_x()
#Returns the accelerometer value for the y-axis.
acc_y = pluto.get_acc_y()
#Returns the accelerometer value for the z-axis.
acc_z = pluto.get_acc_z()
Returns the Gyroscope value for the x,y,z - axis.
#Returns the Gyroscope value for the x-axis.
gyro_x = pluto.get_gyro_x()
#Returns the Gyroscope value for the y-axis.
gyro_y = pluto.get_gyro_y()
#Returns the Gyroscope value for the z-axis.
gyro_z = pluto.get_gyro_z()
Returns the Magntometer value for the x,y,z - axis.
#Returns the Magnetometer value for the x-axis.
mag_x = pluto.get_mag_x()
#Returns the Magnetometer value for the y-axis.
mag_y = pluto.get_mag_y()
#Returns the Magnetometer value for the z-axis.
mag_z = pluto.get_mag_z()
#Calibrates the accelerometer.
pluto.calibrate_acceleration()
#Calibrates the magnetometer.
pluto.calibrate_magnetometer()
#Returns the battery value in volts from the drone.
battery = pluto.get_battery()
#Returns the battery percentage from the drone.
battery_percentage = pluto.get_battery_percentage()