Skip to content
Snippets Groups Projects
Commit 344d45a9 authored by Nicolas Mansard's avatar Nicolas Mansard
Browse files

Accounting for the modifs in sot-core/feature.

parent 6acdc82c
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ class MetaTaskDyn6d(MetaTask6d): ...@@ -11,7 +11,7 @@ class MetaTaskDyn6d(MetaTask6d):
self.gain = GainAdaptive('gain'+self.name) self.gain = GainAdaptive('gain'+self.name)
self.gain.set(1050,45,125e3) self.gain.set(1050,45,125e3)
def plugEverything(self): 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(self.opPoint),self.feature.signal('position'))
plug(self.dyn.signal('J'+self.opPoint),self.feature.signal('Jq')) plug(self.dyn.signal('J'+self.opPoint),self.feature.signal('Jq'))
self.task.add(self.feature.name) self.task.add(self.feature.name)
......
...@@ -73,8 +73,7 @@ class MetaTaskDynPosture(object): ...@@ -73,8 +73,7 @@ class MetaTaskDynPosture(object):
plug(dyn.position,self.feature.errorIN) plug(dyn.position,self.feature.errorIN)
robotDim = len(dyn.position.value) robotDim = len(dyn.position.value)
self.feature.jacobianIN.value = matrixToTuple( identity(robotDim) ) self.feature.jacobianIN.value = matrixToTuple( identity(robotDim) )
# self.feature.setReference(self.featureDes.name) self.feature.setReference(self.featureDes.name)
self.feature.sdes.value = self.featureDes.name
self.task.add(self.feature.name) self.task.add(self.feature.name)
plug(dyn.velocity,self.task.qdot) plug(dyn.velocity,self.task.qdot)
...@@ -120,8 +119,7 @@ class MetaTaskDynCom(object): ...@@ -120,8 +119,7 @@ class MetaTaskDynCom(object):
plug(dyn.com,self.feature.errorIN) plug(dyn.com,self.feature.errorIN)
plug(dyn.Jcom,self.feature.jacobianIN) plug(dyn.Jcom,self.feature.jacobianIN)
# self.feature.setReference(self.featureDes.name) self.feature.setReference(self.featureDes.name)
self.feature.sdes.value = self.featureDes.name
self.task.add(self.feature.name) self.task.add(self.feature.name)
plug(dyn.velocity,self.task.qdot) plug(dyn.velocity,self.task.qdot)
......
...@@ -53,7 +53,6 @@ namespace dynamicgraph ...@@ -53,7 +53,6 @@ namespace dynamicgraph
/* --- CLASS ----------------------------------------------------------- */ /* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
FeatureProjectedLine:: FeatureProjectedLine::
FeatureProjectedLine( const std::string& pointName ) FeatureProjectedLine( const std::string& pointName )
: FeatureAbstract( pointName ) : FeatureAbstract( pointName )
...@@ -74,12 +73,9 @@ namespace dynamicgraph ...@@ -74,12 +73,9 @@ namespace dynamicgraph
errorSOUT.addDependency( xbSIN ); errorSOUT.addDependency( xbSIN );
errorSOUT.addDependency( xcSIN ); errorSOUT.addDependency( xcSIN );
activationSOUT.removeDependency( desiredValueSIN );
signalRegistration( xaSIN << xbSIN << xcSIN << JaSIN << JbSIN ); signalRegistration( xaSIN << xbSIN << xcSIN << JaSIN << JbSIN );
} }
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
...@@ -117,17 +113,6 @@ namespace dynamicgraph ...@@ -117,17 +113,6 @@ namespace dynamicgraph
& dya=JA(1,i),& dyb=JB(1,i); & dya=JA(1,i),& dyb=JB(1,i);
J(0,i) = dxa*(yb-yc) - dxb*(ya-yc) - dya*(xb-xc) + dyb*(xa-xc); 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); sotDEBUGOUT(15);
return J; return J;
...@@ -150,12 +135,6 @@ namespace dynamicgraph ...@@ -150,12 +135,6 @@ namespace dynamicgraph
error.resize(1); error.resize(1);
error(0) = (xb-xa)*(yc-ya)-(yb-ya)*(xc-xa); 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); sotDEBUGOUT(15);
return error ; return error ;
} }
......
...@@ -72,15 +72,15 @@ namespace dynamicgraph { ...@@ -72,15 +72,15 @@ namespace dynamicgraph {
DECLARE_SIGNAL_IN(Jb,ml::Matrix); DECLARE_SIGNAL_IN(Jb,ml::Matrix);
DECLARE_SIGNAL_IN(xc,ml::Vector); DECLARE_SIGNAL_IN(xc,ml::Vector);
DECLARE_NO_REFERENCE;
public: public:
FeatureProjectedLine( const std::string& name ); FeatureProjectedLine( const std::string& name );
virtual ~FeatureProjectedLine( void ) {} virtual ~FeatureProjectedLine( void ) {}
virtual unsigned int& getDimension( unsigned int & dim, int time ); virtual unsigned int& getDimension( unsigned int & dim, int time );
virtual ml::Vector& computeError( ml::Vector& res,int time ); virtual ml::Vector& computeError( ml::Vector& res,int time );
virtual ml::Matrix& computeJacobian( ml::Matrix& 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; virtual void display( std::ostream& os ) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment