GithubHelp home page GithubHelp logo

khaledwahba1994 / uav_trajectories Goto Github PK

View Code? Open in Web Editor NEW

This project forked from whoenig/uav_trajectories

0.0 0.0 0.0 1.56 MB

Helper scripts and programs for trajectories

License: MIT License

C++ 22.02% Python 71.51% CMake 5.17% Dockerfile 1.30%

uav_trajectories's Introduction

uav_trajectories

Helper scripts and programs for trajectories to be used on UAVs

Requirements

Parts of this software are based on [mav_trajectory_generation]: https://github.com/ethz-asl/mav_trajectory_generation, a software package developed at ETH Zurich, implementing a trajectory optimization approach developed at MIT. When using this work academically, follow their instructions on how to cite their work. We use the provided library in that package, but do not require ROS for execution.

Building

Tested on Ubuntu 20.04. Install additional dependencies using:

sudo apt install libeigen3-dev libboost-program-options-dev libboost-filesystem-dev libnlopt-cxx-dev libgoogle-glog-dev

And on Fedora 33 with installed dependencies:

sudo dnf install NLopt-devel glog-devel eigen3-devel boost-devel

Clone and build this repository:

git clone --recursive https://github.com/whoenig/uav_trajectories.git
mkdir uav_trajectories/build
cd uav_trajectories/build
cmake ..
make

Docker image

Instead of building the code locally, the Dockerfile can be used to containerize the application. This is useful if you don't want to install dependencies in your local environment or if you are using OSX.

To build the image use

docker build . -t genTrajectory

Use it by mapping your local file system into the container. In this example the current dir is mapped to /module. The genTrajectory application is running by default in the container and all you need to add is the arguments

docker run --rm -it -v $PWD:/module genTrajectory --input /module/examples/waypoints1.csv --v_max 1.0 --a_max 1.0 -o /module/traj1.csv

Polynomial Trajectories

Generate Trajectory Given Waypoints

This program takes a sequence of waypoints and dynamic quadrotor limits as inputs, and produces a smooth trajectory (with 0 derivatives at the beginning and end) that can be executed safely. All waypoints will be visited in order and the time of arrival at a waypoint is computed automatically.

Example:

./genTrajectory -i examples/waypoints1.csv --v_max 1.0 --a_max 1.0 -o traj1.csv

Generate Trajectory Given Time-Position Pairs

This python script fits an 8th order polynomial through the given time/position pair. This can be useful to define a choreography of multiple UAVs. All derivatives are 0 at the beginning and the end.

Example:

python3 ../examples/circle_with_time.py
python3 ../scripts/generate_trajectory.py timed_waypoints_circle0.csv circle0.csv --pieces 5

Here, the first script generates timed waypoints and writes them into csv files. The second script fits 5 pieces of an 8th-order spline through the generated waypoints.

This scripts also supports yaw. Example for an in-place yaw rotation:

python3 ../examples/yaw_with_time.py
python3 ../scripts/generate_trajectory.py timed_waypoints_yaw.csv yaw0.csv --pieces 5
python3 ../scripts/plot_trajectory.py yaw0.csv

Visualize Trajectory

A python script can be used to visualize a trajectory csv-file (3D plot, velocity, acceleration, angular velocity, yaw).

Example:

python3 ../scripts/plot_trajectory.py traj1.csv

Convert Trajectory to Bezier

This python scripts takes the trajectory generated by genTrajectory, and converts it to a bezier defined between times [0,1]. You should evaluate this bezier for a given time with f(t/duration).

Example:

python3 ../scripts/convert_to_bezier.py traj1.csv bezier1.csv

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.