Skip to content

Commit

Permalink
针对G4修改单包最大点数导致的崩溃问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanyiaini committed Feb 5, 2025
1 parent 1140e64 commit 16ca1f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/common/ydlidar_protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@

//Package
#define TRI_PACKHEADSIZE 10
#define TRI_PACKMAXNODES 40 //单包最大点数
#define TRI_PACKMAXNODES 80 //单包最大点数(G4最大点数为80,其它三角等最大均为40)
#define TIA_PACKWIDTH 12 //TIA单包行数
#define TIA_PACKHEIGHT 16 //TIA单包行数
#define TIA_PACKMAXBUFFS (TIA_PACKWIDTH * (4 + TIA_PACKHEIGHT * 4) + 4 + 4) //TIA-H单包最大字节数
Expand Down
6 changes: 3 additions & 3 deletions src/YDlidarDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ namespace ydlidar
// 解析扫描数据线程主函数
int YDlidarDriver::cacheScanData()
{
node_info local_buf[128];
size_t count = 128;
node_info local_buf[TRI_PACKMAXNODES];
size_t count = TRI_PACKMAXNODES;
node_info local_scan[MAX_SCAN_NODES];
size_t scan_count = 0;
result_t ans = RESULT_FAIL;
Expand All @@ -629,7 +629,7 @@ namespace ydlidar

while (m_isScanning)
{
count = 128;
count = TRI_PACKMAXNODES;
ans = waitScanData(local_buf, count, DEFAULT_TIMEOUT / 2);
if (!IS_OK(ans))
{
Expand Down

0 comments on commit 16ca1f4

Please sign in to comment.