From fb0e841bd40956b90586a4bcabb2c88ae5d754fe Mon Sep 17 00:00:00 2001 From: Alexey Rogachevskiy Date: Mon, 16 Dec 2019 20:37:11 +0300 Subject: [PATCH] clever/rc: Allow disabling GCS thread (#197) * clever/rc: Allow disabling GCS thread Currently spawning GCS thread results in ROS TCP errors. This patch allows a user to turn off this thread if it's not required. The thread is turned off by default, since it's not required for our PX4 firmware. * clever/rc: Code style --- clever/launch/clever.launch | 5 ++++- clever/src/rc.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/clever/launch/clever.launch b/clever/launch/clever.launch index ab942cd2..f91a622b 100644 --- a/clever/launch/clever.launch +++ b/clever/launch/clever.launch @@ -71,5 +71,8 @@ - + + + + diff --git a/clever/src/rc.cpp b/clever/src/rc.cpp index 00c35e07..e94e7e20 100644 --- a/clever/src/rc.cpp +++ b/clever/src/rc.cpp @@ -34,12 +34,15 @@ public: nh(), nh_priv("~") { + bool use_fake_gcs = nh_priv.param("use_fake_gcs", true); // Create socket thread std::thread t(&RC::socketThread, this); t.detach(); - std::thread gcst(&RC::fakeGCSThread, this); - gcst.detach(); + if (use_fake_gcs) { + std::thread gcst(&RC::fakeGCSThread, this); + gcst.detach(); + } initLatchedState(); }