mavros-px4-vehicle

A Python API developed to control a PX4-enabled drone with MAVROS commands.

https://github.com/troiwill/mavros-px4-vehicle

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.1%) to scientific vocabulary

Keywords

drone gazebo mavlink mavros melodic noetic px4 python python2 python3 quadcopter quadrotor ros ros-melodic ros-noetic
Last synced: 4 months ago · JSON representation ·

Repository

A Python API developed to control a PX4-enabled drone with MAVROS commands.

Basic Info
  • Host: GitHub
  • Owner: troiwill
  • License: gpl-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 60.5 KB
Statistics
  • Stars: 8
  • Watchers: 1
  • Forks: 2
  • Open Issues: 1
  • Releases: 0
Topics
drone gazebo mavlink mavros melodic noetic px4 python python2 python3 quadcopter quadrotor ros ros-melodic ros-noetic
Created almost 4 years ago · Last pushed almost 3 years ago
Metadata Files
Readme License Citation

README.md

MAVROS PX4 Vehicle, A ROS Package

Overview

This codebase is a ROS package that allows a user to communicate with PX4 autopilot using MAVROS. This package was developed for Ubuntu 18.04 LTS (Bionic Beaver) and ROS Melodic. However, this pacakge also works with Ubuntu 20.04 LTS (Focal Fossa) and ROS Noetic.

Users can control a PX4-enabled vehicle within Python ROS nodes with this API. Currently, the API can control a multi-rotor aircraft.

Installation

These instructions assume you already have the appropriate version of Gazebo, ROS, and the PX4 autopilot. You will also need to install QCGroundControl. If not, please follow these instructions. To add this package to your catkin workspace, simply clone this repository, navigate to your catkin workspace, create a link to the ROS package, and then go through your catkin build process.

```

Clone this repository.

mkdir -p ${HOME}/repos && cd ${HOME}/repos git clone https://github.com/troiwill/mavros-px4-vehicle.git

Make the Python scripts executable.

chmod +x mavros-px4-vehicle/scripts/.py chmod +x mavros-px4-vehicle/test/.py

Go to the src directory of your catkin_ws root dir.

cd ${HOME}/catkin_ws cd src

Link the ROS package from this repository.

ln -s ${HOME}/repos/mavros-px4-vehicle mavros-px4-vehicle

Go to your catkin_ws root dir and build the environment.

cd ${HOME}/catkin_ws catkin build source devel/setup.bash ```

Quick start

Perform the following tasks to ensure this package it working with your setup.

1) Start QCGroundControl and enable the joysticks via Settings. If you do not enable the joysticks, the vehicle will not arm or take off.

2) Set up your environment to use PX4 autopilot. You will always have to run these following when you open a new terminal. cd ${HOME}/repos/PX4-Autopilot DONT_RUN=1 make px4_sitl_default gazebo source ~/catkin_ws/devel/setup.bash source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd) export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Tools/sitl_gazebo

3) Run the test launch file. roslaunch mavros_px4_vehicle test_vehicle.test

4) Assuming all the tests are successful, you should now run the offboard hover Python script. You must use two (2) terminal windows to run the script. The first terminal window should run MAVROS, Gazebo, and PX4. roslaunch px4 mavros_posix_sitl.launch

The second terminal window should run the hover script. rosrun mavros_px4_vehicle offboard_hover.py If the script is successful, the drone should hover a few meters above the ground.

Owner

  • Name: Troi Williams
  • Login: troiwill
  • Kind: user
  • Company: University of Maryland

Postdoctoral fellow focusing on machine learning and robotics. Primary research: perception and quantifying perception (measurement) bias and uncertainty.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Williams"
  given-names: "Troi"
  orcid: "http://orcid.org/0000-0002-1290-9161"
title: "mavros-px4-vehicle: Using Python and MAVROS to Control PX4-Enabled Drones"
version: 0.1.0
date-released: 2022-08-17
url: "https://github.com/troiwill/mavros-px4-vehicle"

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Dependencies

pyproject.toml pypi
  • numpy >=1.23.2
  • scipy ==1.9.0
setup.py pypi