rosNodeThread.h 940 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef ___ROSNODETHREAD_H___
#define ___ROSNODETHREAD_H___

#include <QtCore>
#include <QThread>
#include <QStringList>
#include <stdlib.h>
#include <QMutex>
#include <iostream>
#include "assert.h"

#include <ros/ros.h>
#include <ros/network.h>
#include "d_fall_pps/ViconData.h"

using namespace d_fall_pps;

class rosNodeThread : public QObject {
	Q_OBJECT
public:
21
    explicit rosNodeThread(int argc, char **pArgv, const char * topic, QObject *parent = 0);
22
23
24
25
26
27
28
    virtual ~rosNodeThread();

    bool init();

    void messageCallback(const ViconData& data);


29
30
31
32
33
34
35
36

signals:
    // void newViconData(double, double, double, double, double, double);
    void newViconData(double, double);

public slots:
    void run();

37
38
39
40
41
42
43
private:
    int m_Init_argc;
    char** m_pInit_argv;
    const char * m_topic;

    QThread * m_pThread;

44
45
46
    ViconData m_vicon_data;

    ros::Subscriber m_vicon_subscriber;
47
48
49
50
    // ros::Publisher  sim_velocity;
};
#endif