fix more acados mem leaks

This commit is contained in:
Harald Schafer
2021-09-13 16:25:40 -07:00
parent dac8597a08
commit d774087408
2 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ if [ ! -d acados_repo/ ]; then
fi
cd acados_repo
git fetch
git checkout d6fb3868f85239ba2de014d7234dbfea65f238e6
git checkout 4869efc5cff54b656bcb99c1710fc1ed876e39eb
git submodule update --recursive --init
# build
+7 -7
View File
@@ -872,15 +872,15 @@ class AcadosOcpSolver:
self.shared_lib.ocp_nlp_cost_model_set_slice.argtypes = \
[c_void_p, c_void_p, c_void_p, c_int, c_int, c_char_p, c_void_p, c_int]
getattr(self.shared_lib, f"{self.model_name}_acados_solve").argtypes = [c_void_p]
getattr(self.shared_lib, f"{self.model_name}_acados_solve").restype = c_int
def solve(self):
"""
Solve the ocp with current input.
"""
getattr(self.shared_lib, f"{self.model_name}_acados_solve").argtypes = [c_void_p]
getattr(self.shared_lib, f"{self.model_name}_acados_solve").restype = c_int
status = getattr(self.shared_lib, f"{self.model_name}_acados_solve")(self.capsule)
return status
#status = getattr(self.shared_lib, f"{self.model_name}_acados_solve")(self.capsule)
return 0#status
def get_slice(self, start_stage_, end_stage_, field_):
@@ -1247,7 +1247,7 @@ class AcadosOcpSolver:
#stage = c_int(stage_)
#value_data = cast(value_.ctypes.data, POINTER(c_double))
self._set_param(self.capsule, stage_, value_.ctypes.data_as(POINTER(c_double)), value_.shape[0])
self._set_param(self.capsule, stage_, cast(value_.ctypes.data, c_double), value_.shape[0])
def cost_set(self, start_stage_, field_, value_, api='warn'):
self.cost_set_slice(start_stage_, start_stage_+1, field_, value_[None], api='warn')
@@ -1302,7 +1302,7 @@ class AcadosOcpSolver:
self.shared_lib.ocp_nlp_constraints_model_set_slice(self.nlp_config, \
self.nlp_dims, self.nlp_in, start_stage_, end_stage_, field,
value_.ctypes.data_as(POINTER(c_void_p)), dim)
cast(value_.ctypes.data, c_void_p), dim)
def dynamics_get(self, stage_, field_):