@ -67,6 +67,10 @@ inline std::atomic<double> g_knee_offset_deg{0.0};
/// Applied post-NN to motor commands only (NN is blind to this adjustment).
inline std : : atomic < double > g_hip_pitch_offset_deg { 3.0 } ;
/// Runtime-adjustable ankle pitch offset (degrees). Keys q/w to adjust via tmux.
/// Positive = more dorsiflexion correction (toes up). Applied to both ankles equally.
inline std : : atomic < double > g_ankle_pitch_offset_deg { 0.0 } ;
/// Neutral hold mode: bypass NN, command default_angles directly. Key 'n' to toggle.
/// Used for visual joint inspection (diagnosing hardware offsets).
inline std : : atomic < bool > g_neutral_hold_mode { false } ;
@ -202,6 +206,20 @@ class GamepadManager : public InputInterface {
is_manager_key = true ;
break ;
}
case ' q ' : {
double val = g_ankle_pitch_offset_deg . load ( ) - 1.0 ;
g_ankle_pitch_offset_deg . store ( val ) ;
std : : cout < < " [ANKLE] Pitch offset: " < < val < < " deg (+ = more dorsiflexion) " < < std : : endl ;
is_manager_key = true ;
break ;
}
case ' w ' : {
double val = g_ankle_pitch_offset_deg . load ( ) + 1.0 ;
g_ankle_pitch_offset_deg . store ( val ) ;
std : : cout < < " [ANKLE] Pitch offset: " < < val < < " deg (+ = more dorsiflexion) " < < std : : endl ;
is_manager_key = true ;
break ;
}
case ' n ' :
case ' N ' : {
bool cur = g_neutral_hold_mode . load ( ) ;