diff --git a/binding/python/mc_control/mc_control.pyx b/binding/python/mc_control/mc_control.pyx index b46aee8344..e9c431f3ef 100644 --- a/binding/python/mc_control/mc_control.pyx +++ b/binding/python/mc_control/mc_control.pyx @@ -128,8 +128,6 @@ cdef class MCController(object): return self.base.run() def reset(self, ControllerResetData data): self.base.reset(deref(data.impl)) - def robot(self): - return mc_rbdyn.RobotFromC(self.base.robot()) def env(self): return mc_rbdyn.RobotFromC(self.base.env()) def robots(self): @@ -214,7 +212,7 @@ cdef class MCController(object): if isinstance(name, unicode): name = name.encode(u'ascii') if name is None: - return MCController.robot(self) + return mc_rbdyn.RobotFromC(self.base.robot()) else: return mc_rbdyn.RobotFromC(self.base.robot(name)) def addContact(self, c, *args): diff --git a/binding/python/mc_rbdyn/mc_rbdyn.pxd b/binding/python/mc_rbdyn/mc_rbdyn.pxd index d39e0e6253..717ef0a393 100644 --- a/binding/python/mc_rbdyn/mc_rbdyn.pxd +++ b/binding/python/mc_rbdyn/mc_rbdyn.pxd @@ -19,7 +19,7 @@ cdef class Collision(object): cdef Collision CollisionFromC(const c_mc_rbdyn.Collision&) cdef class BodySensor(object): - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef const c_mc_rbdyn.BodySensor * impl cdef BodySensor BodySensorFromCRef(const c_mc_rbdyn.BodySensor&) @@ -30,7 +30,7 @@ cdef class Flexibility(object): cdef Flexibility FlexibilityFromC(const c_mc_rbdyn.Flexibility&) cdef class ForceSensor(object): - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef const c_mc_rbdyn.ForceSensor * impl cdef ForceSensor ForceSensorFromCRef(const c_mc_rbdyn.ForceSensor&) @@ -90,13 +90,13 @@ cdef CylindricalSurface CylindricalSurfaceFromPtr(c_mc_rbdyn.CylindricalSurface* cdef class Contact(object): cdef c_mc_rbdyn.Contact * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef Contact ContactFromC(const c_mc_rbdyn.Contact &, cppbool copy=?) cdef class ContactVector(object): cdef vector[c_mc_rbdyn.Contact] * v - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef ContactVector ContactVectorFromC(const vector[c_mc_rbdyn.Contact] &, cppbool copy=?) @@ -107,4 +107,4 @@ cdef GeosGeomGeometry GeosGeomGeometryFromSharedPtr(shared_ptr[c_mc_rbdyn.Geomet cdef class PolygonInterpolator(object): cdef c_mc_rbdyn.PolygonInterpolator * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ diff --git a/binding/python/mc_rbdyn/mc_rbdyn.pyx b/binding/python/mc_rbdyn/mc_rbdyn.pyx index 52bc4be609..07df7aacd8 100644 --- a/binding/python/mc_rbdyn/mc_rbdyn.pyx +++ b/binding/python/mc_rbdyn/mc_rbdyn.pyx @@ -149,10 +149,10 @@ cdef Flexibility FlexibilityFromC(const c_mc_rbdyn.Flexibility & flex): cdef class BodySensor(object): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __cinit__(self, skip_alloc = False): - self.__own_impl = not skip_alloc + self.own_impl__ = not skip_alloc if skip_alloc: self.impl = NULL return @@ -184,7 +184,7 @@ cdef BodySensor BodySensorFromCRef(const c_mc_rbdyn.BodySensor & bs): cdef class ForceSensor(object): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __ctor__(self, sn, bn, sva.PTransformd X_p_f): if isinstance(sn, unicode): @@ -193,7 +193,7 @@ cdef class ForceSensor(object): bn = bn.encode(u'ascii') self.impl = new c_mc_rbdyn.ForceSensor(sn, bn, deref(X_p_f.impl)) def __cinit__(self, *args, skip_alloc = False): - self.__own_impl = not skip_alloc + self.own_impl__ = not skip_alloc if skip_alloc: assert(len(args) ==0) self.impl = NULL @@ -1045,7 +1045,7 @@ cdef class Contact(object): defaultFriction = c_mc_rbdyn.ContactdefaultFriction nrBilatPoints = c_mc_rbdyn.ContactnrBilatPoints def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __copyctor__(self, Contact other): self.impl = new c_mc_rbdyn.Contact(deref(other.impl)) @@ -1077,7 +1077,7 @@ cdef class Contact(object): skip_alloc = bool(kwds["skip_alloc"]) else: skip_alloc = False - self.__own_impl = True + self.own_impl__ = True if len(args) == 0 and skip_alloc: self.impl = NULL elif len(args) == 1 and isinstance(args[0], Contact): @@ -1189,18 +1189,18 @@ cdef Contact ContactFromC(const c_mc_rbdyn.Contact& c, cppbool copy=True): if copy: ret.impl = new c_mc_rbdyn.Contact(c) else: - ret.__own_impl = False + ret.own_impl__ = False ret.impl = &(c_mc_rbdyn.const_cast_contact(c)) return ret cdef class ContactVector(object): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.v def __push_contact(self, Contact c): self.v.push_back(deref(c.impl)) def __cinit__(self, *args, skip_alloc = False): - self.__own_impl = True + self.own_impl__ = True if not skip_alloc: self.v = new vector[c_mc_rbdyn.Contact]() if len(args) == 1: @@ -1261,7 +1261,7 @@ cdef ContactVector ContactVectorFromC(const vector[c_mc_rbdyn.Contact]& v, if copy: ret.v = new vector[c_mc_rbdyn.Contact](v) else: - ret.__own_impl = False + ret.own_impl__ = False ret.v = &(c_mc_rbdyn.const_cast_contact_vector(v)) return ret @@ -1276,15 +1276,15 @@ cdef GeosGeomGeometry GeosGeomGeometryFromSharedPtr(shared_ptr[c_mc_rbdyn.Geomet cdef class PolygonInterpolator(object): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __cinit__(self, *args, skip_alloc = False): if skip_alloc: assert(len(args) == 0) self.impl = NULL - self.__own_impl = False + self.own_impl__ = False else: - self.__own_impl = True + self.own_impl__ = True assert(len(args) == 1) data_path = args[0] if isinstance(data_path, unicode): diff --git a/binding/python/mc_rtc/mc_rtc.pxd b/binding/python/mc_rtc/mc_rtc.pxd index 11e7138d12..f62b3843e7 100644 --- a/binding/python/mc_rtc/mc_rtc.pxd +++ b/binding/python/mc_rtc/mc_rtc.pxd @@ -13,7 +13,7 @@ cdef Logger LoggerFromRef(c_mc_rtc.Logger &) cdef class Configuration(object): cdef c_mc_rtc.Configuration * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef Configuration ConfigurationFromValue(c_mc_rtc.Configuration) cdef Configuration ConfigurationFromRef(c_mc_rtc.Configuration &) diff --git a/binding/python/mc_rtc/mc_rtc.pyx b/binding/python/mc_rtc/mc_rtc.pyx index 8b40c19c93..ac85740041 100644 --- a/binding/python/mc_rtc/mc_rtc.pyx +++ b/binding/python/mc_rtc/mc_rtc.pyx @@ -101,11 +101,11 @@ cdef Logger LoggerFromRef(c_mc_rtc.Logger & logger): cdef class Configuration(object): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __cinit__(self, *args, skip_alloc = False): if not skip_alloc: - self.__own_impl = True + self.own_impl__ = True if(len(args) == 0): self.impl = new c_mc_rtc.Configuration() else: @@ -115,7 +115,7 @@ cdef class Configuration(object): path = path.encode(u'ascii') self.impl = new c_mc_rtc.Configuration((path)) else: - self.__own_impl = False + self.own_impl__ = False self.impl = NULL @staticmethod def fromData(data): @@ -306,7 +306,7 @@ cdef class Configuration(object): cdef Configuration ConfigurationFromValue(c_mc_rtc.Configuration conf): cdef Configuration ret = Configuration(skip_alloc = True) - ret.__own_impl = True + ret.own_impl__ = True ret.impl = new c_mc_rtc.Configuration(conf) return ret diff --git a/binding/python/mc_solver/mc_solver.pxd b/binding/python/mc_solver/mc_solver.pxd index d7ebc463d3..22809202f3 100644 --- a/binding/python/mc_solver/mc_solver.pxd +++ b/binding/python/mc_solver/mc_solver.pxd @@ -11,13 +11,13 @@ cdef class ConstraintSet(object): cdef class ContactConstraint(ConstraintSet): cdef c_mc_solver.ContactConstraint * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef ContactConstraint ContactConstraintFromPtr(c_mc_solver.ContactConstraint *) cdef class KinematicsConstraint(ConstraintSet): cdef c_mc_solver.KinematicsConstraint * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef KinematicsConstraint KinematicsConstraintFromPtr(c_mc_solver.KinematicsConstraint *) @@ -28,13 +28,13 @@ cdef DynamicsConstraint DynamicsConstraintFromPtr(c_mc_solver.DynamicsConstraint cdef class CollisionsConstraint(ConstraintSet): cdef c_mc_solver.CollisionsConstraint * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef CollisionsConstraint CollisionsConstraintFromPtr(c_mc_solver.CollisionsConstraint*) cdef class QPSolver(object): cdef c_mc_solver.QPSolver * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef QPSolver QPSolverFromPtr(c_mc_solver.QPSolver*) diff --git a/binding/python/mc_solver/mc_solver.pyx b/binding/python/mc_solver/mc_solver.pyx index 765b70ab01..cec3402ab8 100644 --- a/binding/python/mc_solver/mc_solver.pyx +++ b/binding/python/mc_solver/mc_solver.pyx @@ -33,10 +33,10 @@ cdef class ContactConstraint(ConstraintSet): Velocity = c_mc_solver.ContactTypeVelocity Position = c_mc_solver.ContactTypePosition def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __cinit__(self, timeStep, int cType = ContactConstraint.Velocity, dynamics = True, skip_alloc = False): - self.__own_impl = True + self.own_impl__ = True if not skip_alloc: assert(cType >= ContactConstraint.Acceleration and cType <= ContactConstraint.Position) self.impl = self.cs_base = new c_mc_solver.ContactConstraint(timeStep, cType) @@ -54,17 +54,17 @@ cdef class ContactConstraint(ConstraintSet): cdef ContactConstraint ContactConstraintFromPtr(c_mc_solver.ContactConstraint * p): cdef ContactConstraint ret = ContactConstraint(0.0, skip_alloc = True) - ret.__own_impl = False + ret.own_impl__ = False ret.impl = ret.cs_base = p return ret cdef class KinematicsConstraint(ConstraintSet): def __dealloc__(self): - if type(self) is KinematicsConstraint and self.__own_impl: + if type(self) is KinematicsConstraint and self.own_impl__: del self.impl def __cinit__(self, mc_rbdyn.Robots robots, robotIndex, timeStep, damper = None, velocityPercent = 1.0, infTorque = False, skip_alloc = False): cdef c_mc_solver.array3d damp = c_mc_solver.array3d() - self.__own_impl = True + self.own_impl__ = True if type(self) is KinematicsConstraint and not skip_alloc: if damper is None: self.impl = self.cs_base = new c_mc_solver.KinematicsConstraint(deref(robots.impl), robotIndex, timeStep) @@ -76,17 +76,17 @@ cdef class KinematicsConstraint(ConstraintSet): cdef KinematicsConstraint KinematicsConstraintFromPtr(c_mc_solver.KinematicsConstraint*p): cdef KinematicsConstraint ret = KinematicsConstraint(None, 0, 0.0, skip_alloc = True) - ret.__own_impl = False + ret.own_impl__ = False ret.impl = ret.cs_base = p return ret cdef class DynamicsConstraint(KinematicsConstraint): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __cinit__(self, mc_rbdyn.Robots robots, robotIndex, timeStep, isStatic = False, damper = None, velocityPercent = 1.0, infTorque = False, skip_alloc = False): cdef c_mc_solver.array3d damp = c_mc_solver.array3d() - self.__own_impl = True + self.own_impl__ = True if not skip_alloc: if damper is None: self.d_impl = self.impl = self.cs_base = new c_mc_solver.DynamicsConstraint(deref(robots.impl), robotIndex, timeStep, infTorque) @@ -98,17 +98,17 @@ cdef class DynamicsConstraint(KinematicsConstraint): cdef DynamicsConstraint DynamicsConstraintFromPtr(c_mc_solver.DynamicsConstraint * p): cdef DynamicsConstraint ret = DynamicsConstraint(None, 0, 0.0, skip_alloc = True) - ret.__own_impl = False + ret.own_impl__ = False ret.d_impl = ret.impl = ret.cs_base = p return ret cdef class CollisionsConstraint(ConstraintSet): defaultDampingOffset = c_mc_solver.CollisionsConstraintDefaultDampingOffset def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __cinit__(self, mc_rbdyn.Robots robots, r1Index, r2Index, timeStep, skip_alloc = False): - self.__own_impl = True + self.own_impl__ = True if not skip_alloc: self.impl = self.cs_base = new c_mc_solver.CollisionsConstraint(deref(robots.impl), r1Index, r2Index, timeStep) def removeCollision(self, QPSolver solver, b1Name, b2Name): @@ -148,7 +148,7 @@ cdef class CollisionsConstraint(ConstraintSet): cdef CollisionsConstraint CollisionsConstraintFromPtr(c_mc_solver.CollisionsConstraint * p): cdef CollisionsConstraint ret = CollisionsConstraint(None, None, None, None, skip_alloc = True) - ret.__own_impl = False + ret.own_impl__ = False ret.impl = ret.cs_base = p return ret @@ -159,10 +159,10 @@ cdef qp.BilateralContact BilateralContactFromC(const c_qp.BilateralContact & bc) cdef class QPSolver(object): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __cinit__(self, mc_rbdyn.Robots robots, timeStep, skip_alloc = False): - self.__own_impl = True + self.own_impl__ = True if not skip_alloc: self.impl = new c_mc_solver.TasksQPSolver(robots.impl, timeStep) def addConstraintSet(self, ConstraintSet cs): @@ -191,7 +191,7 @@ cdef class QPSolver(object): cdef QPSolver QPSolverFromPtr(c_mc_solver.QPSolver * p): cdef QPSolver ret = QPSolver(None, 0, skip_alloc = True) - ret.__own_impl = False + ret.own_impl__ = False ret.impl = p return ret diff --git a/binding/python/mc_tasks/force/force.pxd b/binding/python/mc_tasks/force/force.pxd index 1782021022..d8a992520f 100644 --- a/binding/python/mc_tasks/force/force.pxd +++ b/binding/python/mc_tasks/force/force.pxd @@ -12,7 +12,7 @@ cdef class AdmittanceTask(SurfaceTransformTask): cdef class ComplianceTask(MetaTask): cdef c_force.ComplianceTask * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef class DampingTask(AdmittanceTask): cdef c_force.DampingTask * damping_impl diff --git a/binding/python/mc_tasks/force/force.pyx b/binding/python/mc_tasks/force/force.pyx index 525477947b..84c46144fa 100644 --- a/binding/python/mc_tasks/force/force.pyx +++ b/binding/python/mc_tasks/force/force.pyx @@ -24,20 +24,20 @@ from libcpp cimport bool as cppbool cdef class AdmittanceTask(SurfaceTransformTask): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.adm_impl self.adm_impl = self.impl = self.ttg_base = self.mt_base = NULL def __ctor__(self, surfaceName, mc_rbdyn.Robots robots, robotIndex, stiffness = 5.0, weight = 1000.0): if isinstance(surfaceName, unicode): surfaceName = surfaceName.encode(u'ascii') - self.__own_impl = True + self.own_impl__ = True self.adm_impl = self.impl = self.ttg_base = self.mt_base = new c_force.AdmittanceTask(surfaceName, deref(robots.impl), robotIndex, stiffness, weight) def __cinit__(self, *args, skip_alloc = False, **kwargs): if skip_alloc: if len(args) + len(kwargs) > 0: raise TypeError("Cannot pass skip_alloc = True and other arguments to AdmittanceTask ctor") - self.__own_impl = False + self.own_impl__ = False self.adm_impl = self.impl = self.ttg_base = self.mt_base = NULL elif len(args) >= 3: self.__ctor__(*args, **kwargs) @@ -64,7 +64,7 @@ cdef class ComplianceTask(MetaTask): defaultFGain = c_force.defaultFGain defaultTGain = c_force.defaultTGain def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __ctor__(self, mc_rbdyn.Robots robots, robotIndex, body, timestep, stiffness = 5.0, weight = 1000.0, @@ -72,13 +72,13 @@ cdef class ComplianceTask(MetaTask): forceGain = defaultFGain, torqueGain = defaultTGain): if isinstance(body, unicode): body = body.encode(u'ascii') - self.__own_impl = True + self.own_impl__ = True self.impl = self.mt_base = new c_force.ComplianceTask(deref(robots.impl), robotIndex, body, timestep, stiffness, weight, forceThresh, torqueThresh, forceGain, torqueGain) def __cinit__(self, *args, skip_alloc = False, **kwargs): if skip_alloc: if len(args) + len(kwargs) > 0: raise TypeError("Cannot pass skip_alloc = True and other arguments to ComplianceTask ctor") - self.__own_impl = False + self.own_impl__ = False self.impl = self.mt_base = NULL elif len(args) >= 4: self.__ctor__(*args, **kwargs) @@ -93,20 +93,20 @@ cdef class ComplianceTask(MetaTask): cdef class DampingTask(AdmittanceTask): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.adm_impl self.damping_impl = self.adm_impl = self.impl = self.ttg_base = self.mt_base = NULL def __ctor__(self, surfaceName, mc_rbdyn.Robots robots, robotIndex, stiffness = 5.0, weight = 1000.0): if isinstance(surfaceName, unicode): surfaceName = surfaceName.encode(u'ascii') - self.__own_impl = True + self.own_impl__ = True self.damping_impl = self.adm_impl = self.impl = self.ttg_base = self.mt_base = new c_force.DampingTask(surfaceName, deref(robots.impl), robotIndex, stiffness, weight) def __cinit__(self, *args, skip_alloc = False, **kwargs): if skip_alloc: if len(args) + len(kwargs) > 0: raise TypeError("Cannot pass skip_alloc = True and other arguments to DampingTask ctor") - self.__own_impl = False + self.own_impl__ = False self.damping_impl = self.adm_impl = self.impl = self.ttg_base = self.mt_base = NULL elif len(args) >= 3: self.__ctor__(*args, **kwargs) @@ -115,20 +115,20 @@ cdef class DampingTask(AdmittanceTask): cdef class CoPTask(DampingTask): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.adm_impl self.cop_impl = self.damping_impl = self.adm_impl = self.impl = self.ttg_base = self.mt_base = NULL def __ctor__(self, surfaceName, mc_rbdyn.Robots robots, robotIndex, stiffness = 5.0, weight = 1000.0): if isinstance(surfaceName, unicode): surfaceName = surfaceName.encode(u'ascii') - self.__own_impl = True + self.own_impl__ = True self.cop_impl = self.damping_impl = self.adm_impl = self.impl = self.ttg_base = self.mt_base = new c_force.CoPTask(surfaceName, deref(robots.impl), robotIndex, stiffness, weight) def __cinit__(self, *args, skip_alloc = False, **kwargs): if skip_alloc: if len(args) + len(kwargs) > 0: raise TypeError("Cannot pass skip_alloc = True and other arguments to CoPTask ctor") - self.__own_impl = False + self.own_impl__ = False self.cop_impl = self.damping_impl = self.adm_impl = self.impl = self.ttg_base = self.mt_base = NULL elif len(args) >= 3: self.__ctor__(*args, **kwargs) diff --git a/binding/python/mc_tasks/mc_tasks.pxd b/binding/python/mc_tasks/mc_tasks.pxd index c14335a26c..4683beab2c 100644 --- a/binding/python/mc_tasks/mc_tasks.pxd +++ b/binding/python/mc_tasks/mc_tasks.pxd @@ -20,7 +20,7 @@ cdef class MetaTask(object): cdef class PostureTask(MetaTask): cdef c_mc_tasks.PostureTask * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef PostureTask PostureTaskFromPtr(c_mc_tasks.PostureTask *) @@ -44,45 +44,45 @@ cdef class _SplineTrajectoryTask(MetaTask): cdef class BSplineTrajectoryTask(_SplineTrajectoryTask): cdef c_mc_tasks.BSplineTrajectoryTask * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef class ExactCubicTrajectoryTask(_SplineTrajectoryTask): cdef c_mc_tasks.ExactCubicTrajectoryTask * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef class _TransformTask(MetaTask): cdef c_mc_tasks.TrajectoryTaskGeneric * ttg_base cdef class CoMTask(_CoMTrajectoryTask): cdef c_mc_tasks.CoMTask * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef class PositionTask(_PositionTrajectoryTask): cdef c_mc_tasks.PositionTask * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef PositionTask PositionTaskFromSharedPtr(shared_ptr[c_mc_tasks.PositionTask]) cdef class OrientationTask(_OrientationTrajectoryTask): cdef c_mc_tasks.OrientationTask * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef OrientationTask OrientationTaskFromSharedPtr(shared_ptr[c_mc_tasks.OrientationTask]) cdef class VectorOrientationTask(_VectorOrientationTrajectoryTask): cdef c_mc_tasks.VectorOrientationTask * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef class EndEffectorTask(MetaTask): cdef c_mc_tasks.EndEffectorTask * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ cdef class RelativeEndEffectorTask(EndEffectorTask): pass cdef class SurfaceTransformTask(_SurfaceTransformTask): cdef c_mc_tasks.SurfaceTransformTask * impl - cdef cppbool __own_impl + cdef cppbool own_impl__ ctypedef fused AnyTTG: CoMTask diff --git a/binding/python/mc_tasks/mc_tasks.pyx b/binding/python/mc_tasks/mc_tasks.pyx index f2e92bffb8..c6173fda69 100644 --- a/binding/python/mc_tasks/mc_tasks.pyx +++ b/binding/python/mc_tasks/mc_tasks.pyx @@ -80,7 +80,7 @@ def genericInit(AnyTask self, size, name, *args, skip_alloc=False, **kwargs): if skip_alloc: if len(args) + len(kwargs) > 0: raise TypeError("Cannot pass skip_alloc=True and other arguments to {0} ctor".format(name)) - self.__own_impl = False + self.own_impl__ = False if AnyTask in AnyTTG: genericTTGNull(self) else: @@ -93,11 +93,11 @@ def genericInit(AnyTask self, size, name, *args, skip_alloc=False, **kwargs): cdef class CoMTask(_CoMTrajectoryTask): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __ctor__(self, mc_rbdyn.Robots robots, robotIndex, stiffness = 2.0, weight = 500.0): - self.__own_impl = True + self.own_impl__ = True self.impl = self.ttg_base = self.mt_base = new c_mc_tasks.CoMTask(deref(robots.impl), robotIndex, stiffness, weight) def __cinit__(self, *args, **kwargs): @@ -115,13 +115,13 @@ cdef class CoMTask(_CoMTrajectoryTask): cdef class PositionTask(_PositionTrajectoryTask): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __ctor__(self, bodyName, mc_rbdyn.Robots robots, robotIndex, stiffness = 2.0, weight = 500.0): if isinstance(bodyName, unicode): bodyName = bodyName.encode(u'ascii') - self.__own_impl = True + self.own_impl__ = True self.impl = self.ttg_base = self.mt_base = new c_mc_tasks.PositionTask(bodyName, deref(robots.impl), robotIndex, stiffness, weight) def __cinit__(self, *args, **kwargs): @@ -141,13 +141,13 @@ cdef PositionTask PositionTaskFromSharedPtr(shared_ptr[c_mc_tasks.PositionTask] cdef class OrientationTask(_OrientationTrajectoryTask): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __ctor__(self, bodyName, mc_rbdyn.Robots robots, robotIndex, stiffness = 2.0, weight = 500.0): if isinstance(bodyName, unicode): bodyName = bodyName.encode(u'ascii') - self.__own_impl = True + self.own_impl__ = True self.impl = self.ttg_base = self.mt_base = new c_mc_tasks.OrientationTask(bodyName, deref(robots.impl), robotIndex, stiffness, weight) def __cinit__(self, *args, **kwargs): genericInit[OrientationTask](self, 3, 'OrientationTask', *args, **kwargs) @@ -165,27 +165,27 @@ cdef OrientationTask OrientationTaskFromSharedPtr(shared_ptr[c_mc_tasks.Orientat cdef class VectorOrientationTask(_VectorOrientationTrajectoryTask): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __ctor__(self, bodyName, eigen.Vector3d bodyVector, eigen.Vector3d targetVector, mc_rbdyn.Robots robots, robotIndex, stiffness = 2.0, weight = 500.0): if isinstance(bodyName, unicode): bodyName = bodyName.encode(u'ascii') - self.__own_impl = True + self.own_impl__ = True self.impl = self.ttg_base = self.mt_base = new c_mc_tasks.VectorOrientationTask(bodyName, bodyVector.impl, targetVector.impl, deref(robots.impl), robotIndex, stiffness, weight) def __cinit__(self, *args, **kwargs): genericInit[VectorOrientationTask](self, 5, 'VectorOrientationTask', *args, **kwargs) cdef class SurfaceTransformTask(_SurfaceTransformTask): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __ctor__(self, surfaceName, mc_rbdyn.Robots robots, robotIndex, stiffness = 2.0, weight = 500.0): if isinstance(surfaceName, unicode): surfaceName = surfaceName.encode(u'ascii') - self.__own_impl = True + self.own_impl__ = True self.impl = self.ttg_base = self.mt_base = new c_mc_tasks.SurfaceTransformTask(surfaceName, deref(robots.impl), robotIndex, stiffness, weight) def __cinit__(self, *args, **kwargs): genericInit[SurfaceTransformTask](self, 3, 'SurfaceTransformTask', *args, **kwargs) @@ -229,13 +229,13 @@ cdef class VectorPairDoubleVector3d(object): cdef class BSplineTrajectoryTask(_SplineTrajectoryTask): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __ctor__(self, mc_rbdyn.Robots robots, robotIndex, surfaceName, duration, stiffness, weight, sva.PTransformd target, posWp, oriWp): if isinstance(surfaceName, unicode): surfaceName = surfaceName.encode(u'ascii') - self.__own_impl = True + self.own_impl__ = True self.impl = self.ttg_base = self.mt_base = new c_mc_tasks.BSplineTrajectoryTask(deref(robots.impl), robotIndex, surfaceName, duration, stiffness, weight, deref(target.impl)) self.posWaypoints(posWp) self.oriWaypoints(oriWp) @@ -267,13 +267,13 @@ cdef class BSplineTrajectoryTask(_SplineTrajectoryTask): cdef class ExactCubicTrajectoryTask(_SplineTrajectoryTask): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __ctor__(self, mc_rbdyn.Robots robots, robotIndex, surfaceName, duration, stiffness, weight, sva.PTransformd target): if isinstance(surfaceName, unicode): surfaceName = surfaceName.encode(u'ascii') - self.__own_impl = True + self.own_impl__ = True self.impl = self.ttg_base = self.mt_base = new c_mc_tasks.ExactCubicTrajectoryTask(deref(robots.impl), robotIndex, surfaceName, duration, stiffness, weight, deref(target.impl)) def __cinit__(self, *args, **kwargs): genericInit[ExactCubicTrajectoryTask](self, 7, 'ExactCubicTrajectoryTask', *args, **kwargs) @@ -306,13 +306,13 @@ cdef class ExactCubicTrajectoryTask(_SplineTrajectoryTask): cdef class EndEffectorTask(MetaTask): def __dealloc__(self): - if self.__own_impl and type(self) is EndEffectorTask: + if self.own_impl__ and type(self) is EndEffectorTask: del self.impl def __ctor__(self, bodyName, mc_rbdyn.Robots robots, robotIndex, stiffness = 2.0, weight = 1000.0): if isinstance(bodyName, unicode): bodyName = bodyName.encode(u'ascii') - self.__own_impl = True + self.own_impl__ = True self.impl = self.mt_base = new c_mc_tasks.EndEffectorTask(bodyName, deref(robots.impl), robotIndex, stiffness, weight) def __cinit__(self, *args, **kwargs): genericInit[EndEffectorTask](self, 3, 'EndEffectorTask', *args, **kwargs) @@ -336,7 +336,7 @@ cdef class EndEffectorTask(MetaTask): cdef class RelativeEndEffectorTask(EndEffectorTask): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __ctor__(self, bodyName, mc_rbdyn.Robots robots, robotIndex, relBodyName = "", stiffness = 2.0, weight = 1000.0): @@ -344,17 +344,17 @@ cdef class RelativeEndEffectorTask(EndEffectorTask): bodyName = bodyName.encode(u'ascii') if isinstance(relBodyName, unicode): relBodyName = relBodyName.encode(u'ascii') - self.__own_impl = True + self.own_impl__ = True self.impl = self.mt_base = new c_mc_tasks.RelativeEndEffectorTask(bodyName, deref(robots.impl), robotIndex, relBodyName, stiffness, weight) def __cinit__(self, *args, **kwargs): genericInit[RelativeEndEffectorTask](self, 3, 'RelativeEndEffectorTask', *args, **kwargs) cdef class PostureTask(MetaTask): def __dealloc__(self): - if self.__own_impl: + if self.own_impl__: del self.impl def __ctor__(self, mc_solver.QPSolver solver, rIndex, stiffness, weight): - self.__own_impl = True + self.own_impl__ = True self.impl = self.mt_base = new c_mc_tasks.PostureTask(deref(solver.impl), rIndex, stiffness, weight) def __cinit__(self, *args, **kwargs): genericInit[PostureTask](self, 4, 'PostureTask', *args, **kwargs) @@ -388,6 +388,6 @@ cdef class PostureTask(MetaTask): cdef PostureTask PostureTaskFromPtr(c_mc_tasks.PostureTask * p): cdef PostureTask ret = PostureTask(skip_alloc = True) - ret.__own_impl = False + ret.own_impl__ = False ret.impl = ret.mt_base = p return ret