Compare commits
17 Commits
9483e265f3
...
master-dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 13a4942562 | |||
| 5942c9b21a | |||
| 57c2b4ed3a | |||
| 2f59630197 | |||
| 069fa97b40 | |||
| 66bf6d5710 | |||
| 5c7caa3259 | |||
| 623ae0bedb | |||
| 04ae933f6e | |||
| 4970162ed5 | |||
| e1e80d16c7 | |||
| cb2b5fdcbd | |||
| bf368d6ac6 | |||
| 64a4b9b122 | |||
| 187c3ed9fc | |||
| 6b1012348c | |||
| 29db06e3c4 |
@@ -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-29T10:42:37. -->
|
<!-- Written by QtCreator 4.8.2, 2019-11-18T18:58:05. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>EnvironmentId</variable>
|
<variable>EnvironmentId</variable>
|
||||||
|
|||||||
@@ -20,6 +20,36 @@ void mqtt_callback::message_arrived(mqtt::const_message_ptr msg) {
|
|||||||
msg->get_topic(), msg->to_string());
|
msg->get_topic(), msg->to_string());
|
||||||
if(msg->get_topic() == mem_->comSettings.subMap.find("interface")->second) {
|
if(msg->get_topic() == mem_->comSettings.subMap.find("interface")->second) {
|
||||||
log_->debug("MQTT: Interface Message: {}", msg->get_payload().c_str());
|
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){
|
} else if (msg->get_topic() == mem_->comSettings.subMap.find("state")->second){
|
||||||
log_->debug("MQTT: State Message: {}", msg->get_payload().c_str());
|
log_->debug("MQTT: State Message: {}", msg->get_payload().c_str());
|
||||||
} else if (msg->get_topic() == mem_->comSettings.subMap.find("commands")->second){
|
} else if (msg->get_topic() == mem_->comSettings.subMap.find("commands")->second){
|
||||||
@@ -27,7 +57,7 @@ void mqtt_callback::message_arrived(mqtt::const_message_ptr msg) {
|
|||||||
} else if (msg->get_topic() == mem_->comSettings.subMap.find("coordinates")->second){
|
} else if (msg->get_topic() == mem_->comSettings.subMap.find("coordinates")->second){
|
||||||
log_->debug("MQTT: Coordinate Message: {}", msg->get_payload().c_str());
|
log_->debug("MQTT: Coordinate Message: {}", msg->get_payload().c_str());
|
||||||
} else {
|
} else {
|
||||||
log_->error("Unrecognized topic");
|
log_->error("Unrecognized topic: {}", msg->get_topic().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ RoboGlue_COM::RoboGlue_COM (RoboGlue_SHARED *mem): m(mem) {
|
|||||||
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::warn);
|
liblog->set_level(spdlog::level::warn);
|
||||||
modlog->set_level(spdlog::level::info);
|
modlog->set_level(spdlog::level::warn);
|
||||||
|
|
||||||
///////// INITIALIZE TCP SERVER ///////////
|
///////// INITIALIZE TCP SERVER ///////////
|
||||||
server = new QTcpServer(this);
|
server = new QTcpServer(this);
|
||||||
@@ -35,9 +35,13 @@ 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
|
||||||
|
try{
|
||||||
for (auto it=m->comSettings.subMap.begin(); it != m->comSettings.subMap.end(); ++it){
|
for (auto it=m->comSettings.subMap.begin(); it != m->comSettings.subMap.end(); ++it){
|
||||||
client->subscribe(it->second,0);
|
client->subscribe(it->second,0);
|
||||||
}
|
}
|
||||||
|
} catch (mqtt::exception &e) {
|
||||||
|
modlog->error("MQTT Error {}", e.what());
|
||||||
|
}
|
||||||
client->start_consuming();
|
client->start_consuming();
|
||||||
|
|
||||||
/// AUTOCONNECT ROBOT INTERFACE ///
|
/// AUTOCONNECT ROBOT INTERFACE ///
|
||||||
|
|||||||
@@ -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//////////////
|
||||||
////////////////////////////////////////////////
|
////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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">
|
||||||
@@ -441,7 +441,7 @@
|
|||||||
<string>-</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>
|
||||||
@@ -460,7 +460,7 @@
|
|||||||
<string>-</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>
|
||||||
@@ -479,7 +479,7 @@
|
|||||||
<string>-</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>
|
||||||
@@ -501,7 +501,7 @@
|
|||||||
<string>-</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>
|
||||||
@@ -520,7 +520,7 @@
|
|||||||
<string>-</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>
|
||||||
@@ -539,7 +539,7 @@
|
|||||||
<string>-</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>
|
||||||
@@ -591,7 +591,7 @@
|
|||||||
<string>-</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>
|
||||||
@@ -610,7 +610,7 @@
|
|||||||
<string>-</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>
|
||||||
@@ -629,7 +629,7 @@
|
|||||||
<string>-</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>
|
||||||
@@ -648,7 +648,7 @@
|
|||||||
<string>-</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>
|
||||||
@@ -667,7 +667,7 @@
|
|||||||
<string>-</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>
|
||||||
@@ -686,7 +686,7 @@
|
|||||||
<string>-</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">
|
||||||
@@ -978,6 +978,9 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>-</string>
|
<string>-</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -985,6 +988,9 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>-</string>
|
<string>-</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -992,6 +998,9 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>-</string>
|
<string>-</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -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>
|
||||||
@@ -1339,11 +1490,11 @@
|
|||||||
<connections/>
|
<connections/>
|
||||||
<buttongroups>
|
<buttongroups>
|
||||||
<buttongroup name="grp_hilo"/>
|
<buttongroup name="grp_hilo"/>
|
||||||
<buttongroup name="grp_mod"/>
|
|
||||||
<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_mod"/>
|
||||||
</buttongroups>
|
</buttongroups>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -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() {
|
||||||
|
|||||||
@@ -40,3 +40,18 @@ 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
|
||||||
|
|||||||
@@ -4,19 +4,32 @@ RoboGlue_SHARED::RoboGlue_SHARED(QSettings *set){
|
|||||||
settings=set;
|
settings=set;
|
||||||
//FIXME: inserire la lettura di quesste informazioni da un file
|
//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));
|
||||||
comSettings.subMap["commands"] = "roboglue_com/ros2com/commands";
|
statusTimer = new QTimer(this);
|
||||||
comSettings.subMap["coordinates"] = "roboglue_com/ros2com/coordinates";
|
connect(statusTimer, SIGNAL(timeout()), this, SLOT(on_statusTimer()));
|
||||||
comSettings.subMap["state"] = "roboglue_com/ros2com/state";
|
statusTimer->start(static_cast<int>(comSettings.deadTime*1000));
|
||||||
comSettings.subMap["interface"] = "roboglue_com/ros2com/interface";
|
}
|
||||||
|
|
||||||
comSettings.pubMap["commands"] = "roboglue_com/com2ros/commands";
|
RoboGlue_SHARED::~RoboGlue_SHARED(){
|
||||||
comSettings.pubMap["coordinates"] = "roboglue_com/com2ros/coordinates";
|
statusTimer->stop();
|
||||||
comSettings.pubMap["state"] = "roboglue_com/com2ros/state";
|
delete statusTimer;
|
||||||
comSettings.pubMap["interface"] = "roboglue_com/com2ros/interface";
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
@@ -57,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() {
|
||||||
@@ -81,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() {
|
||||||
@@ -101,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() {
|
||||||
|
|||||||
@@ -28,9 +28,12 @@
|
|||||||
#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 /////////
|
||||||
@@ -77,12 +96,16 @@ public:
|
|||||||
kineDH_t DHtable;
|
kineDH_t DHtable;
|
||||||
float maxReach = 1.2;
|
float maxReach = 1.2;
|
||||||
} kine;
|
} kine;
|
||||||
|
double deadTime = 1.0; //default value
|
||||||
std::map<std::string, std::string> subMap;
|
std::map<std::string, std::string> subMap;
|
||||||
std::map<std::string, std::string> pubMap;
|
std::map<std::string, std::string> pubMap;
|
||||||
//FIXME: riempire la mappa dinamicamente da un file, eliminare l'assegnazione manuale
|
std::map<std::string, std::string> nodeNames;
|
||||||
enum {
|
enum {
|
||||||
COMM, COORD, STAT
|
COMM, COORD, STAT
|
||||||
} tList;
|
} tList;
|
||||||
|
enum {
|
||||||
|
TYPE, NODE, TS
|
||||||
|
};
|
||||||
} comSettings;
|
} comSettings;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
@@ -117,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
|
||||||
|
|||||||
Reference in New Issue
Block a user