Browse Source

Add temporary waist pitch debug logging

Log cmd_q, hw_q, kp for motor[14] every 2s to diagnose
why the waist motor isn't tracking the position command.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
main
Joe DiPrima 4 weeks ago
parent
commit
7ae273f35b
  1. 13
      gear_sonic_deploy/src/g1/g1_deploy_onnx_ref/src/g1_deploy_onnx_ref.cpp

13
gear_sonic_deploy/src/g1/g1_deploy_onnx_ref/src/g1_deploy_onnx_ref.cpp

@ -2845,6 +2845,19 @@ class G1Deploy {
motor_command_tmp.kp.at(14) = 100.0f;
motor_command_tmp.kd.at(14) = 5.0f;
// Temporary: log waist_pitch motor command every ~2s (100 ticks at 50Hz)
static int waist_log_cnt = 0;
if (++waist_log_cnt >= 100) {
waist_log_cnt = 0;
auto ls = low_state_buffer_.GetData();
float hw_q = ls ? ls->motor_state()[14].q() : -999.0f;
std::cout << "[WAIST_DBG] cmd_q=" << motor_command_tmp.q_target.at(14)
<< " hw_q=" << hw_q
<< " kp=" << motor_command_tmp.kp.at(14)
<< " offset=" << g_waist_pitch_offset_deg.load() << "deg"
<< std::endl;
}
motor_command_buffer_.SetData(motor_command_tmp);
return true;
}

Loading…
Cancel
Save