fix:size initial to fix the hub lvx file generate

This commit is contained in:
Livox-SDK
2019-05-28 17:22:21 +08:00
parent 2765743dea
commit 4b97e69d3b
6 changed files with 40 additions and 23 deletions
+4 -4
View File
@@ -23,7 +23,7 @@
//
#include <time.h>
#include <math.h>
#include <cmath>
#include "lvx_file.h"
#define WRITE_BUFFER_LEN 1024 * 1024
@@ -31,7 +31,7 @@
#define PACK_POINT_NUM 100
#define M_PI 3.14159265358979323846
LvxFileHandle::LvxFileHandle() : cur_offset_(0), cur_frame_index_(0) {
LvxFileHandle::LvxFileHandle() : cur_frame_index_(0), cur_offset_(0) {
}
bool LvxFileHandle::InitLvxFile() {
@@ -148,8 +148,8 @@ void LvxFileHandle::BasePointsHandle(LivoxEthPacket *data, LvxBasePackDetail &pa
packet.point[i].y = static_cast<float>(tmp[i].theta);
packet.point[i].z = static_cast<float>(tmp[i].phi);
packet.point[i].reflectivity = tmp[i].reflectivity;
LivoxPoint temp = { packet.point[i].x * sin(packet.point[i].y) * cos(packet.point[i].z), packet.point[i].x * sin(packet.point[i].y) * sin(packet.point[i].z), packet.point[i].x * cos(packet.point[i].y) };;
LivoxPoint temp = { packet.point[i].x * std::sin(packet.point[i].y) * std::cos(packet.point[i].z), packet.point[i].x * std::sin(packet.point[i].y) * std::sin(packet.point[i].z), packet.point[i].x * std::cos(packet.point[i].y) };
packet.point[i] = temp;
}
}
}
}
+1 -1
View File
@@ -96,7 +96,7 @@ void OnGetLidarUnitsExtrinsicParameter(uint8_t status, uint8_t handle, HubGetExt
strncpy((char *)lidar_info.hub_broadcast_code, broadcast_code_list[0].c_str(), kBroadcastCodeSize);
std::unique_ptr<DeviceInfo[]> device_list(new DeviceInfo[kMaxLidarCount]);
std::unique_ptr<uint8_t> size(new uint8_t);
std::unique_ptr<uint8_t> size(new uint8_t(kMaxLidarCount));
GetConnectedDevices(device_list.get(), size.get());
for (int j = 0; j < kMaxLidarCount; j++) {
if (strncmp(device_list[j].broadcast_code, temp.broadcast_code, kBroadcastCodeSize) == 0) {