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

Segmentation Fault #25

Closed
aorthey opened this issue Aug 3, 2016 · 0 comments · Fixed by #33
Closed

Segmentation Fault #25

aorthey opened this issue Aug 3, 2016 · 0 comments · Fixed by #33

Comments

@aorthey
Copy link
Contributor

aorthey commented Aug 3, 2016

I ran into a problem where a small timestep size causes a segfault.
The code below is an example which is the same code as in Issue #23, but if with a timestep size of 1e-4 instead of 1e-3, leading to a segfault.
If i choose a stepsize of 1e-5 i get a memory error, does it mean that there is an upper limit on the number of waypoints or a lower limit on the timestep size?

Here is the code to reproduce the error (note that it works with discrtimestep = 1e-3)

from TOPP import Utilities
import TOPP
import numpy as np
from TOPP import TOPPpy
from pylab import *
ion()

Ndim = 4
discrtimestep= 1e-4
a = np.loadtxt('topp/a')
b = np.loadtxt('topp/b')
c = np.loadtxt('topp/c')
with open("topp/traj0", "r") as fh:
        trajectorystring = "%s" % fh.read()

vmax = 1e5*np.ones(Ndim) ## no velocity constraints
topp_inst = TOPP.QuadraticConstraints(trajectorystring, discrtimestep, vmax, list(a), list(b), list(c))
x = topp_inst.solver
ret = x.RunVIP(0,0)
x.WriteProfilesList()
x.WriteSwitchPointsList()
profileslist = TOPPpy.ProfilesFromString(x.resprofilesliststring)
switchpointslist = TOPPpy.SwitchPointsFromString(x.switchpointsliststring)
TOPPpy.PlotProfiles(profileslist,switchpointslist,4)
raw_input("Press enter")

and the data:

wget https://raw.githubusercontent.com/orthez/openrave-forcefields/master/topp/a
wget https://raw.githubusercontent.com/orthez/openrave-forcefields/master/topp/b
wget https://raw.githubusercontent.com/orthez/openrave-forcefields/master/topp/c
wget https://raw.githubusercontent.com/orthez/openrave-forcefields/master/topp/traj0
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

Successfully merging a pull request may close this issue.

1 participant