Skip to content

DronaAviation/plutocontrol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

plutocontrol

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.

Installation

pip install plutocontrol

Usage

After installing the package, you can import and use the Pluto class in your Python scripts.

Example Usage

Example 1

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()

Class and Methods

Pluto Class

Connection

Commands to connect/ disconnect to the drone server.

#Connects from the drone server.
pluto.connect()

#Disconnects from the drone server.
pluto.disconnect()

Comera module

Sets the IP and port for the camera connection. should be intialized before pluto.connect().

pluto.cam()

Arm and Disarm Commands

#Arms the drone, setting it to a ready state.
pluto.arm()

#Disarms the drone, stopping all motors.
Pluto.disarm()

Pitch Commands

#Sets the drone to move forward.
pluto.forward()

#Sets the drone to move backward.
pluto.backward()

Roll Commands

#Sets the drone to move left (roll).
pluto.left()

#Sets the drone to move right (roll).
pluto.right()

Yaw Commands

#Sets the drone to yaw right.
pluto.right_yaw()

#Sets the drone to yaw left.
pluto.left_yaw()

Throttle Commands

Increase/ Decrease the drone's height.

#Increases the drone's height.
pluto.increase_height()

#Decreases the drone's height.
pluto.decrease_height()

Takeoff and Land

#Arms the drone and prepares it for takeoff.
pluto.take_off()

#Commands the drone to land.
pluto.land()

Developer Mode

Toggle Developer Mode

#Turns the Developer mode ON
pluto.DevOn()

#Turns the Developer mode OFF
pluto.DevOff()

motor_speed(motor_index, speed)

Sets the speed of a specific motor (motor index from 0 to 3).

pluto.motor_speed(0, 1500)

Get MSP_ALTITUDE Values

#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()

Get MSP_ALTITUDE Values

#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()

Get MSP_RAW_IMU Values

Accelerometer

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()

Gyroscope

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()

Magnetometer

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()

Calibration Commands

#Calibrates the accelerometer.
pluto.calibrate_acceleration()

#Calibrates the magnetometer.
pluto.calibrate_magnetometer()

Get MSP_Analog Values

#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()

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages