Closed cohnt closed 1 year ago
Thanks for this, I'll try to see what I can find.
What OS were you running on when you experienced the fault? It looks like Python 3.10, so I'm guessing Ubuntu 22?
Yes, Python 3.10 with Ubuntu 22.04 (technically Tuxedo OS, but they're basically the same thing). Thanks for taking a look, and let me know if there's any other information you need!
@jwnimmer-tri have you made progress on this issue?
No, I haven't had time to circle back yet.
I was able to distill this into a simpler example, by modifying some of Russ' code in underactuated. You can find my modifications here -- all I've done is change
options = FiniteHorizonLinearQuadraticRegulatorOptions()
options.x0 = x_trajectory
options.u0 = u_trajectory
to
options = FiniteHorizonLinearQuadraticRegulatorOptions()
options.x0 = options.xd = x_trajectory
options.u0 = options.ud = u_trajectory
So the issue is definitely occurring when manually setting the desired and nominal trajectories, but I don't have an intuition as to why.
I will look into this later.
@cohnt does the segfault occur for pendulum or the cart-pole? I tried to set options.xd
and options.ud
for some simple example in C++ and the code runs fine. I think now I need to exactly re-write the pendulum/cart-pole example in C++ to reproduce this seg fault.
It occurs for the acrobot, in the "Trajectory stabilization with (finite-horizon) LQR" block.
What happened?
When constructing a finite horizon LQR controller, it's possible for the program to segfault. Unfortunately, the system is very complex, so it's hard to distill it into a concise MWE. I'm very sorry about this!
I've made the code publicly available in this repository, and the segmentation fault can be replicated by checking out the branch
track-down-segfault-here
, and runningpython3 naive_trajopt.py
from thesrc
directory. Note that this requires a Drake version that supports SNOPT, and also depends on theunderactuated
pip package.I think the relevant piece of code is the following, from my file
src/stabliziation.py
, beginning on line 128:Note that changing the last couple of lines to
fixes the segmentation fault. So presumably, that's connected to the error? But this shouldn't be a problem, as the default behavior of
FiniteHorizonLinearQuadraticRegulatorOptions
is to setxd
andud
tox0
andu0
, respectively, if they haven't been specified.When I run the file with gdb, I get the following output:
Backtracing gives the following output:
Version
No response
What operating system are you using?
No response
What installation option are you using?
No response
Relevant log output
No response