From 641e711e67ecec2ff4bddc5a613a6b5252992d41 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Sat, 15 Feb 2025 03:29:09 +0300 Subject: [PATCH] Minor fix in joystick support for simulation Don't use channels variable as it breaks code isolation --- gazebo/joystick.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gazebo/joystick.h b/gazebo/joystick.h index 9056191..22c3402 100644 --- a/gazebo/joystick.h +++ b/gazebo/joystick.h @@ -29,7 +29,7 @@ bool joystickInit() { bool joystickGet(int16_t ch[16]) { SDL_JoystickUpdate(); - for (uint8_t i = 0; i < sizeof(channels) / sizeof(channels[0]); i++) { + for (uint8_t i = 0; i < 16; i++) { ch[i] = SDL_JoystickGetAxis(joystick, i); } return true;