Compare commits

...

19 Commits

Author SHA1 Message Date
13a4942562 Modifiche interfaccia 2019-11-19 17:54:09 +01:00
5942c9b21a Corretta logica colorazione etichette stato nodi ROS 2019-11-18 11:37:04 +01:00
57c2b4ed3a Collegato bottone per spegnimento graceful nod ROS 2019-11-18 11:29:48 +01:00
2f59630197 Modificato il modo di colorare le label per nodi ROS 2019-11-18 11:25:51 +01:00
069fa97b40 Aggiornamento callback MQTT per nodo broadcaster 2019-11-15 16:44:21 +01:00
66bf6d5710 aggiunto broadcaster a interfaccia e configurazione 2019-11-15 14:50:07 +01:00
5c7caa3259 Aggiunto nodo broadcaster a interfaccia e shared memory 2019-11-15 14:49:45 +01:00
623ae0bedb Aggiunto checkbox per il plot del percorso caricato 2019-11-14 15:45:18 +01:00
04ae933f6e Modifiche interfaccia per frame riferimento 2019-11-13 15:55:55 +01:00
4970162ed5 correzioni interfaccia 2019-11-12 11:37:31 +01:00
e1e80d16c7 Inizia implementazione setPlanning Frame 2019-11-12 10:49:52 +01:00
cb2b5fdcbd Correzioni alla gui, riportato livello di log di com a warn 2019-11-12 09:57:55 +01:00
bf368d6ac6 Corretta gestione Heartbeat 2019-11-05 16:47:55 +01:00
64a4b9b122 Corretto calcolo del tempo heartbeat 2019-11-05 16:15:53 +01:00
187c3ed9fc Aggiunta parametrizzazione topic mqtt e nomi dei nodi ros 2019-11-05 15:49:12 +01:00
6b1012348c Aggiunte label status ROS ad interfaccia 2019-11-05 13:53:57 +01:00
29db06e3c4 Aggiunte funzioni di lettura di Startup/Heartbeat
funzioni aggiunte nelle callback mqtt che segnalano il cambiamento con
l'emit di commonStatusChange
2019-11-04 15:40:22 +01:00
9483e265f3 aggiunto topic interface, cambiato modo di subscribe mqtt 2019-10-30 16:33:36 +01:00
117cf20765 Modifiche interfaccia 2019-10-30 12:06:26 +01:00
12 changed files with 455 additions and 151 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.8.2, 2019-10-23T17:47:47. --> <!-- Written by QtCreator 4.8.2, 2019-11-18T18:58:05. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>

View File

@@ -1,9 +1,10 @@
#include "mqtt_callback.h" #include "mqtt_callback.h"
mqtt_callback::mqtt_callback(mqtt::async_client *cli, std::shared_ptr<spdlog::logger> log) { mqtt_callback::mqtt_callback(mqtt::async_client *cli, std::shared_ptr<spdlog::logger> log, RoboGlue_SHARED *mem) {
//initialize client pointer //initialize client pointer
cli_=cli; cli_=cli;
log_=log; log_=log;
mem_= mem;
} }
void mqtt_callback::connected(const mqtt::string &cause) { void mqtt_callback::connected(const mqtt::string &cause) {
@@ -17,6 +18,47 @@ void mqtt_callback::connection_lost(const mqtt::string &cause) {
void mqtt_callback::message_arrived(mqtt::const_message_ptr msg) { void mqtt_callback::message_arrived(mqtt::const_message_ptr msg) {
log_->debug("Message Arrived: topic->{} - message->{}", log_->debug("Message Arrived: topic->{} - message->{}",
msg->get_topic(), msg->to_string()); msg->get_topic(), msg->to_string());
if(msg->get_topic() == mem_->comSettings.subMap.find("interface")->second) {
log_->debug("MQTT: Interface Message: {}", msg->get_payload().c_str());
// Gestione dei messaggi di interfaccia
std::vector<std::string> intMsg;
boost::split(intMsg, static_cast<const std::string>(msg->to_string()), boost::is_any_of(":"));
if (!intMsg[mem_->comSettings.TYPE].compare("STARTUP") ||
!intMsg[mem_->comSettings.TYPE].compare("HB")){
// Received Startup Message
log_->debug("Startup/Heartbeat from node, ts: {},[{}]",
intMsg[mem_->comSettings.NODE].c_str(),
intMsg[mem_->comSettings.TS]);
if (!intMsg[mem_->comSettings.NODE].compare(mem_->comSettings.nodeNames["relay"])){
mem_->commonStatus.relayRunning = true;
mem_->commonStatus.relayLast = std::stod(intMsg[mem_->comSettings.TS]);
log_->trace("HB RELAY time: [{}]", mem_->commonStatus.relayLast);
} else if (!intMsg[mem_->comSettings.NODE].compare(mem_->comSettings.nodeNames["follower"])) {
mem_->commonStatus.followerRunning = true;
mem_->commonStatus.followerLast = std::stod(intMsg[mem_->comSettings.TS]);
log_->trace("HB FOLLOWER time: [{}]", mem_->commonStatus.followerLast);
} else if (!intMsg[mem_->comSettings.NODE].compare(mem_->comSettings.nodeNames["recorder"])) {
mem_->commonStatus.recorderRunning = true;
mem_->commonStatus.recorderLast = std::stod(intMsg[mem_->comSettings.TS]);
log_->trace("HB RECORDER time: [{}]", mem_->commonStatus.recorderLast);
} else if (!intMsg[mem_->comSettings.NODE].compare(mem_->comSettings.nodeNames["broadcaster"])) {
mem_->commonStatus.broadcasterRunning = true;
mem_->commonStatus.broadcasterLast = std::stod(intMsg[mem_->comSettings.TS]);
log_->trace("HB BROADCASTER time: [{}]", mem_->commonStatus.broadcasterLast);
} else {
log_->error("Node {} unknown", intMsg[mem_->comSettings.NODE].c_str());
}
//emit mem_->commonStatusChange();
}
} else if (msg->get_topic() == mem_->comSettings.subMap.find("state")->second){
log_->debug("MQTT: State Message: {}", msg->get_payload().c_str());
} else if (msg->get_topic() == mem_->comSettings.subMap.find("commands")->second){
log_->debug("MQTT: Command Message: {}", msg->get_payload().c_str());
} else if (msg->get_topic() == mem_->comSettings.subMap.find("coordinates")->second){
log_->debug("MQTT: Coordinate Message: {}", msg->get_payload().c_str());
} else {
log_->error("Unrecognized topic: {}", msg->get_topic().c_str());
}
} }
void mqtt_callback::delivery_complete(mqtt::delivery_token_ptr tok) { void mqtt_callback::delivery_complete(mqtt::delivery_token_ptr tok) {

View File

@@ -4,15 +4,17 @@
#include <mqtt/client.h> #include <mqtt/client.h>
#include <mqtt/callback.h> #include <mqtt/callback.h>
#include <spdlog/logger.h> #include <spdlog/logger.h>
#include <shared/roboglue_shared.h>
class mqtt_callback : public virtual mqtt::callback { class mqtt_callback : public virtual mqtt::callback {
private: private:
RoboGlue_SHARED *mem_;
mqtt::async_client *cli_ = nullptr; mqtt::async_client *cli_ = nullptr;
std::shared_ptr<spdlog::logger> log_; std::shared_ptr<spdlog::logger> log_;
public: public:
mqtt_callback(mqtt::async_client *cli, std::shared_ptr<spdlog::logger> log); mqtt_callback(mqtt::async_client *cli, std::shared_ptr<spdlog::logger> log,RoboGlue_SHARED *m);
void connected(const mqtt::string &cause) override; void connected(const mqtt::string &cause) override;
void connection_lost(const mqtt::string &cause) override; void connection_lost(const mqtt::string &cause) override;

View File

@@ -5,8 +5,8 @@ RoboGlue_COM::RoboGlue_COM (RoboGlue_SHARED *mem): m(mem) {
//////// SETUP LOGGER ////////// //////// SETUP LOGGER //////////
liblog = spdlog::stdout_logger_mt("URcom_liblog"); liblog = spdlog::stdout_logger_mt("URcom_liblog");
modlog = spdlog::stdout_logger_mt("RoboGlue_comlog"); modlog = spdlog::stdout_logger_mt("RoboGlue_comlog");
liblog->set_level(spdlog::level::debug); liblog->set_level(spdlog::level::warn);
modlog->set_level(spdlog::level::debug); modlog->set_level(spdlog::level::warn);
///////// INITIALIZE TCP SERVER /////////// ///////// INITIALIZE TCP SERVER ///////////
server = new QTcpServer(this); server = new QTcpServer(this);
@@ -16,7 +16,7 @@ RoboGlue_COM::RoboGlue_COM (RoboGlue_SHARED *mem): m(mem) {
//////// INITIALIZE MQTT CONNECTOR /////// //////// INITIALIZE MQTT CONNECTOR ///////
client = new mqtt::async_client(std::string("tcp://localhost:1883"),""); client = new mqtt::async_client(std::string("tcp://localhost:1883"),"");
callback = new mqtt_callback(client,modlog);//////////////////////////////////////////////// callback = new mqtt_callback(client,modlog,m);////////////////////////////////////////////////
//////// END EXTERNAL PUBLIC SLOTS ///////////// //////// END EXTERNAL PUBLIC SLOTS /////////////
//////////////////////////////////////////////// ////////////////////////////////////////////////
baseMsg = m->commonSettings.baseMessage; baseMsg = m->commonSettings.baseMessage;
@@ -35,9 +35,12 @@ void RoboGlue_COM::run() {
client->set_callback(*callback); client->set_callback(*callback);
client->connect()->wait(); client->connect()->wait();
// subscrbe to mqtt topics // subscrbe to mqtt topics
std::vector<std::string> subList = m->comSettings.subList; try{
for (uint i=0; i < subList.size(); i++){ for (auto it=m->comSettings.subMap.begin(); it != m->comSettings.subMap.end(); ++it){
client->subscribe(subList[i],0); client->subscribe(it->second,0);
}
} catch (mqtt::exception &e) {
modlog->error("MQTT Error {}", e.what());
} }
client->start_consuming(); client->start_consuming();
@@ -270,7 +273,7 @@ void RoboGlue_COM::timed_sendCoordinates(){
baseMsg["value"]["rx"] = sp[3]; baseMsg["value"]["rx"] = sp[3];
baseMsg["value"]["ry"] = sp[4]; baseMsg["value"]["ry"] = sp[4];
baseMsg["value"]["rz"] = sp[5]; baseMsg["value"]["rz"] = sp[5];
MQTTpublish(baseMsg, m->comSettings.pubList[m->comSettings.COORD]); MQTTpublish(baseMsg, m->comSettings.pubMap.find("coordinates")->second);
} }
} }
//////////////////////////////////////////////// ////////////////////////////////////////////////
@@ -329,7 +332,7 @@ void RoboGlue_COM::on_sendROScommand(QString command, QVariantMap params) {
baseMsg["command"] = command.toStdString(); baseMsg["command"] = command.toStdString();
QJsonDocument jparam = QJsonDocument(QJsonObject::fromVariantMap(params)); QJsonDocument jparam = QJsonDocument(QJsonObject::fromVariantMap(params));
baseMsg["params"] = json::parse(jparam.toJson().data()); baseMsg["params"] = json::parse(jparam.toJson().data());
MQTTpublish(baseMsg, m->comSettings.pubList[m->comSettings.COMM]); MQTTpublish(baseMsg, m->comSettings.pubMap.find("commands")->second);
} }
void RoboGlue_COM::on_sendROScoordinates(QList<double> sp) { void RoboGlue_COM::on_sendROScoordinates(QList<double> sp) {
@@ -350,41 +353,3 @@ void RoboGlue_COM::on_sendROSstate(QMap<std::string,bool> digital, QMap<std::str
//////////////////////////////////////////////// ////////////////////////////////////////////////
//////// END EXTERNAL PUBLIC SLOTS ///////////// //////// END EXTERNAL PUBLIC SLOTS /////////////
//////////////////////////////////////////////// ////////////////////////////////////////////////
//void RoboGlue_COM::on_sendSetpointOLD(QList<double> sp) {
// std::string setpoint;
// struct {
// union{
// struct{
// uint32_t x,y,z,a,b,c,keepalive;
// };
// char bytes[28];
// };
// } setPointBytes;
// setPointBytes.keepalive=1;
// int32_t v;
// setpoint = "(";
// for(uchar i=0; i<JOINT_NUMBER; i++){
// v=static_cast<int32_t>(sp[i]*1000);
// if (i>2) v=boost::algorithm::clamp(v, -2680,2680);
// setpoint.append(std::to_string(v));
// boost::algorithm::replace_all(setpoint, ",",".");
// if(i<JOINT_NUMBER) setpoint.append("|");
// }
// setpoint.append("1");
// boost::algorithm::replace_all(setpoint,"|",",");
// setpoint.append(")");
// setPointBytes.x=htonl(static_cast<uint32_t>(sp[0]*1000));
// setPointBytes.y=htonl(static_cast<uint32_t>(sp[1]*1000));
// setPointBytes.z=htonl(static_cast<uint32_t>(sp[2]*1000));
// setPointBytes.a=htonl(static_cast<uint32_t>(sp[3]*1000));
// setPointBytes.b=htonl(static_cast<uint32_t>(sp[4]*1000));
// setPointBytes.c=htonl(static_cast<uint32_t>(sp[5]*1000));
// setPointBytes.keepalive=htonl(setPointBytes.keepalive);
// if(robotIN->write(setPointBytes.bytes,28))
// modlog->trace("Sent Setpoint {}",setpoint.c_str());
// robotIN->flush();
//}

View File

@@ -44,6 +44,7 @@
* della coda di destinazione. * della coda di destinazione.
* 20190311 - La pubblicazione dei messaggi di coordinate verso ros deve essere a rateo costante * 20190311 - La pubblicazione dei messaggi di coordinate verso ros deve essere a rateo costante
* indipendentemente dalla frequenza di ingresso * indipendentemente dalla frequenza di ingresso
* 20191030 - Spostata la documentazione su GIT
*/ */
#include <QObject> #include <QObject>

View File

@@ -26,6 +26,8 @@ RoboGlue_GUI::RoboGlue_GUI(RoboGlue_SHARED *mem) : m(mem) {
this, SLOT(deleteLater()), Qt::ConnectionType::QueuedConnection); this, SLOT(deleteLater()), Qt::ConnectionType::QueuedConnection);
connect(this, SIGNAL(pad_hoverEvent(QEvent *)), connect(this, SIGNAL(pad_hoverEvent(QEvent *)),
this, SLOT(on_pad_hoverEvent(QEvent *))); this, SLOT(on_pad_hoverEvent(QEvent *)));
connect(m, SIGNAL(commonStatusChange()),
this, SLOT(on_commonStatusChange()));
/////// READ NAME DEFINITION JSON FILE ////////// /////// READ NAME DEFINITION JSON FILE //////////
try { try {
@@ -89,6 +91,18 @@ void RoboGlue_GUI::disableLockAxes(){
//////////////////////////////////////////////// ////////////////////////////////////////////////
void RoboGlue_GUI::on_commonStatusChange() { void RoboGlue_GUI::on_commonStatusChange() {
modlog->trace("on_commonStatusChange Received"); modlog->trace("on_commonStatusChange Received");
this->ui->lbl_relay->setText(QString().fromStdString(this->m->comSettings.nodeNames.find("relay")->second+": "+std::to_string(static_cast<uint>(m->commonStatus.relayTime))));
this->ui->lbl_follower->setText(QString().fromStdString(this->m->comSettings.nodeNames.find("follower")->second+": "+std::to_string(static_cast<uint>(m->commonStatus.followerTime))));
this->ui->lbl_recorder->setText(QString().fromStdString(this->m->comSettings.nodeNames.find("recorder")->second+": "+std::to_string(static_cast<uint>(m->commonStatus.recorderTime))));
this->ui->lbl_broadcaster->setText(QString().fromStdString(this->m->comSettings.nodeNames.find("broadcaster")->second+": "+std::to_string(static_cast<uint>(m->commonStatus.broadcasterTime))));
if (!m->commonStatus.relayRunning) this->ui->lbl_relay->setStyleSheet("QLabel { background-color : red; color : white; }");
else this->ui->lbl_relay->setStyleSheet("QLabel { background-color : green; color : white; }");
if (!m->commonStatus.recorderRunning) this->ui->lbl_recorder->setStyleSheet("QLabel { background-color : red; color : white; }");
else this->ui->lbl_recorder->setStyleSheet("QLabel { background-color : green; color : white; }");
if (!m->commonStatus.followerRunning) this->ui->lbl_follower->setStyleSheet("QLabel { background-color : red; color : white; }");
else this->ui->lbl_follower->setStyleSheet("QLabel { background-color : green; color : white; }");
if (!m->commonStatus.broadcasterRunning) this->ui->lbl_broadcaster->setStyleSheet("QLabel { background-color : red; color : white; }");
else this->ui->lbl_broadcaster->setStyleSheet("QLabel { background-color : green; color : white; }");
} }
void RoboGlue_GUI::on_pad_hoverEvent(QEvent* e) { void RoboGlue_GUI::on_pad_hoverEvent(QEvent* e) {
@@ -253,7 +267,7 @@ void RoboGlue_GUI::on_btn_open_clicked() {
m->commonStatus.isFileOpen = true; m->commonStatus.isFileOpen = true;
fileOpen = true; fileOpen = true;
metadata["name"] = ui->txt_fileName->text(); metadata["name"] = ui->txt_fileName->text();
metadata["plot"] = true; metadata["plot"] = ui->chk_plot->isChecked();
param["action"] = "open"; param["action"] = "open";
param["metadata"] = metadata; param["metadata"] = metadata;
ui->btn_record->setEnabled(false); ui->btn_record->setEnabled(false);
@@ -311,6 +325,30 @@ void RoboGlue_GUI::on_btn_home_clicked() {
emit sendROScommand("HOME", param); emit sendROScommand("HOME", param);
} }
void RoboGlue_GUI::on_btn_setFrame_clicked() {
QVariantMap param, frm;
QList<QString> tempPos, TempOr;
modlog->debug("setFrame");
param["action"]="set";
param["framename"]=ui->txt_frameName->text();
for(auto tp : ui->txt_framePos->text().split(",")){
frm[tp.split(":").first()]=tp.split(":").last().replace(" ", "").toDouble();
}
for(auto tp : ui->txt_frameOr->text().split(",")){
frm[tp.split(":").first()]=tp.split(":").last().replace(" ", "").toDouble();
}
param["frame"]=frm;
emit m->commonStatusChange();
emit sendROScommand("SETFRAME", param);
}
void RoboGlue_GUI::on_btn_stopRos_clicked() {
QVariantMap param;
modlog->debug("stopRos");
param["action"]=false;
emit m->commonStatusChange();
emit sendROScommand("QUIT", param);
}
//////////////////////////////////////////////// ////////////////////////////////////////////////
////////END INTERNAL PRIVATE SLOTS////////////// ////////END INTERNAL PRIVATE SLOTS//////////////
//////////////////////////////////////////////// ////////////////////////////////////////////////

View File

@@ -95,6 +95,10 @@ private slots:
void on_btn_home_clicked(); void on_btn_home_clicked();
void on_btn_open_clicked(); void on_btn_open_clicked();
void on_btn_setFrame_clicked();
void on_btn_stopRos_clicked();
signals: signals:
void robotConnect(QString, uint port, uchar retry); void robotConnect(QString, uint port, uchar retry);
void robotDisconnect(); void robotDisconnect();

View File

@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1108</width> <width>1018</width>
<height>760</height> <height>826</height>
</rect> </rect>
</property> </property>
<property name="mouseTracking"> <property name="mouseTracking">
@@ -438,10 +438,10 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>-</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set> <set>Qt::TextSelectableByMouse</set>
@@ -457,10 +457,10 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>-</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set> <set>Qt::TextSelectableByMouse</set>
@@ -476,10 +476,10 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>-</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set> <set>Qt::TextSelectableByMouse</set>
@@ -498,10 +498,10 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>-</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set> <set>Qt::TextSelectableByMouse</set>
@@ -517,10 +517,10 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>-</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set> <set>Qt::TextSelectableByMouse</set>
@@ -536,10 +536,10 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>-</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set> <set>Qt::TextSelectableByMouse</set>
@@ -588,10 +588,10 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>-</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set> <set>Qt::TextSelectableByMouse</set>
@@ -607,10 +607,10 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>-</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set> <set>Qt::TextSelectableByMouse</set>
@@ -626,10 +626,10 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>-</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set> <set>Qt::TextSelectableByMouse</set>
@@ -645,10 +645,10 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>-</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set> <set>Qt::TextSelectableByMouse</set>
@@ -664,10 +664,10 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>-</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set> <set>Qt::TextSelectableByMouse</set>
@@ -683,10 +683,10 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>-</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set> <set>Qt::TextSelectableByMouse</set>
@@ -920,7 +920,7 @@
</item> </item>
<item row="0" column="0"> <item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item alignment="Qt::AlignHCenter">
<widget class="QFrame" name="frm_move"> <widget class="QFrame" name="frm_move">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@@ -976,21 +976,30 @@
<item> <item>
<widget class="QLabel" name="lbl_posX"> <widget class="QLabel" name="lbl_posX">
<property name="text"> <property name="text">
<string>TextLabel</string> <string>-</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="lbl_posY"> <widget class="QLabel" name="lbl_posY">
<property name="text"> <property name="text">
<string>TextLabel</string> <string>-</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="lbl_posZ"> <widget class="QLabel" name="lbl_posZ">
<property name="text"> <property name="text">
<string>TextLabel</string> <string>-</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
@@ -1037,7 +1046,21 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="txt_fileName"/> <widget class="QLineEdit" name="txt_fileName">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chk_plot">
<property name="text">
<string>Plot</string>
</property>
</widget>
</item> </item>
</layout> </layout>
</item> </item>
@@ -1211,33 +1234,17 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <widget class="Line" name="line_12">
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>dS</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="2">
<widget class="QLabel" name="label_19"> <widget class="QLabel" name="label_19">
<property name="text"> <property name="text">
<string>dT</string> <string>dT</string>
@@ -1247,7 +1254,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="1">
<widget class="QDoubleSpinBox" name="spn_ds"> <widget class="QDoubleSpinBox" name="spn_ds">
<property name="maximum"> <property name="maximum">
<double>100.000000000000000</double> <double>100.000000000000000</double>
@@ -1263,7 +1270,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="2">
<widget class="QDoubleSpinBox" name="spn_dt"> <widget class="QDoubleSpinBox" name="spn_dt">
<property name="maximum"> <property name="maximum">
<double>240.000000000000000</double> <double>240.000000000000000</double>
@@ -1276,10 +1283,108 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1">
<widget class="QLabel" name="label_18">
<property name="text">
<string>dS</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Point Record Distance/Time</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="Line" name="line_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="2">
<widget class="QLineEdit" name="txt_framePos">
<property name="inputMask">
<string>\x:000,y:000,z:000 </string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_21">
<property name="text">
<string>Orientation</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_20">
<property name="text">
<string>Position</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="txt_frameOr">
<property name="inputMask">
<string>r\x:#00.0,ry:#00.0,rz:#00.0 </string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="btn_setFrame">
<property name="text">
<string>SetFrame</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_24">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Name</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLineEdit" name="txt_frameName"/>
</item>
</layout>
</item>
<item> <item>
<spacer name="verticalSpacer_2"> <spacer name="verticalSpacer_2">
<property name="orientation"> <property name="orientation">
@@ -1309,6 +1414,52 @@
</widget> </widget>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="label_23">
<property name="text">
<string>ROS Status</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_relay">
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_follower">
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_recorder">
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lbl_broadcaster">
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_stopRos">
<property name="text">
<string>Stop_ROS</string>
</property>
</widget>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QMenuBar" name="menubar"> <widget class="QMenuBar" name="menubar">
@@ -1316,7 +1467,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1108</width> <width>1018</width>
<height>22</height> <height>22</height>
</rect> </rect>
</property> </property>
@@ -1338,12 +1489,12 @@
<resources/> <resources/>
<connections/> <connections/>
<buttongroups> <buttongroups>
<buttongroup name="grp_mod"/> <buttongroup name="grp_hilo"/>
<buttongroup name="gpr_lock"> <buttongroup name="gpr_lock">
<property name="exclusive"> <property name="exclusive">
<bool>false</bool> <bool>false</bool>
</property> </property>
</buttongroup> </buttongroup>
<buttongroup name="grp_hilo"/> <buttongroup name="grp_mod"/>
</buttongroups> </buttongroups>
</ui> </ui>

View File

@@ -5,7 +5,6 @@ RoboGlue_INIT::RoboGlue_INIT(QWidget *parent, const char*) : QMainWindow(parent)
//////// SETUP LOGGER ////////// //////// SETUP LOGGER //////////
inilog = spdlog::stdout_logger_mt("RoboGlue_inilog"); inilog = spdlog::stdout_logger_mt("RoboGlue_inilog");
inilog->info("INIT Started");
//////// SETUP USER INTERFACE /////// //////// SETUP USER INTERFACE ///////
ui = new Ui::RoboGlue_INIT; ui = new Ui::RoboGlue_INIT;
@@ -38,6 +37,9 @@ RoboGlue_INIT::RoboGlue_INIT(QWidget *parent, const char*) : QMainWindow(parent)
//////// CONNECT SIGNALS & SLOTS /////// //////// CONNECT SIGNALS & SLOTS ///////
connect(this, SIGNAL(destroyed()), this, SLOT(deleteLater()), Qt::ConnectionType::QueuedConnection); connect(this, SIGNAL(destroyed()), this, SLOT(deleteLater()), Qt::ConnectionType::QueuedConnection);
//////// SIGNAL STARTED ////////////////
inilog->info("INIT Started");
} }
RoboGlue_INIT::~RoboGlue_INIT() { RoboGlue_INIT::~RoboGlue_INIT() {

View File

@@ -8,35 +8,50 @@ automain=false
autotrack=false autotrack=false
[robot] [robot]
connection\autoconnect=false connection\autoconnect=true
connection\robotip=10.0.0.5 connection\robotip=10.0.0.5
connection\robotport=30002 connection\robotport=30002
connection\robotretry=5 connection\robotretry=5
kine\dhtable\1\dha=6.94460589082162e-310 kine\dhtable\1\dha=0
kine\dhtable\1\dhalpha=6.9446058912971e-310 kine\dhtable\1\dhalpha=0
kine\dhtable\1\dhd=1.099340831232476e+248 kine\dhtable\1\dhd=0
kine\dhtable\1\dhtheta=1.332e-320 kine\dhtable\1\dhtheta=0
kine\dhtable\2\dha=0 kine\dhtable\2\dha=0
kine\dhtable\2\dhalpha=6.9446058912884e-310 kine\dhtable\2\dhalpha=0
kine\dhtable\2\dhd=1.3849777432376169e+219 kine\dhtable\2\dhd=0
kine\dhtable\2\dhtheta=6.9446058913382e-310 kine\dhtable\2\dhtheta=0
kine\dhtable\3\dha=0 kine\dhtable\3\dha=0
kine\dhtable\3\dhalpha=5.53e-322 kine\dhtable\3\dhalpha=0
kine\dhtable\3\dhd=2.44861994589e-312 kine\dhtable\3\dhd=0
kine\dhtable\3\dhtheta=8e-323 kine\dhtable\3\dhtheta=0
kine\dhtable\4\dha=2.37e-322 kine\dhtable\4\dha=0
kine\dhtable\4\dhalpha=2.37e-322 kine\dhtable\4\dhalpha=0
kine\dhtable\4\dhd=0 kine\dhtable\4\dhd=0
kine\dhtable\4\dhtheta=0 kine\dhtable\4\dhtheta=0
kine\dhtable\5\dha=2.57e-322 kine\dhtable\5\dha=0
kine\dhtable\5\dhalpha=2.57e-322 kine\dhtable\5\dhalpha=0
kine\dhtable\5\dhd=2.06e-321 kine\dhtable\5\dhd=0
kine\dhtable\5\dhtheta=8.74e-322 kine\dhtable\5\dhtheta=0
kine\dhtable\6\dha=6.9446058915066e-310 kine\dhtable\6\dha=0
kine\dhtable\6\dhalpha=6.9446058913493e-310 kine\dhtable\6\dhalpha=0
kine\dhtable\6\dhd=6.94460589137854e-310 kine\dhtable\6\dhd=0
kine\dhtable\6\dhtheta=6.94460589137854e-310 kine\dhtable\6\dhtheta=0
kine\dhtable\size=6 kine\dhtable\size=6
kine\maxreach=@Variant(\0\0\0\x87?\x99\x99\x9a) kine\maxreach=@Variant(\0\0\0\x87?\x99\x99\x9a)
kine\prefix=0 kine\prefix=0
kine\suffix=0 kine\suffix=0
[ros]
deadTime=10
ros_nodes\mqtt_publishers\commands=roboglue_com/com2ros/commands
ros_nodes\mqtt_publishers\coordinates=roboglue_com/com2ros/coordinates
ros_nodes\mqtt_publishers\interface=roboglue_com/com2ros/interface
ros_nodes\mqtt_publishers\state=roboglue_com/com2ros/state
ros_nodes\mqtt_subscribers\commands=roboglue_com/ros2com/commands
ros_nodes\mqtt_subscribers\coordinates=roboglue_com/ros2com/coordinates
ros_nodes\mqtt_subscribers\interface=roboglue_com/ros2com/interface
ros_nodes\mqtt_subscribers\state=roboglue_com/ros2com/state
ros_nodes\node_names\broadcaster=roboglue_ros_broadcaster
ros_nodes\node_names\follower=roboglue_ros_follower
ros_nodes\node_names\recorder=roboglue_ros_recorder
ros_nodes\node_names\relay=roboglue_ros_relay

View File

@@ -2,14 +2,34 @@
RoboGlue_SHARED::RoboGlue_SHARED(QSettings *set){ RoboGlue_SHARED::RoboGlue_SHARED(QSettings *set){
settings=set; settings=set;
//FIXME: inserire la lettura di quesste informazioni da un file
robotVariables.insert(std::pair<std::string, int>("RDY",1)); robotVariables.insert(std::pair<std::string, int>("RDY",1));
statusTimer = new QTimer(this);
connect(statusTimer, SIGNAL(timeout()), this, SLOT(on_statusTimer()));
statusTimer->start(static_cast<int>(comSettings.deadTime*1000));
}
RoboGlue_SHARED::~RoboGlue_SHARED(){
statusTimer->stop();
delete statusTimer;
}
void RoboGlue_SHARED::on_statusTimer(void){
double curTime = static_cast<double>(std::time(NULL));
commonStatus.relayRunning = (commonStatus.relayTime = fabs(commonStatus.relayLast - curTime)) < comSettings.deadTime;
commonStatus.followerRunning = (commonStatus.followerTime = fabs(commonStatus.followerLast - curTime)) < comSettings.deadTime;
commonStatus.recorderRunning = (commonStatus.recorderTime = fabs(commonStatus.recorderLast - curTime)) < comSettings.deadTime;
commonStatus.broadcasterRunning = (commonStatus.broadcasterTime = fabs(commonStatus.broadcasterLast - curTime)) < comSettings.deadTime;
emit this->commonStatusChange();
} }
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
/////////////////////// RESTORE FUNCTIONS ///////////////////// /////////////////////// RESTORE FUNCTIONS /////////////////////
///////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////
void RoboGlue_SHARED::restoreCommonSettings(){
settings->beginGroup("common");
settings->endGroup();
}
void RoboGlue_SHARED::restoreInitSettings(){ void RoboGlue_SHARED::restoreInitSettings(){
settings->beginGroup("init"); settings->beginGroup("init");
initSettings.size=settings->value("size").toSize(); initSettings.size=settings->value("size").toSize();
@@ -50,6 +70,29 @@ void RoboGlue_SHARED::restoreComSettings() {
// TODO something // TODO something
settings->endGroup(); settings->endGroup();
settings->endGroup(); settings->endGroup();
settings->beginGroup("ros");
comSettings.deadTime = settings->value("deadTime").toDouble();
settings->beginGroup("ros_nodes");
settings->beginGroup("mqtt_publishers");
comSettings.pubMap["commands"] = settings->value("commands").toString().toStdString();
comSettings.pubMap["coordinates"] = settings->value("coordinates").toString().toStdString();
comSettings.pubMap["state"] = settings->value("state").toString().toStdString();
comSettings.pubMap["interface"] = settings->value("interface").toString().toStdString();
settings->endGroup();
settings->beginGroup("mqtt_subscribers");
comSettings.subMap["commands"] = settings->value("commands").toString().toStdString();
comSettings.subMap["coordinates"] = settings->value("coordinates").toString().toStdString();
comSettings.subMap["state"] = settings->value("state").toString().toStdString();
comSettings.subMap["interface"] = settings->value("interface").toString().toStdString();
settings->endGroup();
settings->beginGroup("node_names");
comSettings.nodeNames["relay"] = settings->value("relay").toString().toStdString();
comSettings.nodeNames["follower"] = settings->value("follower").toString().toStdString();
comSettings.nodeNames["recorder"] = settings->value("recorder").toString().toStdString();
comSettings.nodeNames["broadcaster"] = settings->value("broadcaster").toString().toStdString();
settings->endGroup();
settings->endGroup();
settings->endGroup();
} }
void RoboGlue_SHARED::restoreGuiSettings() { void RoboGlue_SHARED::restoreGuiSettings() {
@@ -74,7 +117,6 @@ void RoboGlue_SHARED::restoreTrackSettings() {
void RoboGlue_SHARED::saveCommonSettings(){ void RoboGlue_SHARED::saveCommonSettings(){
settings->beginGroup("common"); settings->beginGroup("common");
settings->endGroup(); settings->endGroup();
} }
void RoboGlue_SHARED::saveInitSettings() { void RoboGlue_SHARED::saveInitSettings() {
@@ -94,6 +136,29 @@ void RoboGlue_SHARED::saveComSettings() {
settings->setValue("suffix", comSettings.connection.suffix); settings->setValue("suffix", comSettings.connection.suffix);
settings->endGroup(); settings->endGroup();
settings->endGroup(); settings->endGroup();
settings->beginGroup("ros");
settings->setValue("deadTime", comSettings.deadTime);
settings->beginGroup("ros_nodes");
settings->beginGroup("mqtt_publishers");
settings->setValue("commands", QString().fromStdString(comSettings.pubMap.find("commands")->second));
settings->setValue("coordinates", QString().fromStdString(comSettings.pubMap.find("coordinates")->second));
settings->setValue("state", QString().fromStdString(comSettings.pubMap.find("state")->second));
settings->setValue("interface", QString().fromStdString(comSettings.pubMap.find("interface")->second));
settings->endGroup();
settings->beginGroup("mqtt_subscribers");
settings->setValue("commands", QString().fromStdString(comSettings.subMap.find("commands")->second));
settings->setValue("coordinates", QString().fromStdString(comSettings.subMap.find("coordinates")->second));
settings->setValue("state", QString().fromStdString(comSettings.subMap.find("state")->second));
settings->setValue("interface", QString().fromStdString(comSettings.subMap.find("interface")->second));
settings->endGroup();
settings->beginGroup("node_names");
settings->setValue("relay", QString().fromStdString(comSettings.nodeNames.find("relay")->second));
settings->setValue("follower", QString().fromStdString(comSettings.nodeNames.find("follower")->second));
settings->setValue("recorder", QString().fromStdString(comSettings.nodeNames.find("recorder")->second));
settings->setValue("broadcaster", QString().fromStdString(comSettings.nodeNames.find("broadcaster")->second));
settings->endGroup();
settings->endGroup();
settings->endGroup();
} }
void RoboGlue_SHARED::saveGuiSettings() { void RoboGlue_SHARED::saveGuiSettings() {

View File

@@ -21,16 +21,19 @@
* QUESTA COSA VA GIÀ CAMBIATA PERCHÈ È TROPPO CONFUSIONARIA!! * QUESTA COSA VA GIÀ CAMBIATA PERCHÈ È TROPPO CONFUSIONARIA!!
* 20190124 - Implementati tutti i metodi che salvano e ripristinano le configurazioni. * 20190124 - Implementati tutti i metodi che salvano e ripristinano le configurazioni.
* 20190311 - Aggiunta la struttura che tiene gli stati che devono rimanere comuni ai moduli. * 20190311 - Aggiunta la struttura che tiene gli stati che devono rimanere comuni ai moduli.
* * 20191030 - Documentazione spostata in GIT
*/ */
#include <QMutex> #include <QMutex>
#include <QSettings> #include <QSettings>
#include <QPoint> #include <QPoint>
#include <QSize> #include <QSize>
#include <QTimer>
#include <stdexcept> #include <stdexcept>
#include <ctime>
#include <libJson/json.hpp> #include <libJson/json.hpp>
#include <libURcom/URCLinterface.h> #include <libURcom/URCLinterface.h>
#include <boost/algorithm/string.hpp>
using namespace nlohmann; using namespace nlohmann;
@@ -39,7 +42,9 @@ class RoboGlue_SHARED : public QObject{
public: public:
RoboGlue_SHARED(QSettings *set); RoboGlue_SHARED(QSettings *set);
virtual ~RoboGlue_SHARED();
QMutex mutex; QMutex mutex;
QTimer* statusTimer;
//////////// COMMON MODULES STATUS /////////////// //////////// COMMON MODULES STATUS ///////////////
struct { struct {
@@ -47,6 +52,20 @@ public:
bool isPlaying = false; bool isPlaying = false;
bool isRealtime = false; bool isRealtime = false;
bool isFileOpen = false; bool isFileOpen = false;
// ROS node status
bool relayRunning = false;
bool followerRunning = false;
bool recorderRunning = false;
bool broadcasterRunning = false;
// ROS node last seen
double relayLast = static_cast<double>(time(NULL));
double followerLast = static_cast<double>(time(NULL));
double recorderLast = static_cast<double>(time(NULL));
double broadcasterLast = static_cast<double>(time(NULL));
double relayTime = static_cast<double>(time(NULL));
double followerTime = static_cast<double>(time(NULL));
double recorderTime = static_cast<double>(time(NULL));
double broadcasterTime = static_cast<double>(time(NULL));
} commonStatus; } commonStatus;
/////////// PERMANENT SETTINGS VARIABLES ///////// /////////// PERMANENT SETTINGS VARIABLES /////////
@@ -66,7 +85,7 @@ public:
struct { struct {
struct { struct {
std::string robotIp = std::string("192.168.0.31"); std::string robotIp = std::string("localhost");
uint robotPort = 30002; uint robotPort = 30002;
unsigned char retry = 5; unsigned char retry = 5;
bool autoConnect = false; bool autoConnect = false;
@@ -77,19 +96,16 @@ public:
kineDH_t DHtable; kineDH_t DHtable;
float maxReach = 1.2; float maxReach = 1.2;
} kine; } kine;
std::vector<std::string> subList { double deadTime = 1.0; //default value
{"roboglue_com/ros2com/commands"}, std::map<std::string, std::string> subMap;
{"roboglue_com/ros2com/coordinates"}, std::map<std::string, std::string> pubMap;
{"roboglue_com/ros2com/state"} std::map<std::string, std::string> nodeNames;
};
std::vector<std::string> pubList {
{"roboglue_com/com2ros/commands"},
{"roboglue_com/com2ros/coordinates"},
{"roboglue_com/com2ros/state"}
};
enum { enum {
COMM, COORD, STAT COMM, COORD, STAT
} tList; } tList;
enum {
TYPE, NODE, TS
};
} comSettings; } comSettings;
struct { struct {
@@ -124,6 +140,9 @@ public:
signals: signals:
void commonStatusChange(void); void commonStatusChange(void);
private slots:
void on_statusTimer(void);
}; };
#endif // ROBOGLUE_SHARED_H #endif // ROBOGLUE_SHARED_H