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
This commit is contained in:
Alexey Rogachevskiy
2019-12-16 20:37:11 +03:00
committed by Oleg Kalachev
parent 361b365f86
commit fb0e841bd4
2 changed files with 9 additions and 3 deletions

View File

@@ -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();
}