Skip to content

Commit 268c11a

Browse files
Merge pull request #26 from gergondet/topic/FixSignalValuesSetting
Set signal values after integrate but before "after" periodic call
2 parents d1f8694 + c073dfd commit 268c11a

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/tools/device.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,19 @@ increment( const double & dt )
304304
integrate( dt );
305305
sotDEBUG(25) << "q" << time << " = " << state_ << endl;
306306

307+
/* Position the signals corresponding to sensors. */
308+
stateSOUT .setConstant( state_ ); stateSOUT.setTime( time+1 );
309+
if( secondOrderIntegration_ )
310+
{
311+
velocitySOUT.setConstant( velocity_ );
312+
velocitySOUT.setTime( time+1 );
313+
}
314+
for( int i=0;i<4;++i ){
315+
if( !withForceSignals[i] ) forcesSOUT[i]->setConstant(forceZero6);
316+
}
317+
ml::Vector zmp(3); zmp.fill( .0 );
318+
ZMPPreviousControllerSOUT .setConstant( zmp );
319+
307320
// Run Synchronous commands and evaluate signals outside the main
308321
// connected component of the graph.
309322
try
@@ -329,18 +342,6 @@ increment( const double & dt )
329342
<< " running periodical commands (after)" << std::endl;
330343
}
331344

332-
/* Position the signals corresponding to sensors. */
333-
stateSOUT .setConstant( state_ ); stateSOUT.setTime( time+1 );
334-
if( secondOrderIntegration_ )
335-
{
336-
velocitySOUT.setConstant( velocity_ );
337-
velocitySOUT.setTime( time+1 );
338-
}
339-
for( int i=0;i<4;++i ){
340-
if( !withForceSignals[i] ) forcesSOUT[i]->setConstant(forceZero6);
341-
}
342-
ml::Vector zmp(3); zmp.fill( .0 );
343-
ZMPPreviousControllerSOUT .setConstant( zmp );
344345

345346
// Others signals.
346347
motorcontrolSOUT .setConstant( state_ );

0 commit comments

Comments
 (0)