File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
libraries/YarpPlugins/BasicCartesianControl Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1111using namespace roboticslab ;
1212
1313constexpr int MAX_ENCODER_ERRORS = 20 ;
14- constexpr double ERROR_THROTTLE = 0.5 ; // [s]
14+ constexpr double ENCODER_THROTTLE = 1.0 ; // [s]
1515
1616// ------------------- PeriodicThread Related ------------------------------------
1717
@@ -30,9 +30,9 @@ void BasicCartesianControl::run()
3030 std::vector<double > qdot (numJoints);
3131 std::vector<double > qdotdot (numJoints);
3232
33- if (!iEncoders->getEncoders (q.data ()) || !iEncoders-> getEncoderSpeeds (qdot. data ()) || !iEncoders-> getEncoderAccelerations (qdotdot. data ()) )
33+ if (!iEncoders->getEncoders (q.data ()))
3434 {
35- yCErrorThrottle (BCC, ERROR_THROTTLE ) << " Unable to query encoders" ;
35+ yCErrorThrottle (BCC, ENCODER_THROTTLE ) << " Unable to query encoders" ;
3636 encoderErrors++;
3737
3838 if (encoderErrors > MAX_ENCODER_ERRORS)
@@ -46,6 +46,10 @@ void BasicCartesianControl::run()
4646
4747 return ;
4848 }
49+ else if (!iEncoders->getEncoderSpeeds (qdot.data ()) || !iEncoders->getEncoderAccelerations (qdotdot.data ()))
50+ {
51+ yCWarningThrottle (BCC, ENCODER_THROTTLE) << " Unable to query encoder speeds or accelerations" ;
52+ }
4953
5054 encoderErrors = 0 ; // reset error counter
5155
You can’t perform that action at this time.
0 commit comments