Changeset 71 in pacpussensors for trunk/Sick/SickLDMRSSensor.cpp
- Timestamp:
- Nov 19, 2014, 10:24:51 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Sick/SickLDMRSSensor.cpp
r61 r71 126 126 LOG_TRACE("(Recording) Not recording..."); 127 127 128 129 128 #ifdef SICKLDMRS_SH_MEM 130 129 shmem_ = new ShMem(kSickMemoryName.c_str(), sizeof(ScanSickData)); … … 323 322 // we have a complete message available that we can add to the list 324 323 MessageLDMRS msg; 325 326 // we copy the bytes in the body message327 // char* messageData = (char*)malloc(msgSize);328 // if(messageData == NULL){329 // LOG_FATAL("(Packet reconstitution) Malloc FAILED. Packet lost.");330 // return;331 // }332 324 memcpy(msg.body, pendingBytes.data.c_str() + index, msgSize); 333 325 … … 375 367 scanPoints[i].layerEcho = *((uchar*)(msg.body + index)); 376 368 scanPoints[i].flags = *((uchar*)(msg.body + index + 1)); 377 scanPoints[i].angle = *(( uint16_t*)(msg.body + index + 2));369 scanPoints[i].angle = *((int16_t*)(msg.body + index + 2)); 378 370 scanPoints[i].distance = *((uint16_t*)(msg.body + index + 4)); 379 371 scanPoints[i].echoPulseWidth = *((uint16_t*)(msg.body + index + 6)); 380 } 381 382 372 index+=10; 373 } 374 memcpy(msg.body, scanPoints, sizeof(ScanPoint) * msg.hScan.numPoints); 383 375 384 376 delete[] scanPoints; … … 392 384 // TODO 393 385 } 394 395 396 386 return msg.hData.dataType; 397 387 }
Note:
See TracChangeset
for help on using the changeset viewer.