0

I' m looking for a trajectory generator (the algorithm doesn't matter, since I m going to write it using C++ ) that generates a trajectory (a parametric curve in space) defined point by point which is going lately to be feed into my quadrotor drivers.

I'm honest: I don't know where to start.

  1. Reading the following interesting answer. But the problem here is: the trajectory has a PD controller with it. My quadrotor should take just a parametric curve as input.
  2. OMPL: this library seems very powerful and interesting. It let the user to define a planner which many different algorithms. The problem is that it is not well documented, good examples and explanations are missing and till now I could'nt find anything related to quadrotors, which does use that library. There is an example for a quadrotor, which doesn't find my expectations and I cannot figure out, how to implement it in my package. I don't want just copy and paste code that I don't understand.
  3. B-Spline and Bezier Curve...and the whole family of parametric curves. I found very interesting libraries in internet that implement those algorithm directly C++. The problem here is: I can define some points in space, generate a spline that contains them and interpolate points for the PID controller in the quadrotor. The basic idea is like a dog chasing a rabbit. A point is generated from the start point of the spline and regularly sent to the quadrotor. The latter flies behind the point, trying to reach it until a goal point has been reached. What is the problem here?!? In this case I can only generate a curve based on geometric properties and not considering the dynamic and the kinematic of the quadrotor (which I would consider for a future project). The rabbit runs and has a tighter curve radius than the dog, which could result in a strange behavior of the quadrotor.

I'd like same good tips to point to the right direction.

Which kind of trajectory planner are usually developed fr such an application?

Thanks! Regards

Wilhelm
  • 700
  • 6
  • 16
  • Shouldn't a good controller free you from dynamics concerns when specifying a trajectory? – Daniel Eberts Dec 25 '14 at 13:36
  • Could you be more specific Daniel? – Wilhelm Dec 25 '14 at 15:28
  • A controller needs anyway a sort of a path or trajectory to follow – Wilhelm Dec 25 '14 at 15:29
  • What I mean: If you already have an acceleration-based controller, you can pretty much go ahead with defining a trajectory with B-splines or whatever you like. Note, however, the difference between a trajectory and a path: the former defines positions and velocities, the latter just positions, without any velocity information. – Daniel Eberts Dec 25 '14 at 16:05
  • I still don't understand what do you mean specifically. I wrote a controller using a backstepping integrator technique link pp.39. I acts on position, velocity. Acceleration is feedforwarded (in my code I put it simply to zero). – Wilhelm Dec 25 '14 at 17:25
  • About the trajectory: I want to be able to generate (given some 3D control points) a spline which connect them. For every interpolation point (between the 3D control points) I need to define position, velocity, aceleration. I put wrongly path in my previous comment – Wilhelm Dec 25 '14 at 17:27
  • Ah, I see. I'm not very well versed in trajectory planning, but perhaps libraries like www.roboticslibrary.org/ or MRPT ( http://www.mrpt.org/ ) provide something helpful. – Daniel Eberts Dec 25 '14 at 17:42
  • @Dave, may I ask you how did you implement the position control in the paper you mentioned? In my code, arcsin() yields undefined number due to the fact that Ux*sin(psi) + Uy*cos(psi) is out of arcsin domain. – CroCo May 22 '15 at 19:44
  • @CroCo Yes: the problem is that in your case - somehow - the variables Ux and Uy are > than 1. Be sure that you use the right equations (3.39 and 3.40) (the multiplication with the term (m/U1) is for this reason very important). If everything is nice then you should check your parameter coefficients ($\alpha_{7}, \alpha_{8}$ and so on....AND the computatioon of U1 must be bone BEFORE any other calculations: Otherwise m/U1 gives...infinity as a result. Keep us informed – Wilhelm May 23 '15 at 07:54
  • @Dave, I have two questions, how did you tune parameter coefficients? Second, which ODE solver did you use? I'm using Euler method because it is a fixed size step. – CroCo May 23 '15 at 18:41
  • Ok: 1- with try&error. I started with some coefficients found in a paper and than I tried with small adjustments; 2- Since I ve programmed in C++, I was not constrained to use an integrator provided by matlab or simulink. In C++ you have to write yours. I personally used the Runge-Kutta 4th Order to integrate from acceleration to position. I suggest to read this link which explains the difference very well – Wilhelm May 23 '15 at 18:49
  • @Dave, thank you again for being patient and informative. Actually I'm using Runge-Kutta in boost library. In your code, is there any constrain on the generated angles? In my code, `DesiredPsi = atan2( Yd - x[2], Xd - x[0] );

    DesiredPhi = asin( Uxsin( DesiredPsi ) - Uycos( DesiredPsi ) );

    DesiredTheta = asin( (Uxcos(DesiredPsi) + Uysin(DesiredPsi)) / cos(DesiredPhi) );` with no constrains.

    – CroCo May 23 '15 at 20:24
  • Also, are there any constrains on the range of asin in your code? Or you simply chose the parameters in such a way that the value that is passed to asin in the proper range of asin. – CroCo May 23 '15 at 20:29
  • For attitude control, backstepping is working with me. – CroCo May 23 '15 at 21:49
  • Yes, I did a saturation function. The resulting angle may not be > than 89 deg. BUT the problem in your code is the way you are calculating Ux and Uy. – Wilhelm May 24 '15 at 05:00
  • Here a piece of my code with the backstepping integrator: link The terms $Kx_, Ky_$ are for aerodynamics effects so you can put them = 0 – Wilhelm May 24 '15 at 05:09
  • @Dave, thank you so much. It is now working. great. It seems the problem with parameters' values. This causes $U_{x}, U_{y}$ to be high. Can you share a saturation function how did you implemented? Thank you again for being informative and helpful. I really appreciate your kindness – CroCo May 24 '15 at 15:53

0 Answers0