@@ -141,12 +141,15 @@ Device( const std::string& n )
141
141
forcesSOUT[3 ] =
142
142
new Signal<ml::Vector, int >(" OpenHRP::output(vector6)::forceLARM" );
143
143
144
- signalRegistration ( controlSIN<<stateSOUT<<attitudeSOUT<<attitudeSIN<<zmpSIN
145
- <<*forcesSOUT[ 0 ]<<*forcesSOUT[ 1 ] <<*forcesSOUT[2 ]<<*forcesSOUT[3 ]
146
- <<previousControlSOUT <<pseudoTorqueSOUT
147
- << motorcontrolSOUT << ZMPPreviousControllerSOUT );
144
+ signalRegistration ( controlSIN<<stateSOUT<<velocitySOUT<<attitudeSOUT
145
+ <<attitudeSIN<<zmpSIN <<*forcesSOUT[0 ]<<*forcesSOUT[1 ]
146
+ <<*forcesSOUT[ 2 ]<<*forcesSOUT[ 3 ] <<previousControlSOUT
147
+ <<pseudoTorqueSOUT << motorcontrolSOUT << ZMPPreviousControllerSOUT );
148
148
state_.fill (.0 ); stateSOUT.setConstant ( state_ );
149
149
150
+ velocity_.resize (state_.size ()); velocity_.setZero ();
151
+ velocitySOUT.setConstant ( velocity_ );
152
+
150
153
/* --- Commands --- */
151
154
{
152
155
std::string docstring;
@@ -258,7 +261,6 @@ void Device::
258
261
setSecondOrderIntegration ()
259
262
{
260
263
secondOrderIntegration_ = true ;
261
- signalRegistration ( velocitySOUT );
262
264
velocity_.resize (state_.size ());
263
265
velocity_.setZero ();
264
266
velocitySOUT.setConstant ( velocity_ );
@@ -306,11 +308,17 @@ increment( const double & dt )
306
308
307
309
/* Position the signals corresponding to sensors. */
308
310
stateSOUT .setConstant ( state_ ); stateSOUT.setTime ( time +1 );
311
+ // computation of the velocity signal
309
312
if ( secondOrderIntegration_ )
310
313
{
311
314
velocitySOUT.setConstant ( velocity_ );
312
315
velocitySOUT.setTime ( time +1 );
313
316
}
317
+ else
318
+ {
319
+ velocitySOUT.setConstant ( controlSIN.accessCopy () );
320
+ velocitySOUT.setTime ( time +1 );
321
+ }
314
322
for ( int i=0 ;i<4 ;++i ){
315
323
if ( !withForceSignals[i] ) forcesSOUT[i]->setConstant (forceZero6);
316
324
}
0 commit comments