From 603bf7e122f537fe31a997cd36bfeeaf443e8aca Mon Sep 17 00:00:00 2001
From: Charles Javerliat <charles.javerliat@gmail.com>
Date: Sat, 13 Mar 2021 14:48:01 +0100
Subject: [PATCH] Add reprise

---
 src/main.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/main.cpp b/src/main.cpp
index 00d1ca3..63dd2c6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -107,6 +107,21 @@ void estimatedScoreCallback(const std_msgs::Int32 &estimatedScoreMsg)
 void loop()
 {
 
+  if (!nh.connected())
+  {
+    lcd.clear();
+    lcd.setCursor(0, 0);
+    lcd.print("Waiting ROS...");
+
+    while (!nh.connected())
+    {
+      nh.spinOnce();
+      delay(MSG_SENDING_INTERVAL);
+    }
+
+    refreshScreen();
+  }
+
   // DEBUT PARTIE TIRETTE
 
   int pullCordReading = digitalRead(pullCordPin);
-- 
GitLab