History

switch calls to printLog to QDebug

Stephen Birarda committed 13 years ago

Commit afe49bc1 parent d38955a54 files · +416 −451Browse files

Showing the changes to interface/src/SerialInterface.cpp (1 of 54 files). Show all

Unified · Split

interface/src/SerialInterface.cpp+26−4
@@ -36,6 +36,28 @@ const int LONG_TERM_RATE_SAMPLES = 1000; · 35 unmodified lines
3636
3737 const bool USING_INVENSENSE_MPU9150 = 1;
3838
39+SerialInterface::SerialInterface() :
40+ _active(false),
41+ _gravity(0, 0, 0),
42+ _averageRotationRates(0, 0, 0),
43+ _averageAcceleration(0, 0, 0),
44+ _estimatedRotation(0, 0, 0),
45+ _estimatedPosition(0, 0, 0),
46+ _estimatedVelocity(0, 0, 0),
47+ _lastAcceleration(0, 0, 0),
48+ _lastRotationRates(0, 0, 0),
49+ _compassMinima(-211, -132, -186),
50+ _compassMaxima(89, 95, 98),
51+ _angularVelocityToLinearAccel(0.003f, -0.001f, -0.006f,
52+ -0.005f, -0.001f, -0.006f,
53+ 0.010f, 0.004f, 0.007f),
54+ _angularAccelToLinearAccel(0.0f, 0.0f, 0.002f,
55+ 0.0f, 0.0f, 0.001f,
56+ -0.002f, -0.002f, 0.0f)
57+{
58+
59+}
60+
3961 void SerialInterface::pair() {
4062
4163 #ifndef _WIN32
@@ -75,10 +97,10 @@ void SerialInterface::initializePort(char* portname) { · 33 unmodified lines
7597 #ifndef _WIN32
7698 _serialDescriptor = open(portname, O_RDWR | O_NOCTTY | O_NDELAY);
7799
78− printLog("Opening SerialUSB %s: ", portname);
100+ qDebug("Opening SerialUSB %s: ", portname);
79101
80102 if (_serialDescriptor == -1) {
81− printLog("Failed.\n");
103+ qDebug("Failed.\n");
82104 return;
83105 }
84106
@@ -112,7 +134,7 @@ void SerialInterface::initializePort(char* portname) { · 27 unmodified lines
112134 mpu_set_sensors(INV_XYZ_GYRO | INV_XYZ_ACCEL | INV_XYZ_COMPASS);
113135 }
114136
115− printLog("Connected.\n");
137+ qDebug("Connected.\n");
116138 resetSerial();
117139
118140 _active = true;
@@ -351,7 +373,7 @@ void SerialInterface::readData(float deltaTime) { · 232 unmodified lines
351373 gettimeofday(&now, NULL);
352374
353375 if (diffclock(&lastGoodRead, &now) > NO_READ_MAXIMUM_MSECS) {
354− printLog("No data - Shutting down SerialInterface.\n");
376+ qDebug("No data - Shutting down SerialInterface.\n");
355377 resetSerial();
356378 }
357379 } else {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t