Bike-X  0.8
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
tests.cpp
Go to the documentation of this file.
1 #include <Ovr.h>
2 #include <iostream>
3 #include <fstream>
4 #include <unistd.h>
5 
6 using namespace std;
7 
8 void test_Ovr()
9 {
10  Ovr sxovr;
11  float x, y, z, w;
12 
13  sxovr.initOVR();
14  sxovr.startSensor();
15  sxovr.getXYZW(&x, &y, &z, &w);
16  cout << sxovr;
17 
18  // DON'T RUN THIS READING UNLESS YOU HAVE THE OVR CONNECTED
19  // OTHERWISE THE REAL DATA IS GONNA BE ERASED
20  // ofstream out;
21  // out.open("readings_.out");
22  // out << "Reads 100 times per second during 10 seconds (10000 readings)\n";
23  // int readings_per_second = 100;
24  // int one_second = 1000000;
25  // int seconds_of_reading = 10;
26  // int readings = seconds_of_reading * readings_per_second;
27  // unsigned int microseconds = one_second / readings_per_second; // 1000000 is one second
28 
37  // // Try to get 10000 readings
38  // for(int i = 0; i < readings; i++)
39  // {
40  // usleep(microseconds);
41  // sxovr.getXYZW(&x, &y, &z, &w);
42  // out << "x = " << x << ", y = " << y << ", z = " << z << ", w = " << w << std::endl;
43  // }
44  // out.close();
45 }
46 
47 int main()
48 {
49  test_Ovr();
50  cout << "Testing ovr" << endl;
51  return 0;
52 }
bool startSensor()
Definition: Ovr.cpp:91
int main()
Definition: tests.cpp:6
Definition: Ovr.h:15
void getXYZW(double *x, double *y, double *z, double *w)
Definition: Ovr.cpp:106
void test_Ovr()
Definition: tests.cpp:8