Giter Site home page Giter Site logo

haritsahm / px4-trajectoryreplanning Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 11.06 MB

This is part of my capstone project. A trajectory planning and tracking with pixhawk controller

License: GNU Lesser General Public License v3.0

CMake 14.56% C++ 81.78% Shell 3.66%
pixhawk pixhawk-controller ros gazebo

px4-trajectoryreplanning's Introduction

Trajectory Replanning Using RRT* and Circular Buffer

This repo is for exploring PX4 SITL & HITL Mode and UAV trajectory replanning using RRT* in Ewok-Replanning RRT*


1. Download Repository and all of its submodules

Pull all of the repo and its submodule using

git clone --branch melodic-dev --recurse-submodules https://github.com/haritsahm/PX4-TrajectoryReplanning.git

check if these folder is inside src: ewok, mavros_controllers, px4, and px4_trajectory_replanning, px4_simulation

After that run this command to download the submodules

git submodule update --init --recursive

After everything is finished, we need to create a symlink from src to the mavlink_sitl_gazebo inside px4/Tools if its not available.

cd src/ # move to src directory
ln -s px4/Tools/sitl_gazebo/ mavlink_sitl_gazebo

2. Build workspace using python3

Because several packages generate the same target directory, we use catkin build to avoid these errors. Suggested by Effective Robotics Programming with ROS - Third Edition#1

A. From terminal on workspace directory

Build workspace using python3 interpreter from terminal

catkin build --cmake-args -DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_ROS_INTERFACE=ON --make-args -j4

B. Using Qt Creator

Similar to Setup Qt Creator for ROS by Levi Armstrong

  1. First open the project, then navigate to the Projects > Build Settings
  2. Remove existing "Build Steps".
  3. Add a custom build step Add Build Step > Custom Process Step as shown below.
    • Command: /usr/local/bin/catkin
    • Arguments: build --cmake-args -DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_ROS_INTERFACE=ON --make-args -j2
    • Working directory: %{CurrentProject:Path}
  4. Remove existing "Clean Steps".
  5. Add a custom clean step Add Clean Step > Custom Process Step as shown below.
    • Command: /usr/local/bin/catkin
    • Arguments: clean
    • Working directory: %{CurrentProject:Path}

3. Running Simulation

A. Plain RRT Simulation

Use rviz to vizualize the simulation

rviz -d src/ewok/ewok_simulation/rviz/simulation_rrt.rviz 

1. run this to command to simulate in cones

roslaunch ewok_simulation trajectory_replanning_simulation_rrt.launch 

Trajectory Replanning Using RRT* - Test Cones

2. run this to command to simulate in Forest

roslaunch ewok_simulation trajectory_replanning_forest_rrt.launch 

Trajectory Replanning Using RRT* - Test Forest


B. Using PX4 SITL Mode

1. Run the Gazebo PX4 SITL mode

Please run this everytime you want to connect it with offboard controller or after editing the offboard controller

roslaunch px4_trajectory_replanning px4_gazebo_cones.launch 

2. Run Rviz

roslaunch px4_trajectory_replanning px4_rviz.launch 

3. Run the Offboard Controller

This is the main offboard controller

roslaunch px4_trajectory_replanning px4_offboard_controller.launch 

4. Run the Offboard Interface

roslaunch px4_trajectory_replanning px4_offboard_interface.launch 

Wait for a few seconds until the mode status is filled.

  • Press the offboard button to change the pixhawk mode to offboard control
  • wait for 3 seconds and then send any desired tasks
  • Do not start the mission instruction before the replanning system is running

5. Run the Replanning System

roslaunch px4_trajectory_replanning trajectory_replanning_rrt.launch 

##License

This project is licensed under the GNU Lesser General Public License Version 3 (LGPLv3). The interface was developed using Qt Designer and Qt Creator. They are licensed under GNU General Public License Version 3 (GPLv3). The interface is using Qt Core, Qt Gui, and Qt Widgets Framework APIs licensed udner the GNU Lesser General Public License Version 3 (LGPLv3). Ewok is licensed under the GNU Lesser General Public License Version 3 (LGPLv3). Pixhawk Firmware and Middleware is licensed under BSD-3-Clause License. For full license details, refer to the license file in the library's directory.

px4-trajectoryreplanning's People

Contributors

haritsahm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.