Skip to content

Commit f619fc3

Browse files
committed
Minor improvements to debug output.
1 parent 3e3784e commit f619fc3

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

include/liboculus/BearingData.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ class BearingData {
6666
}
6767

6868
float front() const {
69-
return _data[0];
69+
return _data[0] / 100.0;
7070
}
7171

7272
float back() const {
73-
return _data[_numBeams-1];
73+
return _data[_numBeams-1] / 100.0;
7474
}
7575

7676
private:

include/liboculus/PingAgreesWithConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ bool checkPingAgreesWithConfig( const SimplePingResult<PingT> &ping,
4343
OculusSimpleFireFlags flags(ping.fireMsg()->flags);
4444

4545
const auto nBeams = ping.ping()->nBeams;
46-
const auto nRanges = ping.ping()->nRanges;
46+
// (Not used right now) const auto nRanges = ping.ping()->nRanges;
4747
const auto dataSize = ping.ping()->dataSize;
4848

4949
if (config.get512Beams()) {

include/liboculus/SimplePingResult.h

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <string>
3535
#include <vector>
3636
#include <cassert>
37+
#include <iomanip>
3738

3839
#include <g3log/g3log.hpp>
3940

@@ -179,29 +180,31 @@ void SimplePingResult<Ping_t>::dump() const {
179180
LOG(DEBUG) << "--------------";
180181
SimpleFireMsg_t::dump();
181182

182-
LOG(DEBUG) << " Ping ID: " << this->ping()->pingId;
183-
LOG(DEBUG) << " Status: " << this->ping()->status;
184-
LOG(DEBUG) << " Ping start time: " << this->ping()->pingStartTime;
183+
LOG(DEBUG) << " Ping ID: " << this->ping()->pingId;
184+
LOG(DEBUG) << " Status: " << this->ping()->status;
185+
LOG(DEBUG) << " Ping start time: " << this->ping()->pingStartTime;
185186

186-
LOG(DEBUG) << " Frequency: " << this->ping()->frequency;
187-
LOG(DEBUG) << " Temperature: " << this->ping()->temperature;
188-
LOG(DEBUG) << " Pressure: " << this->ping()->pressure;
189-
LOG(DEBUG) << "Spd of Sound: " << this->ping()->speedOfSoundUsed;
190-
LOG(DEBUG) << " Range res: " << this->ping()->rangeResolution << " m";
187+
LOG(DEBUG) << " Frequency: " << this->ping()->frequency;
188+
LOG(DEBUG) << " Temperature: " << this->ping()->temperature;
189+
LOG(DEBUG) << " Pressure: " << this->ping()->pressure;
190+
LOG(DEBUG) << "Spd of Sound used: " << this->ping()->speedOfSoundUsed;
191+
LOG(DEBUG) << " Range res: " << this->ping()->rangeResolution << " m";
191192

192193
if (this->flags().getRangeAsMeters()) {
193-
LOG(DEBUG) << " Calc range: " << this->ping()->rangeResolution*this->ping()->nRanges << " m";
194-
} else {
194+
LOG(DEBUG) << " Calc range: " << this->ping()->rangeResolution*this->ping()->nRanges << " m";
195+
} else {
195196
LOG(DEBUG) << " Pct range: " << this->ping()->rangeResolution*this->ping()->nRanges;
196197
}
197198

198-
LOG(DEBUG) << " Num range: " << this->ping()->nRanges;
199-
LOG(DEBUG) << " Num beams: " << this->ping()->nBeams;
199+
LOG(DEBUG) << " Num range: " << this->ping()->nRanges;
200+
LOG(DEBUG) << " Num beams: " << this->ping()->nBeams;
201+
LOG(DEBUG) << "Azimuth range: " << std::setprecision(4) << bearings().front() << " - " << bearings().back();
202+
200203

201204
LOG(DEBUG) << " Image size: " << this->ping()->imageSize;
202-
LOG(DEBUG) << "Image offset: " << this->ping()->imageOffset;
203-
LOG(DEBUG) << " Data size: " << DataSizeToString(this->ping()->dataSize);
204-
LOG(DEBUG) << "Message size: " << this->ping()->messageSize;
205+
LOG(DEBUG) << " Image offset: " << this->ping()->imageOffset;
206+
LOG(DEBUG) << " Data size: " << DataSizeToString(this->ping()->dataSize);
207+
LOG(DEBUG) << " Message size: " << this->ping()->messageSize;
205208
LOG(DEBUG) << "--------------";
206209
}
207210

tools/oculus_client.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,11 @@ int main(int argc, char **argv) {
162162

163163
ping.dump();
164164

165-
const auto bearings = ping.bearings();
166-
LOG(INFO) << "Azimuth range = " << bearings.front() << " - " << bearings.back();
167-
168-
const auto gains = ping.gains();
169-
if (gains.size() > 0) {
170-
LOG(INFO) << "First five gains " << gains[10] << ", " << gains[11] << ", "
171-
<< gains[12] << ", " << gains[13] << ", " << gains[14];
172-
}
165+
// const auto gains = ping.gains();
166+
// if (gains.size() > 0) {
167+
// LOG(INFO) << "First five gains " << gains[10] << ", " << gains[11] << ", "
168+
// << gains[12] << ", " << gains[13] << ", " << gains[14];
169+
// }
173170

174171
if (output.is_open()) {
175172
const char *cdata = reinterpret_cast<const char *>(ping.buffer()->data());

0 commit comments

Comments
 (0)