Can I interface Isaac with Qt?

Hello,
I want to print on a Qt GUI some Isaac outputs, is this possible ?

Thank you

I think it maybe possible,
I found this example that show how to run Qt with bazel, I will try to run ping pong between Isaac and Qt and will update this post with my code as soon as I succeed.

Thanks Planktos for your contribution. We have a plan for QT GUI graph builder that makes building graph easier.

Hi to be totally honest it seems a lot easier to interface Qt and Isaac with TCP connection than to make bazel and build files to make them compatible moreover running a Qt thread inside a Isaac thread look like very risky. Maybe the staff will know how to do that since they have access to the source code but having no insight on the Isaac thread mechanism I will try the TCP way.
regards

Hi,
I successfully sent the datas of the skeleton pos to Qt and it work perfectly using TCP and ping proto.
Qt on the left and Isaac on the right :D
(The error ratio is the ratio of empty TCP request so not really errors)

This is my Isaac code :

#include "poseRX.hpp"
namespace isaac {
void PoseRX::start() {
  // By using tickOnMessage instead of tickPeriodically we instruct the codelet to only tick when
  // a new message is received on the incoming data channel `trigger`.
  tickOnMessage(rx_skeletons());
}

void PoseRX::tick() {
	std::string tcpstring;
	tcpstring += "AAAA";
  // Parse the message we received
  // create cap'n Proto List of Skeleton2Proto
    auto skeleton_list = rx_skeletons().getProto().getSkeletons();
    for(size_t i = 0; i < skeleton_list.size(); i++) {
      // for each Skeleton2Proto, create cap'n Proto List of Joint2Proto
      auto joint_list = skeleton_list[i].getJoints();
      for(size_t ii = 0; ii < joint_list.size(); ii++) {
	//retrive joint label, this is a string
         std::string joint_label= joint_list[ii].getLabel().getLabel();
	 tcpstring += "B";     
	 tcpstring += joint_label;
	 std::printf("Label:  %s    |    ",joint_label.c_str());
         // retrieve joint prediction confidence, this is a float
         float joint_conf = joint_list[ii].getLabel().getConfidence();
	 std::printf("conf :  %f    |    ",joint_conf);
         // retrieve X position in image of joint (be warned, this is a float too)
         float joint_x = joint_list[ii].getPosition().getX();
	 tcpstring += "=";     
	 std::ostringstream ssx;
	ssx << joint_x;
	std::string sx(ssx.str());
	 tcpstring += sx;     
	      //tcpstring += boost::lexical_cast<std::string>(joint_x);     
	 std::printf("x :  %f    |    ",joint_x);
         // retrieve Y position in image of joint (be warned, this is a float too)
         float joint_y = joint_list[ii].getPosition().getY();
	 tcpstring += "=";     
	std::ostringstream ssy;
	ssy << joint_y;
	std::string sy(ssy.str());
	 tcpstring += sy;   
	 //tcpstring += boost::lexical_cast<std::string>(joint_y);          
	 std::printf("y :  %f   \n",joint_y);
       }
     }
  tcpstring += "AAAA";
   std::printf("--------------------------------------------------------------------------------\n");   
  auto tcp = tx_TCPskeletons().initProto();
  tcp.setMessage(tcpstring);
  tx_TCPskeletons().publish();
}
}  // namespace isaac

And this is my Qt code :

#include "mytcpsocket.h"

MyTcpSocket::MyTcpSocket(QObject *parent) :
    QObject(parent)
{
}

void MyTcpSocket::doConnect()
{
    socket = new QTcpSocket(this);

    connect(socket, SIGNAL(connected()),this, SLOT(connected()));
    connect(socket, SIGNAL(disconnected()),this, SLOT(disconnected()));
    connect(socket, SIGNAL(bytesWritten(qint64)),this, SLOT(bytesWritten(qint64)));
    connect(socket, SIGNAL(readyRead()),this, SLOT(readyRead()));

    qDebug() << "connecting...";

    // this is not blocking call
    socket->connectToHost("Localhost", 5005);

    // we need to wait...
    if(!socket->waitForConnected(5000))
    {
        qDebug() << "Error: " << socket->errorString();
    }
}

void MyTcpSocket::connected()
{
    qDebug() << "connected...";

    // Hey server, tell me about you.
    socket->write("HEAD / HTTP/1.0\r\n\r\n\r\n\r\n");
}

void MyTcpSocket::disconnected()
{
    qDebug() << "disconnected...";
}

void MyTcpSocket::bytesWritten(qint64 bytes)
{
    qDebug() << bytes << " bytes written...";
}

void MyTcpSocket::readyRead()
{
    //Get Message
    QByteArray rawdata =  socket->readAll();
    //qDebug()<<"raw : "<<rawdata;
    std::string refined;
    unsigned int pos =0;
    while(rawdata[pos]!='A'&&rawdata[pos+1]!='A'&&rawdata[pos+2]!='A'&&rawdata[pos+3]!='A'&&pos<rawdata.length()){pos++;}//
    qDebug()<<"pos : "<<pos;
    pos+=7;
    while (rawdata[pos]!='A'&&rawdata[pos+1]!='A'&&rawdata[pos+2]!='A'&&rawdata[pos+2]!='A'&&pos<rawdata.length()){//
        refined += (char)(rawdata[pos]);
        pos++;
    }
    if(refined.length()<2||refined.length()>400){qDebug()<<"ERROR, lenght = "<<refined.length();errorcount++;}
    loop++;
    //qDebug()<<"refined : "<<refined;
    qDebug()<<"error ratio = "<<errorcount<<"/"<<loop<<" = "<<100*errorcount/loop<<"%";
    qDebug()<<"------------------------------------------";
    //Message to floats
    float skepos[17][2];// ske order x,y NoseNeckRshoRelbRwriLshoLelbRhipRkneRankLhipLkneLankLeyeReyeLearRear
    pos=0;int bone=0;bool axe=0;
    std::string::size_type sz;     // alias of size_t
    std::string temps ="";
    while(pos<refined.length()&&bone<17){
        if(refined[pos]=='='){
            temps="";
            pos++;
            while(refined[pos]!='='&&refined[pos]!='B'&&pos<refined.length()){
                temps += (char)(refined[pos]);
                pos++;
            }
            skepos[bone][axe]= std::stof (temps,&sz);
            if(axe==1){bone++;}
            axe=!axe;
            pos--;
        }
        pos++;
    }
    qDebug()<<"Nose x ="<<skepos[0][0]<<"Nose y ="<<skepos[0][1];
    qDebug()<<"Neck x ="<<skepos[1][0]<<"Nose y ="<<skepos[1][1];
    qDebug()<<"Rsho x ="<<skepos[2][0]<<"Nose y ="<<skepos[2][1];
    qDebug()<<"Relb x ="<<skepos[3][0]<<"Nose y ="<<skepos[3][1];
    qDebug()<<"Rwri x ="<<skepos[4][0]<<"Nose y ="<<skepos[4][1];
    qDebug()<<"Lsho x ="<<skepos[5][0]<<"Nose y ="<<skepos[5][1];
    qDebug()<<"Lelb x ="<<skepos[6][0]<<"Nose y ="<<skepos[6][1];
    qDebug()<<"Rhip x ="<<skepos[7][0]<<"Nose y ="<<skepos[7][1];
    qDebug()<<"Rkne x ="<<skepos[8][0]<<"Nose y ="<<skepos[8][1];
    qDebug()<<"Rank x ="<<skepos[9][0]<<"Nose y ="<<skepos[9][1];
    qDebug()<<"Lhip x ="<<skepos[10][0]<<"Nose y ="<<skepos[10][1];
    qDebug()<<"Lkne x ="<<skepos[11][0]<<"Nose y ="<<skepos[11][1];
    qDebug()<<"Lank x ="<<skepos[12][0]<<"Nose y ="<<skepos[12][1];
    qDebug()<<"Leye x ="<<skepos[13][0]<<"Nose y ="<<skepos[13][1];
    qDebug()<<"Reye x ="<<skepos[14][0]<<"Nose y ="<<skepos[14][1];
    qDebug()<<"Lear x ="<<skepos[15][0]<<"Nose y ="<<skepos[15][1];
    qDebug()<<"Rear x ="<<skepos[16][0]<<"Nose y ="<<skepos[16][1];
}