Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated trajectories have discontinuities #7

Closed
michael-p opened this issue Jan 20, 2020 · 4 comments
Closed

Generated trajectories have discontinuities #7

michael-p opened this issue Jan 20, 2020 · 4 comments

Comments

@michael-p
Copy link

Dear Wolfgang,

Thank you for making this nice tool available - it really makes it a lot easier to generate trajectories compared to using ETH's mav_trajectory_generation directly!

One problem, however, that I quite frequently encounter is that the generated trajectories are really "messed up": sometimes there are discontinuities so that the trajectory looks nothing like one would expect given the waypoints, other times the velocity jumps or goes to very high values. To me it looks like numerical instabilities but since my examples are so simple (see below) and obviously people are successfully using this tool for much more complicated trajectories it might also be that I'm somehow misusing the tool?

Examples for the weird behavior: (all examples use the command ./genTrajectory -i waypoints.csv -o trajectory.csv --v_max 2 --a_max 2.0)

A simple square in the x-y-plane:

0.0, 0.0, 0.0
10.0, 0.0, 0.0
10.0, 10.0, 0.0
0.0, 10.0, 0.0
0.0, 0.0, 0.0

results in:
rect

A straight line with an additional waypoint in the middle:

0.0, 0.0, 0.0
10.0, 0.0, 0.0
20.0, 0.0, 0.0

Here the positions look fine but there are pretty crazy jumps in the velocity:
line

I also tested with several much more complex real-world trajectories with dozens of waypoints and the behavior was very much the same, sadly.

Do you have any idea what could be the problem here?

Thank you very much for your help!
Michael

@whoenig
Copy link
Owner

whoenig commented Jan 21, 2020

I tried your first example and actually get a smooth result:

Figure_1

I am on Ubuntu 18.04 and have mav_trajectory_generation checked out at the revision that this repo points to (i.e., 8fae688). Could you verify that you are also on that revision?

@michael-p
Copy link
Author

Ok that's interesting! I have the same version of mav_trajectory_generation but I'm using macOS. I just installed everything on Ubuntu 18 and indeed, everything works as expected there!
Do you have any idea what could be the problem here, or is macOS just not supported at all? Other differences despite the operating system are that I use Clang on macOS and GCC on Ubuntu, and also that nlopt is at version 2.4 on Ubuntu whereas on macOS I have the newer 2.6.2 release installed.

@whoenig
Copy link
Owner

whoenig commented Jan 21, 2020

The compiler shouldn't matter. I think it might be a problem with nlopt (sometimes nlopt returns solutions that violate the constraints). There is some discussion on that here: ethz-asl/mav_trajectory_generation#84. You could try a different version of nlopt.

@michael-p
Copy link
Author

I just tried with version 2.5 of NLOpt but sadly that makes no difference. Going back to an even older version is difficult because versions before 2.5 don't use CMake and it actually just fails to compile on my Mac.

I guess this issue will be very difficult to debug, so I'm going to just use it on Ubuntu where everything works as expected. Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants