Skip to main content

A library for controlling Pluto drones

Project description

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
drone = pluto()

# Connect to the drone
drone.connect()

# Arm the drone
drone.arm()

# Disarm the drone
drone.disarm()

# Disconnect from the drone
drone.disconnect()

Class and Methods

Pluto Class

__init__()

Initializes the Pluto object with default RC values and starts the write function in a separate thread.

connect()

Connects to the drone server.

pluto.connect()

disconnect()

Disconnects from the drone server.

pluto.disconnect()

set_camera_ip_port(ip, port)

Sets the IP and port for the camera connection.

pluto.set_camera_ip_port('192.168.0.2', 9060)

arm()

Arms the drone, setting it to a ready state.

pluto.arm()

box_arm()

Arms the drone with the throttle set to 1800.

pluto.box_arm()

disarm()

Disarms the drone, stopping all motors.

pluto.disarm()

forward()

Sets the drone to move forward.

pluto.forward()

backward()

Sets the drone to move backward.

pluto.backward()

left()

Sets the drone to move left (roll).

pluto.left()

right()

Sets the drone to move right (roll).

pluto.right()

left_yaw()

Sets the drone to yaw left.

pluto.left_yaw()

right_yaw()

Sets the drone to yaw right.

pluto.right_yaw()

reset()

Resets the RC values to the default state.

pluto.reset()

increase_height()

Increases the drone's height.

pluto.increase_height()

decrease_height()

Decreases the drone's height.

pluto.decrease_height()

take_off()

Arms the drone and prepares it for takeoff.

pluto.take_off()

land()

Commands the drone to land.

pluto.land()

rc_values()

Returns the current RC values.

values = pluto.rc_values()

motor_speed(motor_index, speed)

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

pluto.motor_speed(0, 1200)

trim_left_roll()

Trims the left roll by increasing the RC roll value.

pluto.trim_left_roll()

get_height()

Returns the height of the drone from the sensors.

height = pluto.get_height()

get_vario()

Returns the rate of change of altitude from the sensors.

vario = pluto.get_vario()

get_roll()

Returns the roll value from the drone.

roll = pluto.get_roll()

get_pitch()

Returns the pitch value from the drone.

pitch = pluto.get_pitch()

get_yaw()

Returns the yaw value from the drone.

yaw = pluto.get_yaw()

get_acc_x()

Returns the accelerometer value for the x-axis.

acc_x = pluto.get_acc_x()

get_acc_y()

Returns the accelerometer value for the y-axis.

acc_y = pluto.get_acc_y()

get_acc_z()

Returns the accelerometer value for the z-axis.

acc_z = pluto.get_acc_z()

get_gyro_x()

Returns the gyrometer value for the x-axis.

gyro_x = pluto.get_gyro_x()

get_gyro_y()

Returns the gyrometer value for the y-axis.

gyro_y = pluto.get_gyro_y()

get_gyro_z()

Returns the gyrometer value for the z-axis.

gyro_z = pluto.get_gyro_z()

get_mag_x()

Returns the magnetometer value for the x-axis.

mag_x = pluto.get_mag_x()

get_mag_y()

Returns the magnetometer value for the y-axis.

mag_y = pluto.get_mag_y()

get_mag_z()

Returns the magnetometer value for the z-axis.

mag_z = pluto.get_mag_z()

calibrate_acceleration()

Calibrates the accelerometer.

pluto.calibrate_acceleration()

calibrate_magnetometer()

Calibrates the magnetometer.

pluto.calibrate_magnetometer()

get_battery()

Returns the battery value in volts from the drone.

battery = pluto.get_battery()

get_battery_percentage()

Returns the battery percentage from the drone.

battery_percentage = pluto.get_battery_percentage()

send_packet(buff)

Sends a packet to the drone.

pluto.send_packet(buff)

receive_packet()

Receives a packet from the drone.

packet = pluto.receive_packet()

read16(arr)

Unpacks a byte array to extract 16-bit values.

value = pluto.read16(arr)

With this README.md, users will have a comprehensive understanding of the library's functionality and how to use it effectively.



Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plutocontrol-0.2.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plutocontrol-0.2.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file plutocontrol-0.2.0.tar.gz.

File metadata

  • Download URL: plutocontrol-0.2.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.0

File hashes

Hashes for plutocontrol-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8ba4867b4dcbe089ce15bd9351c5673434e9dea17375452ce2976457b519b69c
MD5 def88b44fd9b362e88b4ce59c5e7413a
BLAKE2b-256 1076458c297db43c6dd0e97fb69a303e7d9518f8d06350360e7ab86c56ee54f5

See more details on using hashes here.

File details

Details for the file plutocontrol-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: plutocontrol-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.0

File hashes

Hashes for plutocontrol-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3207acf575468dbc735b57f4041d5a9450ddc951ffbd321aa76b684d112adcab
MD5 64c3915841808caa13375fb5730d93f0
BLAKE2b-256 d0f3cce03fe84940cdf0924b695665d1aa94f03780ec18ecc4f1bf19f15ee971

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page