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 @@
GCC=gcc
GXX=g++
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))
# Directories
......
......@@ -9,6 +9,13 @@
namespace microcart
{
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())
{
......@@ -17,20 +24,7 @@ namespace microcart
Tracker::Tracker(const char * server) :
remote(server),
stop_flag(0),
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
}
})
trackerData()
{
remote.register_change_handler(this, vrpn_cb);
......@@ -123,6 +117,7 @@ extern "C"
try {
auto inst = new struct ucart_vrpn_tracker;
inst->t = new microcart::Tracker(server);
return inst;
} catch(...) {
return NULL;
}
......
......@@ -54,6 +54,7 @@ extern "C"
namespace microcart
{
struct TrackerData {
public:
double x;
double y;
double z;
......@@ -64,6 +65,8 @@ namespace microcart
double fps;
timeval timestamp;
TrackerData();
};
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