From ad9259810f0aaa28da375150a1f17f19ff4ab5aa Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Mon, 23 Dec 2024 04:04:00 +0300 Subject: [PATCH] Fix SBUS simulation logic Don't consider zero values from not connected joystick --- gazebo/SBUS.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gazebo/SBUS.h b/gazebo/SBUS.h index cc32a2c..c687239 100644 --- a/gazebo/SBUS.h +++ b/gazebo/SBUS.h @@ -14,7 +14,7 @@ public: SBUS(HardwareSerial& bus, const bool inv = true) {}; SBUS(HardwareSerial& bus, const int8_t rxpin, const int8_t txpin, const bool inv = true) {}; void begin() {}; - bool read() { return true; }; + bool read() { return joystickInitialized; }; SBUSData data() { SBUSData data; joystickGet(data.ch);