From 344d45a9c63c867ac092870062f16e43b48f767c Mon Sep 17 00:00:00 2001 From: Mansard <nmansard@laas.fr> Date: Mon, 7 Nov 2011 16:53:11 +0100 Subject: [PATCH] Accounting for the modifs in sot-core/feature. --- python/meta_task_dyn_6d.py | 2 +- python/meta_tasks_dyn.py | 6 ++---- src/feature-projected-line.cpp | 21 --------------------- src/feature-projected-line.h | 4 ++-- 4 files changed, 5 insertions(+), 28 deletions(-) diff --git a/python/meta_task_dyn_6d.py b/python/meta_task_dyn_6d.py index 070c73b..c429485 100644 --- a/python/meta_task_dyn_6d.py +++ b/python/meta_task_dyn_6d.py @@ -11,7 +11,7 @@ class MetaTaskDyn6d(MetaTask6d): self.gain = GainAdaptive('gain'+self.name) self.gain.set(1050,45,125e3) def plugEverything(self): - self.feature.sdes.value = self.featureDes.name + self.feature.setReference(self.featureDes.name) plug(self.dyn.signal(self.opPoint),self.feature.signal('position')) plug(self.dyn.signal('J'+self.opPoint),self.feature.signal('Jq')) self.task.add(self.feature.name) diff --git a/python/meta_tasks_dyn.py b/python/meta_tasks_dyn.py index de192ba..0893fbd 100644 --- a/python/meta_tasks_dyn.py +++ b/python/meta_tasks_dyn.py @@ -73,8 +73,7 @@ class MetaTaskDynPosture(object): plug(dyn.position,self.feature.errorIN) robotDim = len(dyn.position.value) self.feature.jacobianIN.value = matrixToTuple( identity(robotDim) ) -# self.feature.setReference(self.featureDes.name) - self.feature.sdes.value = self.featureDes.name + self.feature.setReference(self.featureDes.name) self.task.add(self.feature.name) plug(dyn.velocity,self.task.qdot) @@ -120,8 +119,7 @@ class MetaTaskDynCom(object): plug(dyn.com,self.feature.errorIN) plug(dyn.Jcom,self.feature.jacobianIN) -# self.feature.setReference(self.featureDes.name) - self.feature.sdes.value = self.featureDes.name + self.feature.setReference(self.featureDes.name) self.task.add(self.feature.name) plug(dyn.velocity,self.task.qdot) diff --git a/src/feature-projected-line.cpp b/src/feature-projected-line.cpp index 09f8aa5..5bc9289 100644 --- a/src/feature-projected-line.cpp +++ b/src/feature-projected-line.cpp @@ -53,7 +53,6 @@ namespace dynamicgraph /* --- CLASS ----------------------------------------------------------- */ /* --------------------------------------------------------------------- */ - FeatureProjectedLine:: FeatureProjectedLine( const std::string& pointName ) : FeatureAbstract( pointName ) @@ -74,12 +73,9 @@ namespace dynamicgraph errorSOUT.addDependency( xbSIN ); errorSOUT.addDependency( xcSIN ); - activationSOUT.removeDependency( desiredValueSIN ); - signalRegistration( xaSIN << xbSIN << xcSIN << JaSIN << JbSIN ); } - /* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */ @@ -117,17 +113,6 @@ namespace dynamicgraph & dya=JA(1,i),& dyb=JB(1,i); J(0,i) = dxa*(yb-yc) - dxb*(ya-yc) - dya*(xb-xc) + dyb*(xa-xc); } - // J.resize(3,nq); - // for( int i=0;i<nq;++i ) - // { - // const double - // & dxa=JA(0,i),& dxb=JB(0,i), - // & dya=JA(1,i),& dyb=JB(1,i), - // & dza=JA(2,i),& dzb=JB(2,i); - // J(0,i) = dxa; - // J(1,i) = dya; - // J(2,i) = dza; - // } sotDEBUGOUT(15); return J; @@ -150,12 +135,6 @@ namespace dynamicgraph error.resize(1); error(0) = (xb-xa)*(yc-ya)-(yb-ya)*(xc-xa); - // error.resize(3); - // error(0) = xa-xc; - // error(1) = ya-yc; - // error(2) = A(2,3) - C(2); - //std::cout << time << " " << ya << " " << yc << std::endl; - sotDEBUGOUT(15); return error ; } diff --git a/src/feature-projected-line.h b/src/feature-projected-line.h index 2ddd9a8..f83dfa5 100644 --- a/src/feature-projected-line.h +++ b/src/feature-projected-line.h @@ -72,15 +72,15 @@ namespace dynamicgraph { DECLARE_SIGNAL_IN(Jb,ml::Matrix); DECLARE_SIGNAL_IN(xc,ml::Vector); + DECLARE_NO_REFERENCE; + public: FeatureProjectedLine( const std::string& name ); virtual ~FeatureProjectedLine( void ) {} virtual unsigned int& getDimension( unsigned int & dim, int time ); - virtual ml::Vector& computeError( ml::Vector& res,int time ); virtual ml::Matrix& computeJacobian( ml::Matrix& res,int time ); - virtual ml::Vector& computeActivation( ml::Vector& res,int) {return res;} virtual void display( std::ostream& os ) const; -- GitLab