@ -521,7 +521,7 @@ class GamepadManager : public InputInterface {
// Remap rx_ so dead zone edge = 0, full stick = 1
// Remap rx_ so dead zone edge = 0, full stick = 1
double rx_sign = ( rx_ > 0 ) ? 1.0 : - 1.0 ;
double rx_sign = ( rx_ > 0 ) ? 1.0 : - 1.0 ;
double rx_remapped = std : : max ( 0.0 , ( std : : abs ( rx_ ) - dead_zone_ ) / ( 1.0 - dead_zone_ ) ) * rx_sign ;
double rx_remapped = std : : max ( 0.0 , ( std : : abs ( rx_ ) - dead_zone_ ) / ( 1.0 - dead_zone_ ) ) * rx_sign ;
planner_facing_angle_ = planner_facing_angle_ - 0.004 * rx_remapped ; // ~ 45°/s max at full stick
planner_facing_angle_ = planner_facing_angle_ - 0.008 * rx_remapped ; // 45°/s max at full stick (100Hz input loop)
if constexpr ( DEBUG_LOGGING ) {
if constexpr ( DEBUG_LOGGING ) {
std : : cout < < " [GamepadManager DEBUG] Right stick - Facing angle: " < < planner_facing_angle_ < < " rad " < < std : : endl ;
std : : cout < < " [GamepadManager DEBUG] Right stick - Facing angle: " < < planner_facing_angle_ < < " rad " < < std : : endl ;
}
}
@ -712,7 +712,7 @@ class GamepadManager : public InputInterface {
double normalized = std : : min ( ( planner_stick_magnitude_ - dead_zone_ ) / ( 1.0 - dead_zone_ ) , 1.0 ) ;
double normalized = std : : min ( ( planner_stick_magnitude_ - dead_zone_ ) / ( 1.0 - dead_zone_ ) , 1.0 ) ;
double target_speed = normalized * 0.8 ; // 0.0 at dead zone edge, 0.8 at full stick
double target_speed = normalized * 0.8 ; // 0.0 at dead zone edge, 0.8 at full stick
// Rate-limit acceleration only (decel is instant)
// Rate-limit acceleration only (decel is instant)
constexpr double max_accel_per_frame = 0.001 ; // ~4s ramp 0→0.8 at 200Hz
constexpr double max_accel_per_frame = 0.002 ; // 4s ramp 0→0.8 (100Hz input loop)
if ( target_speed > smoothed_speed_ ) {
if ( target_speed > smoothed_speed_ ) {
smoothed_speed_ = std : : min ( target_speed , smoothed_speed_ + max_accel_per_frame ) ;
smoothed_speed_ = std : : min ( target_speed , smoothed_speed_ + max_accel_per_frame ) ;
} else {
} else {