This project provides a ROS package for controlling the Pluto Drone via Keyboard Controls. It includes two Python nodes, drone_command_publisher.py
and drone_command_listener.py
, which communicate over the drone_command
topic using the PlutoMsg message type from the plutodrone ROS package.
-
drone_command_publisher.py
:- Uses a
pygame
window to capture keyboard inputs for controlling the drone. - Publishes these commands to the
drone_command
ROS topic. - Supported commands:
- Press 'q': Quit the controller.
- w/s: Increase/Decrease Pitch.
- a/d: Increase/Decrease Roll.
- i/k: Increase/Decrease Throttle.
- j/l: Increase/Decrease Yaw.
- e: Altitude Lock/Unlock.
- SpaceBar: Arm/Disarm the drone.
- Uses a
-
drone_command_listener.py
:- Subscribes to the
drone_command
topic. - Prints the current
PlutoMsg
commands being published by thedrone_command_publisher.py
.
- Subscribes to the
To use this package, you need to install the following dependencies:
- plutodrone package: Available here. This package provides the PlutoMsg message type used for controlling the drone.
- pygame library: Used to capture keyboard inputs.
- Install the plutodrone ROS package:
Clone the repository and build it in your ROS workspace:
cd ~/catkin_ws/src git clone https://github.com/DronaAviation/pluto-ros-package.git cd ~/catkin_ws catkin_make source devel/setup.bash
- Install the pygame library: You can install the
pygame
library using pip:pip install pygame
-
Run the
drone_command_publisher.py
node:
This node will open apygame
window to capture keyboard inputs and publish commands to thedrone_command
topic.rosrun drone-controller drone_command_publisher.py
-
Run the
drone_command_listener.py
node: This node subscribes to thedrone_command
topic and listens for published messages from the publisher node.rosrun drone-controller drone_command_listener.py
-
Control the drone using keyboard inputs:
- Press 'q': Quit the controller.
- w/s: Increase/Decrease Pitch.
- a/d: Increase/Decrease Roll.
- i/k: Increase/Decrease Throttle.
- j/l: Increase/Decrease Yaw.
- e: Altitude Lock/Unlock.
- SpaceBar: Arm/Disarm the drone.