GithubHelp home page GithubHelp logo

xiaojiean / uav_ros_px4_navigation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from okarimpour/uav_ros_px4_navigation

0.0 0.0 0.0 3.07 MB

SLAM and 2D/3D Navigation of UAV using ROS, Gazebo, PX4, Mavlink, MAVROS

uav_ros_px4_navigation's Introduction

UAV_ROS_PX4_Navigation

This project is based on ROS "Melodic", and Gazebo 9

  1. Go to home directory and clone the project:
$ cd
$ git clone https://github.com/okarimpour/UAV_ROS_PX4_Navigation.git --recurse-submodules 
  1. Add "control_toolbox" to the workspace and build it from source:
$ rosdep install --from-paths src --ignore-src --rosdistro melodic -y
  1. build:
$ catkin clean --all -y
$ catkin build

Sidenote: If you are having problem with build:

$ cd UAV_ROS_PX4_Navigation/logs/px4
$ vim build.make.XXX.log

# Most likly you are missing packaging so:
$ pip3 install --user empy numpy keras packaging
$ pip install --user empy numpy keras packaging
$ sudo apt-get install libgstreamer-plugins-base1.0-dev
  1. Bringing up jmavsim:
$ cd UAV_ROS_PX4_Navigation/src/Firmware/
$ make px4_sitl jmavsim
pxh> commander takeoff

To fix "make px4_sitl jmavsim" errors caused by using Java 11:

$ sudo apt install openjdk-8-jdk
$ sudo update-alternatives --config java # choose 8
$ cd ~/catkin_ws/src/Firmware
$ rm -rf Tools/jMAVSim/out
  1. Bringing up Gazebo:
$ make px4_sitl gazebo

To fix the "make px4_sitl gazebo" errors:

$ sudo apt install libgstreamer1.0-dev
$ sudo apt install gstreamer1.0-plugins-good
$ sudo apt install gstreamer1.0-plugins-bad
$ sudo apt install gstreamer1.0-plugins-ugly
  1. Let's check the off board node on Gazebo:
$ source ~/UAV_ROS_PX4_Navigation/devel/setup.bash
$ roscore

$ roslaunch mavros px4.launch fcu_url:="udp://:[email protected]:14557"

#launch Gazebo with the drone on a new terminal
$ cd UAV_ROS_PX4_Navigation/src/Firmware/
$ DONT_RUN=1 make px4_sitl_default gazebo
$ source ~/UAV_ROS_PX4_Navigation/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
$ roslaunch px4 posix_sitl.launch

#Run the offb_node on a new terminal
$ source ~/UAV_ROS_PX4_Navigation/devel/setup.bash
$ rosrun mavros offb_node

#Echo the states on a new terminal
$ source ~/UAV_ROS_PX4_Navigation/devel/setup.bash
$ rostopic echo /mavros/state

#Check the connections using rqt_graph on a new terminal
$ source ~/UAV_ROS_PX4_Navigation/devel/setup.bash
$ rosrun rqt_graph rqt_graph

uav_ros_px4_navigation's People

Contributors

okarimpour avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.