Browse Source

Increase neutral hold gains to 5x for stiff calibration hold

Ankle KP was only ~28.5, too weak to hold against body weight.
5x multiplier gives ankles ~142, hips ~495 for proper static hold.

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

6
gear_sonic_deploy/src/g1/g1_deploy_onnx_ref/src/g1_deploy_onnx_ref.cpp

@ -2829,12 +2829,14 @@ class G1Deploy {
MotorCommand motor_command_tmp;
// Neutral hold mode: bypass NN, command default angles directly (key 'n')
// Uses 5x gains for stiff hold — useful for visual joint calibration.
if (g_neutral_hold_mode.load()) {
constexpr float neutral_gain_mult = 5.0f;
for (int i = 0; i < G1_NUM_MOTOR; i++) {
motor_command_tmp.q_target.at(i) = static_cast<float>(default_angles[i]);
motor_command_tmp.tau_ff.at(i) = 0.0;
motor_command_tmp.kp.at(i) = kps[i];
motor_command_tmp.kd.at(i) = kds[i];
motor_command_tmp.kp.at(i) = kps[i] * neutral_gain_mult;
motor_command_tmp.kd.at(i) = kds[i] * neutral_gain_mult;
motor_command_tmp.dq_target.at(i) = 0.0;
}
} else {

Loading…
Cancel
Save