Giter Club home page Giter Club logo

quadrotor-simulation's Introduction

Quadrotor simulation

This project contains:

  • Informed RRT* to plan a collision free path from start to goal position in an N-dimensional Map.
  • A minimum snap trajectory generator. The segment times between consecutive waypoints are also optimised.
  • Nonlinear geometric controller for aggressive trajectory tracking and hover controller
  • Quadrotor Simulator

Dependencies

  • scipy, numpy, matplotlib, rtree-linux

Usage

Trajectory generation and control example

from TrajGen import trajGenerator, Helix_waypoints
from Quadrotor import QuadSim
import controller

waypoints = Helix_waypoints(5)

#Generate trajectory through waypoints
traj = trajGenerator(waypoints,max_vel = 10,gamma = 1e6)

#initialise simulation with given controller and trajectory
Tmax = traj.TS[-1]
des_state = traj.get_des_state
sim = QuadSim(controller,des_state,Tmax)

#run simulation
sim.run()

image

With Path Planning

python3 runsim.py

image

find out more in PathPlanning/README.md

Future Work

  • Adding disturbance to quadrotor model
  • Collision checking after trajectory generation

References

quadrotor-simulation's People

Contributors

bharath2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

quadrotor-simulation's Issues

Constraint with respect to acceleration

In the minimum snap trajectory generation code, we put a constraint on the maximum velocity of the quadrotor. Is it possible to put a constraint on the maximum acceleration as well?

Blank screen after running runsim.py

The figure window appears but it's completely blank after running the runsim.py. I have tested on both Macbook Pro with M1 Pro and Windows PC. Is this a matplotlib version issue?

Which Method using: Constrainde QP or Unconstrained QP ?

Hello, thanks for your good work and i very appreciated.

I'm wondering, is your solution method on Constrained QP? That's what it looked like to me when I looked at your Cost Function. If so, will it be difficult to solve this problem with the Unconstrained QP Method?

Thank you for your answer.

Note: When I read the "Polynomial Trajectory Planning for Aggressive Quadrotor Flight in Dense Indoor Environments" paper i get stuck here for your code.

capi_return is NULL , numpy.linalg.LinAlgError: Singular matrix

Hello, its a nice project you are doing, thank you for sharing it with community.
When i'm using the Trajectory generation and control example on the README file everything is fine, but when i want to use RRT waypoints as input i get this error:

capi_return is NULL
Call-back cb_calcfc_in__cobyla__user__routines failed.
Traceback (most recent call last):
File "/home/ROS/Quadrotor-Simulation/runsim.py", line 56, in
traj = trajGenerator(waypoints,max_vel = 10,gamma = 1000000)
File "/home/ROS/Quadrotor-Simulation/TrajGen/trajGen.py", line 16, in init
self.optimize()
File "/home/ROS/Quadrotor-Simulation/TrajGen/trajGen.py", line 28, in optimize
T = optimize.minimize(self.get_cost,Tmin, method="COBYLA",constraints= ({'type': 'ineq', 'fun': lambda T: T-Tmin}))['x']
File "/home/ROS/.local/lib/python3.6/site-packages/scipy/optimize/_minimize.py", line 623, in minimize
return _minimize_cobyla(fun, x0, args, constraints, **options)
File "/home/ROS/.local/lib/python3.6/site-packages/scipy/optimize/cobyla.py", line 34, in wrapper
return func(*args, **kwargs)
File "/home/ROS/.local/lib/python3.6/site-packages/scipy/optimize/cobyla.py", line 262, in _minimize_cobyla
dinfo=info)
File "/home/ROS/.local/lib/python3.6/site-packages/scipy/optimize/cobyla.py", line 252, in calcfc
f = fun(x, *args)
File "/home/ROS/Quadrotor-Simulation/TrajGen/trajGen.py", line 21, in get_cost
coeffs,cost = self.MinimizeSnap(T)
File "/home/ROS/Quadrotor-Simulation/TrajGen/trajGen.py", line 40, in MinimizeSnap
invA = LA.inv(A)
File "<array_function internals>", line 6, in inv
File "/home/ROS/.local/lib/python3.6/site-packages/numpy/linalg/linalg.py", line 546, in inv
ainv = _umath_linalg.inv(a, signature=signature, extobj=extobj)
File "/home/ROS/.local/lib/python3.6/site-packages/numpy/linalg/linalg.py", line 88, in _raise_linalgerror_singular
raise LinAlgError("Singular matrix")
numpy.linalg.LinAlgError: Singular matrix

I'm using numpy-1.19.5 and scipy-1.5.4
Thanks in advanced.

How I can Change The Order Of Trajectory ???

Hello thx for your work.

When I try to change the order of trajectory I get stuck. In the get_constraints() function the indexing of Mapping Matrix A only for order = 10.
(eg. A[6n + 4i : 6n + 4(i+1), oi : o(i+1)], when o =7 , shape of A = (21,21) , indexing start at 21 then becomes (0,7) shape of array)
How we can automate this indexing ?

I couldn't understand it even though I tried really hard. I'm waiting for your help. Thank you

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.