Compare commits
5 Commits
master
...
b843b8439e
| Author | SHA1 | Date | |
|---|---|---|---|
| b843b8439e | |||
| b5566594b6 | |||
| a2b5557357 | |||
| 9f0074b534 | |||
| bf0ec30e16 |
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.8.2, 2019-07-10T11:42:03. -->
|
||||
<!-- Written by QtCreator 4.8.2, 2019-10-23T17:47:47. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
||||
@@ -5,7 +5,7 @@ RoboGlue_COM::RoboGlue_COM (RoboGlue_SHARED *mem): m(mem) {
|
||||
//////// SETUP LOGGER //////////
|
||||
liblog = spdlog::stdout_logger_mt("URcom_liblog");
|
||||
modlog = spdlog::stdout_logger_mt("RoboGlue_comlog");
|
||||
liblog->set_level(spdlog::level::info);
|
||||
liblog->set_level(spdlog::level::debug);
|
||||
modlog->set_level(spdlog::level::debug);
|
||||
|
||||
///////// INITIALIZE TCP SERVER ///////////
|
||||
|
||||
@@ -196,6 +196,7 @@ void RoboGlue_GUI::on_btn_record_clicked() {
|
||||
param["metadata"] = metadata;
|
||||
ui->btn_play->setEnabled(false);
|
||||
ui->btn_realtime->setEnabled(false);
|
||||
ui->btn_home->setEnabled(false);
|
||||
disableLockAxes();
|
||||
} else {
|
||||
m->commonStatus.isRecording = false;
|
||||
@@ -203,6 +204,7 @@ void RoboGlue_GUI::on_btn_record_clicked() {
|
||||
param["action"]="stop";
|
||||
ui->btn_play->setEnabled(true);
|
||||
ui->btn_realtime->setEnabled(true);
|
||||
ui->btn_home->setEnabled(true);
|
||||
enableLockAxes();
|
||||
}
|
||||
emit m->commonStatusChange();
|
||||
@@ -223,6 +225,7 @@ void RoboGlue_GUI::on_btn_play_clicked() {
|
||||
param["lock"] = getLockAxes();
|
||||
ui->btn_record->setEnabled(false);
|
||||
ui->btn_realtime->setEnabled(false);
|
||||
ui->btn_home->setEnabled(false);
|
||||
ui->btn_play->setText("Stop");
|
||||
ui->txt_fileName->setEnabled(false);
|
||||
disableLockAxes();
|
||||
@@ -232,6 +235,7 @@ void RoboGlue_GUI::on_btn_play_clicked() {
|
||||
param["action"] = "stop";
|
||||
ui->btn_record->setEnabled(true);
|
||||
ui->btn_realtime->setEnabled(true);
|
||||
ui->btn_home->setEnabled(true);
|
||||
ui->btn_play->setText("Play");
|
||||
ui->txt_fileName->setEnabled(true);
|
||||
enableLockAxes();
|
||||
@@ -254,6 +258,7 @@ void RoboGlue_GUI::on_btn_open_clicked() {
|
||||
param["metadata"] = metadata;
|
||||
ui->btn_record->setEnabled(false);
|
||||
ui->btn_realtime->setEnabled(false);
|
||||
ui->btn_home->setEnabled(false);
|
||||
ui->btn_open->setText("Close");
|
||||
ui->txt_fileName->setEnabled(false);
|
||||
} else {
|
||||
@@ -262,6 +267,7 @@ void RoboGlue_GUI::on_btn_open_clicked() {
|
||||
param["action"] = "close";
|
||||
ui->btn_record->setEnabled(true);
|
||||
ui->btn_realtime->setEnabled(true);
|
||||
ui->btn_home->setEnabled(true);
|
||||
ui->btn_open->setText("Open");
|
||||
ui->txt_fileName->setEnabled(true);
|
||||
}
|
||||
@@ -295,6 +301,16 @@ void RoboGlue_GUI::on_btn_realtime_clicked() {
|
||||
emit m->commonStatusChange();
|
||||
emit sendROScommand("REALTIME", param);
|
||||
}
|
||||
|
||||
void RoboGlue_GUI::on_btn_home_clicked() {
|
||||
QVariantMap param;
|
||||
modlog->debug("robotHome");
|
||||
param["action"] = "start";
|
||||
param["execute"] = ui->chk_execute->isChecked();
|
||||
emit m->commonStatusChange();
|
||||
emit sendROScommand("HOME", param);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////
|
||||
////////END INTERNAL PRIVATE SLOTS//////////////
|
||||
////////////////////////////////////////////////
|
||||
@@ -339,5 +355,4 @@ void RoboGlue_GUI::on_newRobotData() {
|
||||
////////////////////////////////////////////////
|
||||
//////// END EXTERNAL PUBLIC SLOTS /////////////
|
||||
////////////////////////////////////////////////
|
||||
|
||||
|
||||
///
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
* 20190322 - Modifica dei nomi segnali tra questo modulo e com.
|
||||
* 20190402 - Aggiunte due spinbox per il settaggio di delta tempo e delta spazio da salvare nel
|
||||
* file dei metadati per la pianificazione dei persorsi salvati
|
||||
* 20191023 - Spostati i commenti in GIT
|
||||
*/
|
||||
|
||||
#include <QMainWindow>
|
||||
@@ -91,7 +92,7 @@ private slots:
|
||||
void on_btn_record_clicked();
|
||||
void on_btn_play_clicked();
|
||||
void on_btn_realtime_clicked();
|
||||
|
||||
void on_btn_home_clicked();
|
||||
void on_btn_open_clicked();
|
||||
|
||||
signals:
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>945</width>
|
||||
<height>750</height>
|
||||
<width>1108</width>
|
||||
<height>760</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
@@ -17,7 +17,7 @@
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tab_mainWindow">
|
||||
<property name="currentIndex">
|
||||
@@ -1050,6 +1050,35 @@
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="1">
|
||||
<widget class="QRadioButton" name="rad_pos">
|
||||
<property name="text">
|
||||
<string>POS</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">grp_mod</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QRadioButton" name="rad_vel">
|
||||
<property name="text">
|
||||
<string>VEL</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">grp_mod</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_realtime">
|
||||
<property name="text">
|
||||
@@ -1077,33 +1106,30 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="rad_pos">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_home">
|
||||
<property name="text">
|
||||
<string>POS</string>
|
||||
<string>GoHOME</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">grp_mod</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="rad_vel">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chk_execute">
|
||||
<property name="text">
|
||||
<string>VEL</string>
|
||||
<string>Execute</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">grp_mod</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line_11">
|
||||
<property name="orientation">
|
||||
@@ -1290,7 +1316,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>945</width>
|
||||
<width>1108</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -1313,11 +1339,11 @@
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="grp_mod"/>
|
||||
<buttongroup name="grp_hilo"/>
|
||||
<buttongroup name="gpr_lock">
|
||||
<property name="exclusive">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</buttongroup>
|
||||
<buttongroup name="grp_hilo"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
||||
@@ -51,7 +51,7 @@ bool UR_CLinterface::connect(const char* ip, uint16_t port) {
|
||||
try {
|
||||
rsocket->connect(
|
||||
tcp::endpoint(boost::asio::ip::address::from_string(ip), port));
|
||||
if ((bool) rsocket->is_open()) {
|
||||
if (static_cast<bool>(rsocket->is_open())) {
|
||||
log->info("Connected to {0} on port {1}", ip, port);
|
||||
return true;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ void UR_CLinterface::sendCommand(std::string command) {
|
||||
char* dataOut=NULL;
|
||||
if (rsocket->is_open()){
|
||||
command = command + '\n';
|
||||
dataOut = (char*)malloc(command.size());
|
||||
dataOut = static_cast<char*>(malloc(command.size()));
|
||||
strncpy(dataOut, command.c_str(), command.size());
|
||||
log->debug("Sending: {}, s:{}",dataOut,command.size());
|
||||
boost::asio::write(*rsocket, boost::asio::buffer(dataOut, command.size()), error);
|
||||
@@ -106,7 +106,7 @@ void UR_CLinterface::parseData(void){
|
||||
subP = new versionSub(lastData, &clientData);
|
||||
subP->parse();
|
||||
firstMessage=false;
|
||||
long t=(long)clientData.versonMessage.timestamp;
|
||||
long t=static_cast<long>(clientData.versonMessage.timestamp);
|
||||
std::string timestr=std::string(asctime(gmtime(&t)));
|
||||
timestr.pop_back();
|
||||
log->info("Connection Time: {}", timestr);
|
||||
@@ -185,7 +185,7 @@ void UR_CLinterface::parseData(void){
|
||||
subP = new toolModeSub(&lastData[currIndex], &clientData);
|
||||
break;
|
||||
case SAFETY_DATA:
|
||||
//not yet implemented
|
||||
//TODO: not yet implemented
|
||||
break;
|
||||
default:
|
||||
log->error("Unknown Subpackage: {}", subPackageType);
|
||||
@@ -194,7 +194,7 @@ void UR_CLinterface::parseData(void){
|
||||
if (subP != NULL) subP->parse();
|
||||
currIndex+=subPackageSize;
|
||||
} catch (long sizediff){
|
||||
log->error("Package Length Mismatch: {}",sizediff);
|
||||
log->error("Package Length Mismatch: type_{:d}, diff_{:d}",subPackageType,sizediff);
|
||||
currIndex+=subPackageSize;
|
||||
}
|
||||
}
|
||||
@@ -225,7 +225,7 @@ void UR_CLinterface::readData(void) {
|
||||
// all number are represented in network byte order, conversion required
|
||||
packlen = ntohl(packlen);
|
||||
// allocate memory for incoming package
|
||||
lastData = (unsigned char*)malloc(packlen);
|
||||
lastData = static_cast<unsigned char*>(malloc(packlen));
|
||||
// blocking read of exactly packlen bytes
|
||||
readata += boost::asio::read(*rsocket, receive_buffer,boost::asio::transfer_exactly(packlen), error);
|
||||
//retreive all data from buffer
|
||||
|
||||
@@ -366,6 +366,7 @@ namespace subpackage {
|
||||
v->feedriveButtonPressed = this->getUChar(&dataIn);
|
||||
v->feedriveButtonEnabled = this->getUChar(&dataIn);
|
||||
v->ioEnableFeedrive = this->getUChar(&dataIn);
|
||||
v->foo = this->getUChar(&dataIn);
|
||||
|
||||
// check if read data is aligned with package size
|
||||
if (dataIn-begin != size) throw dataIn-begin-size;
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace subpackage {
|
||||
robotModeSub(unsigned char* din, clientData_t* dout) {
|
||||
dataIn=din;
|
||||
dataOut=dout;
|
||||
};
|
||||
}
|
||||
virtual ~robotModeSub();
|
||||
|
||||
uint32_t parse();
|
||||
@@ -51,7 +51,7 @@ namespace subpackage {
|
||||
jointDataSub(unsigned char* din, clientData_t* dout) {
|
||||
dataIn=din;
|
||||
dataOut=dout;
|
||||
};
|
||||
}
|
||||
virtual ~jointDataSub();
|
||||
|
||||
uint32_t parse();
|
||||
@@ -62,7 +62,7 @@ namespace subpackage {
|
||||
cartesianInfoSub(unsigned char* din, clientData_t* dout) {
|
||||
dataIn=din;
|
||||
dataOut=dout;
|
||||
};
|
||||
}
|
||||
virtual ~cartesianInfoSub();
|
||||
|
||||
uint32_t parse();
|
||||
@@ -73,7 +73,7 @@ namespace subpackage {
|
||||
masterBoardSub(unsigned char* din, clientData_t* dout) {
|
||||
dataIn=din;
|
||||
dataOut=dout;
|
||||
};
|
||||
}
|
||||
virtual ~masterBoardSub();
|
||||
|
||||
uint32_t parse();
|
||||
@@ -84,7 +84,7 @@ namespace subpackage {
|
||||
toolDataSub(unsigned char* din, clientData_t* dout) {
|
||||
dataIn=din;
|
||||
dataOut=dout;
|
||||
};
|
||||
}
|
||||
virtual ~toolDataSub();
|
||||
|
||||
uint32_t parse();
|
||||
@@ -95,7 +95,7 @@ namespace subpackage {
|
||||
kineInfoSub(unsigned char* din, clientData_t* dout) {
|
||||
dataIn=din;
|
||||
dataOut=dout;
|
||||
};
|
||||
}
|
||||
virtual ~kineInfoSub();
|
||||
|
||||
uint32_t parse();
|
||||
@@ -106,7 +106,7 @@ namespace subpackage {
|
||||
configurationSub(unsigned char* din, clientData_t* dout) {
|
||||
dataIn=din;
|
||||
dataOut=dout;
|
||||
};
|
||||
}
|
||||
virtual ~configurationSub();
|
||||
|
||||
uint32_t parse();
|
||||
@@ -117,7 +117,7 @@ namespace subpackage {
|
||||
forceModeSub(unsigned char* din, clientData_t* dout) {
|
||||
dataIn=din;
|
||||
dataOut=dout;
|
||||
};
|
||||
}
|
||||
virtual ~forceModeSub();
|
||||
|
||||
uint32_t parse();
|
||||
@@ -128,7 +128,7 @@ namespace subpackage {
|
||||
additionalInfoSub(unsigned char* din, clientData_t* dout) {
|
||||
dataIn=din;
|
||||
dataOut=dout;
|
||||
};
|
||||
}
|
||||
virtual ~additionalInfoSub();
|
||||
|
||||
uint32_t parse();
|
||||
@@ -139,7 +139,7 @@ namespace subpackage {
|
||||
calibrationSub(unsigned char* din, clientData_t* dout) {
|
||||
dataIn=din;
|
||||
dataOut=dout;
|
||||
};
|
||||
}
|
||||
virtual ~calibrationSub();
|
||||
|
||||
uint32_t parse();
|
||||
@@ -150,7 +150,7 @@ namespace subpackage {
|
||||
toolComSub(unsigned char* din, clientData_t* dout) {
|
||||
dataIn=din;
|
||||
dataOut=dout;
|
||||
};
|
||||
}
|
||||
virtual ~toolComSub();
|
||||
|
||||
uint32_t parse();
|
||||
@@ -161,7 +161,7 @@ namespace subpackage {
|
||||
toolModeSub(unsigned char* din, clientData_t* dout) {
|
||||
dataIn=din;
|
||||
dataOut=dout;
|
||||
};
|
||||
}
|
||||
virtual ~toolModeSub();
|
||||
|
||||
uint32_t parse();
|
||||
@@ -171,7 +171,8 @@ namespace subpackage {
|
||||
public:
|
||||
versionSub(unsigned char* din, clientData_t* dout) {
|
||||
dataIn=din;
|
||||
dataOut=dout; };
|
||||
dataOut=dout;
|
||||
}
|
||||
virtual ~versionSub();
|
||||
|
||||
uint32_t parse();
|
||||
|
||||
@@ -273,6 +273,7 @@ typedef struct {
|
||||
unsigned char feedriveButtonPressed;
|
||||
unsigned char feedriveButtonEnabled;
|
||||
unsigned char ioEnableFeedrive;
|
||||
unsigned char foo;
|
||||
} additionalInfo_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -12,30 +12,30 @@ connection\autoconnect=false
|
||||
connection\robotip=10.0.0.5
|
||||
connection\robotport=30002
|
||||
connection\robotretry=5
|
||||
kine\dhtable\1\dha=0
|
||||
kine\dhtable\1\dhalpha=0
|
||||
kine\dhtable\1\dhd=0
|
||||
kine\dhtable\1\dhtheta=0
|
||||
kine\dhtable\1\dha=6.94460589082162e-310
|
||||
kine\dhtable\1\dhalpha=6.9446058912971e-310
|
||||
kine\dhtable\1\dhd=1.099340831232476e+248
|
||||
kine\dhtable\1\dhtheta=1.332e-320
|
||||
kine\dhtable\2\dha=0
|
||||
kine\dhtable\2\dhalpha=0
|
||||
kine\dhtable\2\dhd=0
|
||||
kine\dhtable\2\dhtheta=0
|
||||
kine\dhtable\2\dhalpha=6.9446058912884e-310
|
||||
kine\dhtable\2\dhd=1.3849777432376169e+219
|
||||
kine\dhtable\2\dhtheta=6.9446058913382e-310
|
||||
kine\dhtable\3\dha=0
|
||||
kine\dhtable\3\dhalpha=0
|
||||
kine\dhtable\3\dhd=0
|
||||
kine\dhtable\3\dhtheta=0
|
||||
kine\dhtable\4\dha=0
|
||||
kine\dhtable\4\dhalpha=0
|
||||
kine\dhtable\3\dhalpha=5.53e-322
|
||||
kine\dhtable\3\dhd=2.44861994589e-312
|
||||
kine\dhtable\3\dhtheta=8e-323
|
||||
kine\dhtable\4\dha=2.37e-322
|
||||
kine\dhtable\4\dhalpha=2.37e-322
|
||||
kine\dhtable\4\dhd=0
|
||||
kine\dhtable\4\dhtheta=0
|
||||
kine\dhtable\5\dha=0
|
||||
kine\dhtable\5\dhalpha=0
|
||||
kine\dhtable\5\dhd=0
|
||||
kine\dhtable\5\dhtheta=0
|
||||
kine\dhtable\6\dha=0
|
||||
kine\dhtable\6\dhalpha=0
|
||||
kine\dhtable\6\dhd=0
|
||||
kine\dhtable\6\dhtheta=0
|
||||
kine\dhtable\5\dha=2.57e-322
|
||||
kine\dhtable\5\dhalpha=2.57e-322
|
||||
kine\dhtable\5\dhd=2.06e-321
|
||||
kine\dhtable\5\dhtheta=8.74e-322
|
||||
kine\dhtable\6\dha=6.9446058915066e-310
|
||||
kine\dhtable\6\dhalpha=6.9446058913493e-310
|
||||
kine\dhtable\6\dhd=6.94460589137854e-310
|
||||
kine\dhtable\6\dhtheta=6.94460589137854e-310
|
||||
kine\dhtable\size=6
|
||||
kine\maxreach=@Variant(\0\0\0\x87?\x99\x99\x9a)
|
||||
kine\prefix=0
|
||||
|
||||
Reference in New Issue
Block a user