Aggiunte funzioni di lettura di Startup/Heartbeat

funzioni aggiunte nelle callback mqtt che segnalano il cambiamento con
l'emit di commonStatusChange
This commit is contained in:
2019-11-04 15:40:22 +01:00
parent 9483e265f3
commit 29db06e3c4
5 changed files with 44 additions and 1 deletions

View File

@@ -13,6 +13,10 @@ RoboGlue_SHARED::RoboGlue_SHARED(QSettings *set){
comSettings.pubMap["coordinates"] = "roboglue_com/com2ros/coordinates";
comSettings.pubMap["state"] = "roboglue_com/com2ros/state";
comSettings.pubMap["interface"] = "roboglue_com/com2ros/interface";
comSettings.nodeNames["relay"] = "roboglue_ros_relay";
comSettings.nodeNames["follower"] = "roboglue_ros_follower";
comSettings.nodeNames["recorder"] = "roboglue_ros_recorder";
}
////////////////////////////////////////////////////////////////
/////////////////////// RESTORE FUNCTIONS /////////////////////

View File

@@ -31,6 +31,7 @@
#include <stdexcept>
#include <libJson/json.hpp>
#include <libURcom/URCLinterface.h>
#include <boost/algorithm/string.hpp>
using namespace nlohmann;
@@ -47,6 +48,14 @@ public:
bool isPlaying = false;
bool isRealtime = false;
bool isFileOpen = false;
// ROS node status
bool relayRunning = false;
bool followerRunning = false;
bool recorderRunning = false;
// ROS node last seen
double relayLast = 0.0;
double followerLast = 0.0;
double recorderLast = 0.0;
} commonStatus;
/////////// PERMANENT SETTINGS VARIABLES /////////
@@ -79,10 +88,14 @@ public:
} kine;
std::map<std::string, std::string> subMap;
std::map<std::string, std::string> pubMap;
std::map<std::string, std::string> nodeNames;
//FIXME: riempire la mappa dinamicamente da un file, eliminare l'assegnazione manuale
enum {
COMM, COORD, STAT
} tList;
enum {
TYPE, NODE, TS
};
} comSettings;
struct {