diff --git a/ec/hrpEC/hrpEC-common.cpp b/ec/hrpEC/hrpEC-common.cpp index a4a3850a9ba..ca2bcb1462b 100644 --- a/ec/hrpEC/hrpEC-common.cpp +++ b/ec/hrpEC/hrpEC-common.cpp @@ -147,7 +147,8 @@ namespace RTC #ifndef OPENRTM_VERSION_TRUNK if (loop % debug_count == 0 && ENABLE_DEBUG_PRINT) { gettimeofday(&debug_tv4, NULL); - fprintf(stderr, "[hrpEC] Processing time breakdown : waitForNextPeriod %f[ms], warker (onExecute) %f[ms], ExecutionProfile %f[ms], time from prev cicle %f[ms]\n", + fprintf(stderr, "[hrpEC] [%d.%6.6d] Processing time breakdown : waitForNextPeriod %f[ms], warker (onExecute) %f[ms], ExecutionProfile %f[ms], time from prev cicle %f[ms]\n", + tv.tv_sec, tv.tv_usec, DELTA_SEC(debug_tv1, debug_tv2)*1e3, DELTA_SEC(debug_tv2, debug_tv3)*1e3, DELTA_SEC(debug_tv3, debug_tv4)*1e3, diff --git a/rtc/Beeper/Beeper.cpp b/rtc/Beeper/Beeper.cpp index bcfabd2713a..25c81b676b1 100644 --- a/rtc/Beeper/Beeper.cpp +++ b/rtc/Beeper/Beeper.cpp @@ -176,10 +176,13 @@ RTC::ReturnCode_t Beeper::onExecute(RTC::UniqueId ec_id) bd._beep_length = m_beepCommand.data[BEEP_INFO_LENGTH]; // Push beepCommand to buffer size_t max_buffer_length = 10; - pthread_mutex_lock( &beep_mutex ); - beep_command_buffer.push_back(bd); - while (beep_command_buffer.size() > max_buffer_length) beep_command_buffer.pop_front(); - pthread_mutex_unlock( &beep_mutex ); + if (pthread_mutex_trylock( &beep_mutex ) == 0) { + beep_command_buffer.push_back(bd); + while (beep_command_buffer.size() > max_buffer_length) beep_command_buffer.pop_front(); + pthread_mutex_unlock( &beep_mutex ); + } else { + std::cerr << "[" << m_profile.instance_name<< "] Mutex trylock failed (loop=" << m_loop << ")" << std::endl; + } // print if (m_debugLevel > 0) { if (bd._beep_start) diff --git a/rtc/RobotHardware/robot.cpp b/rtc/RobotHardware/robot.cpp index c984d435dd4..c9651c96a1f 100644 --- a/rtc/RobotHardware/robot.cpp +++ b/rtc/RobotHardware/robot.cpp @@ -113,6 +113,10 @@ bool robot::loadGain() strm >> default_dgain[i]; } strm.close(); + // Print loaded gain + std::cerr << "[RobotHardware] loadGain" << std::endl; + for (unsigned int i=0; iname << ", pgain = " << default_pgain[i] << ", dgain = " << default_dgain[i] << std::endl; + } return true; }