A library for controlling Pluto drones for the Christ University projects
Project description
This project is based on plutocontrol By Saail Chavan
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 pypluto-christ
Usage
After installing the package, you can import and use the Pluto class in your Python scripts.
Example Usage
Example 1
from pypluto 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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pypluto_christ-0.2.0.tar.gz.
File metadata
- Download URL: pypluto_christ-0.2.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e987381762f168e4f086f0d0d30519083ccb1fbc1bca8037b34917587779415b
|
|
| MD5 |
70115fc01ce13c14fcdf0adfc8a47767
|
|
| BLAKE2b-256 |
344c3ef44b9bb8e75f7d1fbf5b9e9fb7c482138fcc64c8398067fd48f41711c1
|
File details
Details for the file pypluto_christ-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pypluto_christ-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6727852ab6aa1c6ab1e13f4c261e4bff6c311aa1fcc264147a609283a5c2d6f
|
|
| MD5 |
497aa2a6af6906b310b09fa5524baef5
|
|
| BLAKE2b-256 |
cb8a31ea34de90b615bbfe195f234f7ee23e944f3237e014cd7bf93b4d3fc819
|