Skip to content
Snippets Groups Projects
Unverified Commit e8c6ac7c authored by Jake Drahos's avatar Jake Drahos
Browse files

Added constructor for TrackerData

parent 763b4952
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
GCC=gcc GCC=gcc
GXX=g++ GXX=g++
CFLAGS= -Wall -Wpedantic -Wextra -Werror -std=c99 -g -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable CFLAGS= -Wall -Wpedantic -Wextra -Werror -std=c99 -g -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable
CXXFLAGS= -Wall -Wno-reorder -std=c++0x -g CXXFLAGS= -Wall -Wpedantic -Wextra -Werror -Wno-reorder -Wno-unused-variable -std=c++0x -g
INCLUDES = $(foreach dir, $(INCDIR), -I$(dir)) INCLUDES = $(foreach dir, $(INCDIR), -I$(dir))
# Directories # Directories
......
...@@ -9,6 +9,13 @@ ...@@ -9,6 +9,13 @@
namespace microcart namespace microcart
{ {
static void VRPN_CALLBACK vrpn_cb(void * param, const vrpn_TRACKERCB t); static void VRPN_CALLBACK vrpn_cb(void * param, const vrpn_TRACKERCB t);
TrackerData::TrackerData() :
x(0.0), y(0.0), z(0.0),
pitch(0.0), roll(0.0), yaw(0.0),
fps(0.0), timestamp()
{
}
Tracker::Tracker(std::string server) : Tracker(server.c_str()) Tracker::Tracker(std::string server) : Tracker(server.c_str())
{ {
...@@ -17,20 +24,7 @@ namespace microcart ...@@ -17,20 +24,7 @@ namespace microcart
Tracker::Tracker(const char * server) : Tracker::Tracker(const char * server) :
remote(server), remote(server),
stop_flag(0), stop_flag(0),
trackerData({ trackerData()
.x = 0.0,
.y = 0.0,
.z = 0.0,
.pitch = 0.0,
.roll = 0.0,
.yaw = 0.0,
.fps = 0.0,
.timestamp = {
.tv_sec = 0,
.tv_usec = 0
}
})
{ {
remote.register_change_handler(this, vrpn_cb); remote.register_change_handler(this, vrpn_cb);
...@@ -123,6 +117,7 @@ extern "C" ...@@ -123,6 +117,7 @@ extern "C"
try { try {
auto inst = new struct ucart_vrpn_tracker; auto inst = new struct ucart_vrpn_tracker;
inst->t = new microcart::Tracker(server); inst->t = new microcart::Tracker(server);
return inst;
} catch(...) { } catch(...) {
return NULL; return NULL;
} }
......
...@@ -54,6 +54,7 @@ extern "C" ...@@ -54,6 +54,7 @@ extern "C"
namespace microcart namespace microcart
{ {
struct TrackerData { struct TrackerData {
public:
double x; double x;
double y; double y;
double z; double z;
...@@ -64,6 +65,8 @@ namespace microcart ...@@ -64,6 +65,8 @@ namespace microcart
double fps; double fps;
timeval timestamp; timeval timestamp;
TrackerData();
}; };
class Tracker { class Tracker {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment