Changeset 71 in pacpussensors for trunk/Sick/SickLDMRSSensor.cpp


Ignore:
Timestamp:
11/19/14 10:24:51 (10 years ago)
Author:
DHERBOMEZ Gérald
Message:

Correction of Sick LIDAR LDMRS code: problem when decoding the points cloud (with Chunlei Yu).
Correction of a small bug in Win32SerialPort when receiving RX_FLAG.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Sick/SickLDMRSSensor.cpp

    r61 r71  
    126126        LOG_TRACE("(Recording) Not recording...");
    127127
    128 
    129128#ifdef SICKLDMRS_SH_MEM
    130129    shmem_ = new ShMem(kSickMemoryName.c_str(), sizeof(ScanSickData));
     
    323322        // we have a complete message available that we can add to the list
    324323        MessageLDMRS msg;
    325 
    326         // we copy the bytes in the body message
    327 //        char* messageData = (char*)malloc(msgSize);
    328 //        if(messageData == NULL){
    329 //            LOG_FATAL("(Packet reconstitution) Malloc FAILED. Packet lost.");
    330 //            return;
    331 //        }
    332324        memcpy(msg.body, pendingBytes.data.c_str() + index, msgSize);
    333325
     
    375367            scanPoints[i].layerEcho = *((uchar*)(msg.body + index));
    376368            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));
    378370            scanPoints[i].distance = *((uint16_t*)(msg.body + index + 4));
    379371            scanPoints[i].echoPulseWidth = *((uint16_t*)(msg.body + index + 6));
    380         }
    381 
    382         memcpy(msg.body, scanPoints, sizeof(ScanPoint) * msg.hScan.numPoints);
     372                        index+=10;
     373                }
     374                memcpy(msg.body, scanPoints, sizeof(ScanPoint) * msg.hScan.numPoints);
    383375
    384376                delete[] scanPoints;
     
    392384        // TODO
    393385    }
    394 
    395 
    396386    return msg.hData.dataType;
    397387}
Note: See TracChangeset for help on using the changeset viewer.